在内核目录下,用kernel.config来设置内核编译配置信息,以类似解析toml文件的方式去解析该文件,然后接着去解析各模块下的d.config以获取feature的启用情况
kernel.config
[[module.include]]
name = "init"
path = "src/init/"
enable = "y"
description = ""
[[module.include]]
name = "mm"
path = "src/mm/"
enable = "y"
description = ""
src/mm/d.config
[module]
name = "mm"
description = ""
[[module.include]]
name = "allocator"
path = "src/mm/allocator/"
enable = "y"
description = ""
[[module.features]]
name = "mm_debug"
enable = "y"
description = ""
以下是其它模块下的d.config:
src/mm/allocator/d.config
[module]
name = "allocator"
description = ""
[[module.features]]
name = "allocator_debug"
enable = "y"
description = ""
src/init/d.config
[module]
name = "init"
description = ""
[[module.features]]
name = "init_debug"
enable = "y"
description = ""
上面所有已开启模块的d.config中的feature,会最终生成到内核目录下的D.config文件,即D.config是最终内核编译的配置,如下:
D.config
init_debug = y
allocator_debug = y
mm_debug = y