Embedded Linux

Embedded Linux

Bootloader

bootloader คือโปรแกรมแรกที่รันเมื่อเปิดเครื่อง บน embedded Linux มักใช้ U-Boot

# ตัวอย่างการ boot จาก SD card ด้วย U-Boot
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rw
boot

Kernel Configuration

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)

Device Tree

Device Tree (.dts) ใช้อธิบาย hardware ให้ kernel รู้จัก

/ {
    compatible = "myboard,v1";
    memory@0 {
        device_type = "memory";
        reg = <0x0 0x20000000>;
    };
};