|
2440 启动代码 call_linux 参数分析
[复制链接]
call_linux(0, 193, buf);
默认的是193! 在网上查了下说是这个参数跟内核有关! 我还以为是和分区有关
{0, 0x00030000, "boot"}, //192K {0x00030000, 0x001d0000, "kernel"}, //
{0x00200000, 0x01e00000, "rootfs"}, //30M
{0x02000000, 0x02000000, "ext-fs2"}, //32M
{0, 0 , 0}
我改了分区的设置:
{0, 0x00064000, "bootloader"}, //400K
{0x00064000, 0x03F9C000, "wince"}, //63.61M
{0, 0 , 0}
在启动代码里面是先进行读操作,然后调用
call_linux(0, 193, buf); //buf= 0x30200000;
call_linux代码如下:
- void call_linux(U32 a0, U32 a1, U32 a2)
- {
- void (*goto_start)(U32, U32);
- cache_clean_invalidate();
- tlb_invalidate();
- __asm{
- // mov r0, a0//%0
- // mov r1, a1//%1
- // mov r2, a2//%2
- mov ip, #0
- mcr p15, 0, ip, c13, c0, 0 /* zero PID */
- mcr p15, 0, ip, c7, c7, 0 /* invalidate I,D caches */
- mcr p15, 0, ip, c7, c10, 4 /* drain write buffer */
- mcr p15, 0, ip, c8, c7, 0 /* invalidate I,D TLBs */
- mrc p15, 0, ip, c1, c0, 0 /* get control register */
- bic ip, ip, #0x0001 /* disable MMU */
- mcr p15, 0, ip, c1, c0, 0 /* write control register */
- //mov pc, r2
- //nop
- //nop
- /* no outpus */
- //: "r" (a0), "r" (a1), "r" (a2)
- }
- //SetClockDivider(1, 1);
- //SetSysFclk(FCLK_200M); //start kernel, use 200M
- Delay(1000);
- // disable_irq();
- goto_start = (void (*)(U32, U32))a2;
- [color=#FF0000](*goto_start)(a0, a1); [/color]
- [color=#FF0000]//这个参数a1 怎么设置? [/color]
- }
复制代码
引导程序时双系统的,所以又linux的痕迹!
|
|