Kconfig语法_config.in的新格式
资料上配置是使用config.in来配置的 那是2.4的内核,以后的就用Kconfig了
里面的语法也有些不一样,第一次看还以为找错地方了,但试验后还是确认arch/arm/Kconfig就是顶层目录
以下是分析
开头有个mainmenu "Linux Kernel Configuration",主菜是叫Linux Kernel Configuration但改了它后,发现显示并未改变,很奇怪
下面是
config ARM
bool
default y
和参考资料不同了~
最不明白的是显示的菜单前3项在Kconfig中没找见!!从System Type开始才见了menu "System Type"这个明显的定义。
细细一看,第一项General setup明显是系统设置,和arm平台无关。难道,这是外面来的?在上一层的目录中的Kconfig中发现了Kprobes的定义,Kprobes是在显示的General setup选项的最后一个,复制了一个测试项证明了就是在这定义的,其他的估计也差不多了了,考虑到现在主要思考移植所以这部分先放过。
下面具体看下System Type开始部分,以后要配置我们添加的部分,也应该仿照它的格式。
在主菜单定义一个新子菜单的格式是
menu "menu-name"
depends Name
config symbol
options
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
endmenu
下面挑个简单的做分析
menu "Bus support"
config ARM_AMBA
bool
config ISA
bool
help
Find out whether you have ISA slots on your motherboard. ISA is the
name of a bus system, i.e. the way the CPU talks to the other stuff
inside your box. Other bus systems are PCI, EISA, MicroChannel
(MCA) or VESA. ISA is an older system, now being displaced by PCI;
newer boards don't support it. If you have ISA, say Y, otherwise N.
# Select ISA DMA controller support
config ISA_DMA
bool
select ISA_DMA_API
# Select ISA DMA interface
config ISA_DMA_API
bool
config PCI
bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 || MACH_ARMCORE
help
Find out whether you have a PCI motherboard. PCI is the name of a
bus system, i.e. the way the CPU talks to the other stuff inside
your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
VESA. If you have PCI, say Y, otherwise N.
config PCI_SYSCALL
def_bool PCI
# Select the host bridge type
config PCI_HOST_VIA82C505
bool
depends on PCI && ARCH_SHARK
default y
config PCI_HOST_ITE8152
bool
depends on PCI && MACH_ARMCORE
default y
select DMABOUNCE
source "drivers/pci/Kconfig"
source "drivers/pcmcia/Kconfig"
endmenu
结果为
# Bus support
#
CONFIG_ISA=y
# CONFIG_PCI_SYSCALL is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
# CONFIG_PCCARD is not set
config ISA_DMA
bool
select ISA_DMA_API
这里没有给他定义名字,就不显示了~~
它在显示里就一个子项 来自drivers/pcmcia/Kconfig的一个东东
select 表示反向依赖 如f1中 select f2 那么当f1成立f2就会自动成立,但f2不影响f1
而depends on 普通依赖 如f1中有 depends on f2 那么 只有f2成立才能出现f1选项 f2不影响f1
两者的区别在于一个的产生对另一个的影响。
source 就像include 相当于把那文件粘贴到了那~~
comment"xxxxxx" 表示注释,出现在插入位置

浙公网安备 33010602011771号