Closed gmacd closed 3 years ago
So I've got some ideas about the page fault with initrd on real hardware:
A quick fix would be to not call physinit for any memory section before the module sections (if there is one). In this case you'd lose 4Mi of available ram (the actual size is just under 6Mi).
Repro steps:
--- uroot.cpio.lzma
to the APPEND line)#P/uroot.cpio.lzma
existsIf you have the same problem I had, it'll pagefault on boot.
The initrd memory area is recognised by multiboot, and identified as PamMODULE as expected. It's placed after the kernel heap, but not immediately after - there's nearly 6Mi (5976064 bytes) of PamMEMORY in between the kernel heap and the module.
The problem seems to be in umeminit - when it's setting up the memory available for user space, it pagefaults when initialising the PamMEMORY area in between the kernel heap and the initrd module (in the plop function).
On real hardware, without the initrd module it boots fine. Qemu boots fine with or without the initrd.