Fundamentals 10 min read

Essential Linux Commands, File Types, and Embedded System Basics Explained

This guide covers core Linux commands, supported file types, inter‑process communication methods, ARM exception categories, interrupt handling steps, GPIO concepts, I2C and SPI pin functions, as well as driver inspection commands, character device creation, synchronization primitives, and key kernel subsystems.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Essential Linux Commands, File Types, and Embedded System Basics Explained

Linux Basic Network Commands

ifconfig : display and configure network interfaces. Example: ifconfig -a shows all interfaces; ifconfig eth0 up activates eth0.

iptables : configure the kernel firewall, e.g., to open or filter ports.

netstat : show network connections, routing tables, and interface statistics.

ping : send ICMP echo requests to test host reachability.

telnet : open a remote terminal session to another host.

Supported Linux File Types

Regular file ( -)

Directory ( d)

Block device ( b)

Character device ( c)

Socket ( s)

FIFO / pipe ( p)

Link ( l)

Linux System Programming – IPC Mechanisms

Signals

Semaphores

Pipes, stream pipes, and named pipes (FIFO)

Message queues

Shared memory

Sockets (including Unix domain sockets)

ARM Exception Types

Reset : executed on power‑up.

Undef : triggered by an illegal instruction.

SWI : software interrupt.

Prefetch : failed instruction fetch.

Data : invalid memory access.

IRQ : standard interrupt.

FIQ : fast interrupt.

Interrupt Handling Procedure (4 major steps, 3 sub‑steps)

Save execution state: copy CPSR to SPSR of the exception mode.

Mode switch:

Set CPSR mode bits according to the exception type.

Processor enters the corresponding ARM mode.

Disable all IRQs (and FIQs when handling a fast interrupt).

Save return address in the exception‑mode LR (LR_excep).

Jump to the exception vector table by loading PC with the vector address.

GPIO Overview

General‑purpose input/output pins can be configured as inputs or outputs to drive LEDs, read sensors, or control other peripherals. When the native GPIO count is insufficient, an external CPLD can be used to expand I/O capability.

I2C (IIC) Pin Names and Signal Sequences

SDA : data line for transmitting and receiving bytes.

SCL : clock line that synchronizes data transfers.

Start (S) condition :

Ensure SCL is high (bus idle).

Pull SDA low while SCL remains high.

Pull SCL low to begin data transfer.

Stop (P) condition :

Set both SDA and SCL low.

Raise SCL to high.

Raise SDA to high, returning the bus to idle.

SPI Pin Names and Functions

SCK : serial clock.

MISO : master‑in slave‑out data.

MOSI : master‑out slave‑in data.

SS : slave‑select (chip‑enable).

Optional interrupt line (INT) on some devices.

Driver Inspection Commands

dmesg

– view kernel log messages printed by drivers. lsmod – list currently loaded kernel modules. cat /proc/devices – display major/minor numbers for character and block devices. ls /sys/module/ – show directories for loaded modules. cat /proc/interrupts – list interrupt numbers in use.

Creating a Character Device

Example command:

mknod chartest c 4 64
c

– character device. 4 – major number identifying the driver. 64 – minor number identifying the specific device instance.

The major number links the device node to a driver; the minor number allows a single driver to manage multiple device instances (e.g., several serial ports).

Synchronization Primitives for Shared Resources

Atomic operations

Spinlocks

Semaphores

Mutexes

Linux Kernel Subsystems

Process scheduling (SCHED)

Memory management (MM)

Virtual file system (VFS)

Network interface (NET)

Inter‑process communication (IPC)

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSystem ProgrammingSPIARMembedded systemsDevice DriversI2C
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.