Kernel/x86 - Fixed possible issue with entrypoint not being in a PT_LOAD segment
authorJohn Hodge (sonata) <[email protected]>
Sat, 17 Nov 2012 11:53:34 +0000 (19:53 +0800)
committerJohn Hodge (sonata) <[email protected]>
Sat, 17 Nov 2012 11:53:34 +0000 (19:53 +0800)
KernelLand/Kernel/arch/x86/link.ld
KernelLand/Kernel/arch/x86/start.asm

index a09b29a..533b05d 100644 (file)
@@ -3,8 +3,7 @@
  * Linker Script
  */
 
-lowStart = start - 0xC0000000;
-ENTRY(lowStart)
+ENTRY(start)
 OUTPUT_FORMAT(elf32-i386)
 
 SECTIONS {
@@ -12,6 +11,7 @@ SECTIONS {
        __load_addr = .;
        .multiboot : AT(ADDR(.multiboot)) {
                *(.multiboot)
+               *(.inittext)
        }
        
        . += 0xC0000000;
index 1d4a35d..26f8042 100644 (file)
@@ -55,7 +55,7 @@ mboot:
 ;      dd      8
 ;mboot2_end:
        
-[section .text]
+[section .inittext]
 [extern kmain]
 [extern Desctab_Install]
 [global start]
@@ -143,7 +143,7 @@ APStartup:
        or al, 1
        mov cr0, eax
        ; Jump into PMode
-       jmp 08h:DWORD .ProtectedMode-KERNEL_BASE
+       jmp 08h:DWORD .ProtectedMode
 [bits 32]
 .ProtectedMode:
        ; Load segment registers
@@ -218,6 +218,10 @@ APStartup:
        jmp .hlt
 %endif
 
+;
+;
+;
+[section .text]
 [global GetEIP]
 GetEIP:
        mov eax, [esp]

UCC git Repository :: git.ucc.asn.au