Hello,
    I am taking another look at HelenOS after a bit of a break. My hardware
is Mac Mini, and I saw a comment from 4 years ago on ticket 470 asking if
the boot issues are still reproducible. I believe they are, and in fact I
can generate the same issue (ns is killed) in QEMU using EDK2 firmware. I
also believe I can solve the issue but the fix is a bit clunky [1,2]. I
cannot get a fully functional boot, I believe because the XHCI driver
doesn't work. My boot completes and everything loads, but without USB I
can't move the mouse or type. To get that far there are two issues that I
have encountered:

1) I have had problems with paging on amd64. In the definition of pte_e in
kernel/arch/amd64/include/arch/mm/page.h, there are these lines:

unsigned int addr_12_31 : 30;
unsigned int addr_32_51 : 21;

I don't know why it shouldn't be this:

unsigned int addr_12_31 : 20;
unsigned int addr_32_62 : 31;

I'm not sure whether this alone causes the specific issue, but I changed it
anyway [1] because the original version confused me so much I thought it
must be a typo.

2) When booting SMP, HelenOS reserves physical address range 0x8000-0x14000
for the AP bootstrap code. I suppose under BIOS, grub behaves differently,
but under UEFI that address range is considered open space by grub in which
the modules can be loaded. So, ns module gets placed at address 0x1000,
then the kernel copies AP bootstrap code over the top of part of it. As
soon as ns makes a function call into the address range that was
overwritten, it will give some confusing error (page fault, invalid
instruction, etc.) So I wrote a quick fix to search for conflicts in the
init task modules and the AP bootstrap area, and copy them to a safe
region. Unfortunately that all has to be done at an early stage before the
AP bootstrap code is copied, so there's limited memory mapping/allocation
available. My method for searching for a place to move the module ended up
getting kind of messy [2], but it did get the system to boot (with the
proviso above about USB).

[1]
https://github.com/cvparker/helenos/commit/39262b03db18c0c8bdda2ef86490f40226bbd503
[2]
https://github.com/cvparker/helenos/commit/eb7fc3149a2b807e917c04e93453c3eb02415292

Warm regards,
CP
_______________________________________________
HelenOS-devel mailing list
HelenOS-devel@lists.modry.cz
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to