uclinux在44b0上移植的坎坷
时间:2007-06-26 来源:luanjian
uclinux在44b0上移植的坎坷。本来这块44b0的开发板n久没用了,近来拿来玩,根据文档移植发现只能启动到
Starting kernel ...
Uncompressing Linux............................ done, booting the kernel.然后就挂在这里不动了,用点灯的方法去跟发现在函数setup_architecture(machine_arch_type);的
for (list = &__arch_info_begin; list < &__arch_info_end; list++)
{
if (list->nr == nr)
break;
}
/*
* If the architecture type is not recognised, then we
* can do nothing...
*/
if (list >= &__arch_info_end) {
printk("Architecture configuration botched (nr %d), unable "
"to continue.\n", nr);
//永远停在这里了
while (1);
}
原因明显是在for循环那里没有找到匹配的machine_arch_type。这里的实参machine_arch_type是在arch/armnommu/tools/mach-types定义的。而结构指针list在arch/armnommu/mach-S3C44B0X/arch.c里赋值的。
#define MACHINE_START(_type,_name) \
const struct machine_desc __mach_desc_##_type \
__attribute__((__section__(".arch.info"))) = { \
nr: MACH_TYPE_##_type, \
name: _name,
然后通过链接脚本arch/armnommu/vmlinux-armv.lds.in确定__arch_info_begin的地址,
. = TEXTADDR;
.init : { /* Init code and data */
_stext = .;
__init_begin = .;
*(.text.init)
__proc_info_begin = .;
*(.proc.info)
__proc_info_end = .;
__arch_info_begin = .;
*(.arch.info)
__arch_info_end = .;
__tagtable_begin = .;
*(.taglist)
__tagtable_end = .;
*(.data.init)
. = ALIGN(16);
__setup_start = .;
*(.setup.init)
__setup_end = .;
__initcall_start = .;
*(.initcall.init)
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
}
移植uclinux一篇绝好的文章《uClinux porting HOWTO》,出处 http://www.arpith.com/index.php?p=12&more=1&page=3