LPIC-1: Determine & Configure Hardware
Before Linux can even boot, it needs to talk to the metal. This topic covers the firmware layer (BIOS/UEFI), how the kernel detects peripherals (PCI/USB), and the virtual filesystems used to query hardware info.
1. Firmware: BIOS vs UEFI
The firmware is the first software to run when you press the power button. It initializes hardware (POST) and hands control over to the bootloader.
- BIOS (Legacy): Basic Input/Output System. 16-bit, uses MBR, limited to 2TB disks. Configured via simple text menus.
- UEFI (Modern): Unified Extensible Firmware Interface. 32/64-bit, uses GPT, supports massive disks, Secure Boot, and mouse-driven GUIs.
Note: Linux handles IRQs and I/O addresses automatically now, but in the exam, you must know that these settings can be manually tweaked in the BIOS/UEFI if conflicts arise.
2. Exploring Hardware: /sys and /proc
Linux exposes hardware details through "virtual" filesystems. These files don't exist on the hard drive; they are generated in RAM by the kernel on the fly.
The /proc Directory
Legacy interface for kernel and process info.
/proc/cpuinfo: Processor model, cores, and flags./proc/interrupts: List of IRQs (Interrupt Requests) used by devices./proc/ioports: Hexadecimal addresses of I/O ports in memory./proc/dma: Direct Memory Access channels.
The /sys Directory (sysfs)
Modern, structured view of devices. It organizes hardware by connection type (bus) rather than just a flat list.
/sys/bus/pci: PCI device details./sys/bus/usb: USB device details./sys/class: Devices grouped by type (e.g., printers, sound, net).
3. The Detectives: lspci and lsusb
You rarely read /proc files manually. Instead, we use specific tools to parse that data.
# List PCI devices (Graphics, Network, RAID cards)
$ lspci
00:02.0 VGA compatible controller: Intel Corporation ...
00:14.0 USB controller: Intel Corporation ...
# Detailed view (Verbose)
$ lspci -v
# Show which Kernel Driver is handling the device
$ lspci -k
# List USB devices
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
# Tree view (Shows physical hierarchy)
$ lsusb -t
4. Kernel Modules (Drivers)
Windows has "drivers"; Linux has "Kernel Modules". These are pieces of code (ending in .ko) that can be loaded/unloaded into the kernel on demand to support hardware.
Key Commands:
lsmod: List currently loaded modules.modinfo <name>: Show module details (author, license, parameters).modprobe <name>: Smart load. Loads the module AND its dependencies.modprobe -r <name>: Remove a module.
Configuration: If you need to blacklist a module (stop it from loading) or set custom parameters, you edit files inside /etc/modprobe.d/.
5. Device Management (udev)
When you plug in a USB stick, how does it become /dev/sdb? That is the job of udev.
udev listens for kernel events (via D-Bus) and dynamically creates/removes files in the /dev directory. It follows rules stored in /etc/udev/rules.d/.