- UID
- 1029342
- 性别
- 男
|
make -j2
然后在u-boot-1.3.4/tools/将mkimage拷到系统的bin目录下或者交叉编译器的目录下去,
然后:make uImage,编译出uIamge内核镜像
3.linux内核映像制作
4.添加菜单
每一个目录都有一个Kconfig和Makefile,Kconfig管理本层菜单,Makefile管理相应的c文件。
有子菜单的选项使用menu作为关键字,如下:
上层菜单包含下层菜单的Kconfig
menu "Device Drivers"
source "drivers/base/Kconfig"
source "drivers/connector/Kconfig"
一下是内部子菜单的书写格式:
menu "Generic Driver Options"
#菜单名
#子菜单关键字是string ,表示菜单式输文字的
config UEVENT_HELPER_PATH
#菜单对于宏
string "path to uevent helper"
#子菜单名
depends on HOTPLUG
#依赖条件
default "/sbin/hotplug"
#默认值
help
#帮组信息
Path to uevent helper program forked by the kernel for
every uevent.
#子菜单关键字是bool ,表示这个选项只有选中和不选中两中状态。
config DEVTMPFS
bool "Create a kernel maintained /dev tmpfs (EXPERIMENTAL)"
depends on HOTPLUG && SHMEM && TMPFS
help
This creates a tmpfs filesystem, and mounts it at bootup
and mounts it at /dev. The kernel driver core creates device
nodes for all registered devices in that filesystem. All device
nodes are owned by root and have the default mode of 0600.
Userspace can add and delete the nodes as needed. This is
intended to simplify bootup, and make it possible to delay
the initial coldplug at bootup done by udev in userspace.
It should also provide a simpler way for rescue systems
to bring up a kernel with dynamic major/minor numbers.
Meaningful symlinks, permissions and device ownership must
still be handled by userspace.
If unsure, say N here.
#关键字是tristate,有3种选择,分别是编译进内核[*],编译出模块[M],不选中[]。
config LEDS_S3C2440
tristate "LED Support for S3C2440 GPIO LEDs"
depends on ARCH_S3C2410
default y if ARCH_S3C2410
help
This option enables support for LEDs connected to GPIO lines
on S3C2440 boards.
-------------------------------------------------------------
Kconfig和.config的关系:
每选中一项会在.config文件中把生成一个宏名:CONFIG_加上Kconfig对应菜单宏名
比如Kconfig有如下选项:
config LEDS_S3C2440
tristate "LED Support for S3C2440 GPIO LEDs"
depends on ARCH_S3C2410
#CONFIG_ARCH_S3C2410也是Kconfig中的一个菜单宏名
,如果ARCH_S3C2410选中,这项菜单才会显示出来,
default y if ARCH_S3C2410
#显示出来的默认状态:y 显示 * ;m 显示 M ,n 显
示不选中
help
This option enables support for LEDs connected to GPIO lines
on S3C2440 boards.
选中时(*)后,对应.config的名字为:
CONFIG_LEDS_S3C2440=y
选中时(M)后,对应.config的名字为:
CONFIG_LEDS_S3C2440=m
不选中时,对应.config的名字为:
#CONFIG_LEDS_S3C2440 is not set
深圳专业嵌入式技术实训,QQ754634522
-----------------------------------------------------------
.config和Makefie的关系:
在driver/char/Makefie有以下语句:
############################################################################
obj-$(CONFIG_LEDS_S3C2440)
+= s3c2440_leds.o
#$为在后面累加字符串
obj-$(CONFIG_S3C2440_BUTTONS)
+= s3c2440_buttons.o
obj-$(CONFIG_S3C2440_BUZZER)
+= s3c2440_pwm.o
obj-$(CONFIG_S3C2440_ADC)
+= s3c2440_adc.o |
|