Mark Kettenis:
> I wonder though whether we can simply replace ENTRY(start_phys) with
> ENTRY(start) like we do on amd64. The bootloader strips the high bits
> from the entry point address already, so using the virtual address as
> the entry point address should work.
/me builds & boots kernel ...
Yes, that works.
Index: sys/arch/i386/conf/ld.script
===================================================================
RCS file: /cvs/src/sys/arch/i386/conf/ld.script,v
retrieving revision 1.9
diff -u -p -r1.9 ld.script
--- sys/arch/i386/conf/ld.script 11 Apr 2018 15:44:08 -0000 1.9
+++ sys/arch/i386/conf/ld.script 26 Oct 2018 14:26:37 -0000
@@ -41,9 +41,7 @@ __ALIGN_SIZE = 0x1000;
__kernel_base_virt = 0xd0200000 + SIZEOF_HEADERS;
__kernel_base_phys = __kernel_base_virt & 0xfffffff;
-/* We use physical address to jump to kernel */
-start_phys = LOADADDR(.text) + (start - __kernel_base_virt);
-ENTRY(start_phys)
+ENTRY(start)
SECTIONS
{
__kernel_text_virt = __kernel_base_virt;
--
Christian "naddy" Weisgerber [email protected]