在arch/arm/kernel/head.S中 72 - 94 行,是arm linux boot的主代码:
00072: ENTRY(stext)
00073: msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
00074: @ and irqs disabled
00075: mrc p15, 0, r9, c0, c0 @ get processor id
00076: bl __lookup_processor_type @ r5=procinfo r9=cpuid
00077: movs r10, r5 @ invalid processor (r5=0)?
00078: beq __error_p @ yes, error 'p'
00079: bl __lookup_machine_type @ r5=machinfo
00080: movs r8, r5 @ invalid machine (r5=0)?
00081: beq __error_a @ yes, error 'a'
00082: bl __create_page_tables
00083:
00084: /*
00085: * The following calls CPU specific code in a position independent
00086: * manner. See arch/arm/mm/proc-*.S for details. r10 = base of
00087: * xxx_proc_info structure selected by __lookup_machine_type
00088: * above. On return, the CPU will be ready for the MMU to be
00089: * turned on, and r0 will hold the CPU control register value.
00090: */
00091: ldr r13, __switch_data @ address to jump to after
00092: @ mmu has been enabled
00093: adr lr, __enable_mmu @ return (PIC) address
00094: add pc, r10, #PROCINFO_INITFUNC
00017: struct machine_desc {
00018: /*
00019: * Note! The first four elements are used
00020: * by assembler code in head-armv.S
00021: */
00022: unsigned int nr; /* architecture number */
00023: unsigned int phys_io; /* start of physical io */
00024: unsigned int io_pg_offst; /* byte offset for io
00025: * page tabe entry */
00026:
00027: const char *name; /* architecture name */
00028: unsigned long boot_params; /* tagged list */
00029:
00030: unsigned int video_start; /* start of video RAM */
00031: unsigned int video_end; /* end of video RAM */
00032:
00033: unsigned int reserve_lp0 :1; /* never has lp0 */
00034: unsigned int reserve_lp1 :1; /* never has lp1 */
00035: unsigned int reserve_lp2 :1; /* never has lp2 */
00036: unsigned int soft_reboot :1; /* soft reboot */
00037: void (*fixup)(struct machine_desc *,
00038: struct tag *, char **,
00039: struct meminfo *);
00040: void (*map_io)(void);/* IO mapping function */
00041: void (*init_irq)(void);
00042: struct sys_timer *timer; /* system tick timer */
00043: void (*init_machine)(void);
00044: };
00045:
00046: /*
00047: * Set of macros to define architecture features. This is built into
00048: * a table by the linker.
00049: */
00050: #define MACHINE_START(_type,_name) \
00051: static const struct machine_desc __mach_desc_##_type \
00052: __attribute_used__ \
00053: __attribute__((__section__(".arch.info.init")) = { \
00054: .nr = MACH_TYPE_##_type, \
00055: .name = _name,
00056:
00057: #define MACHINE_END \
00058: };