--- ../../../src/arch/i386/boot/boot.c Thu Oct 10 15:02:28 2002 +++ boot.c Sat May 3 15:54:10 2003 @@ -67,6 +67,7 @@ } +#if 1 void jmp_to_elf_entry(void *entry, unsigned long buffer) { extern unsigned char _ram_seg, _eram_seg; @@ -121,15 +122,19 @@ " movl 8(%%esp), %%ecx\n\n" " shrl $2, %%ecx\n\t" " rep movsl\n\t" - +#ifdef MOVE_STACK /* Adjust the stack pointer to point into the new linuxBIOS image */ " addl 20(%%esp), %%esp\n\t" +#endif /* Adjust the instruction pointer to point into the new linuxBIOS image */ " movl $1f, %%eax\n\t" " addl 20(%%esp), %%eax\n\t" + " movl $2f, %%ecx\n\t" " jmp *%%eax\n\t" "1: \n\t" + + " movl %%ecx, 20(%%esp)\n\t" /* Copy the linuxBIOS bounce buffer over linuxBIOS */ /* Move ``longs'' the linuxBIOS size is 4 byte aligned */ " movl 16(%%esp), %%edi\n\t" @@ -142,6 +147,10 @@ " movl $0x0E1FB007, %%eax\n\t" " movl 0(%%esp), %%ebx\n\t" " call *4(%%esp)\n\t" +// debygging + " mov $0x41, %%al\n\t" + " mov $0x3f8, %%dx\n\t" + " outb %%al, %%dx\n\t" /* The loaded image returned? */ " cli \n\t" @@ -155,15 +164,22 @@ " movl 8(%%esp), %%ecx\n\t" " shrl $2, %%ecx\n\t" " rep movsl\n\t" - +#ifdef MOVE_STACK /* Adjust the stack pointer to point into the old linuxBIOS image */ " subl 20(%%esp), %%esp\n\t" +#endif /* Adjust the instruction pointer to point into the old linuxBIOS image */ - " movl $1f, %%eax\n\t" - " subl 20(%%esp), %%eax\n\t" +// " movl $1f, %%eax\n\t" +// " subl 20(%%esp), %%eax\n\t" + " movl 20(%%esp), %%eax\n\t" " jmp *%%eax\n\t" - "1: \n\t" + "2: \n\t" + +// debygging + " mov $0x42, %%al\n\t" + " mov $0x3f8, %%dx\n\t" + " outb %%al, %%dx\n\t" /* Drop the parameters I was passed */ " addl $24, %%esp\n\t" @@ -177,6 +193,16 @@ "g" (lb_start), "g" (buffer), "g" (lb_size), "g" (entry), "g"(adjusted_boot_notes) ); + + printk("jmp_to_elf_entry returning\n"); } +#else +void jmp_to_elf_entry(void *entry, unsigned long buffer) +{ + void (*newmain)() = entry; + newmain(); + return; +} +#endif