From: John Hodge (sonata) Date: Sat, 17 Nov 2012 11:53:34 +0000 (+0800) Subject: Kernel/x86 - Fixed possible issue with entrypoint not being in a PT_LOAD segment X-Git-Tag: rel0.15~657 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=aab5ccdbe1608036091e2fb646d3e851ef6ad44d;p=tpg%2Facess2.git Kernel/x86 - Fixed possible issue with entrypoint not being in a PT_LOAD segment --- diff --git a/KernelLand/Kernel/arch/x86/link.ld b/KernelLand/Kernel/arch/x86/link.ld index a09b29af..533b05d2 100644 --- a/KernelLand/Kernel/arch/x86/link.ld +++ b/KernelLand/Kernel/arch/x86/link.ld @@ -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; diff --git a/KernelLand/Kernel/arch/x86/start.asm b/KernelLand/Kernel/arch/x86/start.asm index 1d4a35d8..26f80422 100644 --- a/KernelLand/Kernel/arch/x86/start.asm +++ b/KernelLand/Kernel/arch/x86/start.asm @@ -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]