Linux15 arch arm drivers kernel lib boot alpha



Linux内核源代码目录结构(1/5) /arch /arm /drivers /kernel /lib /boot /alpha /mach-s 3 c 2410 /m 68 k /kernel /lib /Documentation /ipc /fs Linux 2. 4. x /include /mm /init /net /scripts /asm-arm /arch-s 3 c 2410 /linux /proc-armv /net /mm






Linux内核加载过程(2/2) 编译完成的Linux内核在哪里? l. /vmlinux,elf格式未压缩内核 l arch/arm/boot/compressed/vmlinux,压缩以后的elf 格式内核 l arch/arm/boot/z. Image,压缩内核



Linux内核的配置(3/6) 关于Kconfig 在进行make menuconfig时,目录的生成依赖于Kconfig文件。 一般来说,每个源代码目录下都有一个Kconfig文件。 config DM 9000 tristate "DM 9000 support" depends on ARM || BLACKFIN || MIPS select CRC 32 select MII ---help--Support for DM 9000 chipset. To compile this driver as a module, choose M here. The module will be called dm 9000.

Linux内核的配置(3/6) 关于Kconfig 在进行make menuconfig时,目录的生成依赖于Kconfig文件。 一般来说,每个源代码目录下都有一个Kconfig文件。 config DM 9000 tristate "DM 9000 support" depends on ARM || BLACKFIN || MIPS select CRC 32 select MII ---help--Support for DM 9000 chipset. To compile this driver as a module, choose M here. The module will be called dm 9000.







一个demo驱动程序编译的例子(1/2) 在内核源代码的主目录下 (1)将demo. c拷贝到. /drivers/char目录下 (2)vi. /drivers/char/Kconfig 添加: config MY_DEMO tristate “ my demo driver” depends on ARM help this is my demo driver (注意:上面 4行每行前面都是tab键)

一个demo驱动程序编译的例子(2/2) (3)make menuconfig 进入character devices,选择my demo driver为内核编译或者模块编译 (4)vi. /drivers/char/Makefile 添加一行 obj-$(CONFIG_MY_DEMO) (5)make clean && make += demo. o
- Slides: 21