找不到 machine ID 时会打印出:
Error: unrecognized/unsupported machine ID (r1 = 0x00001200).
arm/kernel/setup.c 中
setup_arch() ------->> setup_machine_tags()
会先通过设备树寻找
寻找合适的机器板子
机器ID在 /arm/tools/mach-types.h 中定义
#define MACHINE_START(_type, _name) \
static const struct machine_desc __mach_desc_##_type \
__used \
__attribute__((__section__(".arch.info.init"))) = { \
.name = _name,
#define MACHINE_END \
.arch.info.init
机器信息放在了 .arch.info.init 节区
机器信息文件 arch/arm/mach-XXX.c
在文件 arch/arm/make 中添加mach-XXX.c增加编译
arch/arm/kernel/atags_parse.c
在函数
setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
中增加
early_print("Machine: %s\n", p->name);
打印出板子的名字