Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang after loading first level 4 table on uefi #462

Open
Colepng opened this issue Oct 24, 2024 · 3 comments · May be fixed by #464, #465 or #466
Open

Hang after loading first level 4 table on uefi #462

Colepng opened this issue Oct 24, 2024 · 3 comments · May be fixed by #464, #465 or #466

Comments

@Colepng
Copy link

Colepng commented Oct 24, 2024

I tried my os on real hardware for the first time and found that the bootloader is hanging. I tracked the issue down to this line. I'm still a beginner in os development so any help is appreciated.

I am running it on my laptop which is a lenvo legion 7 which has a AMD Ryzen 7 5800H.

@Freax13
Copy link
Member

Freax13 commented Oct 24, 2024

Hmm, there's not much to go on. How did you track this hang down to this line? Can you share the log output?

@Colepng
Copy link
Author

Colepng commented Oct 25, 2024

I cloned the repo locally, linked my kernel to the local version and added debug statements. I put 1 statement after the line I linked to and 1 after. Only the first 1 ran. The best photo I can add would be from my phone.

Image

As you can see in the photo it no longer hang. Instead of only copying over the first entry of the old page table, I started copying over all entries and now it works. The panic you can see in the photo seems to be from the fact my system uses huge page table while the bootloader expects 4KiB tables. If you know, could you explain to me why copying over all the old entries would fix it.

@Freax13
Copy link
Member

Freax13 commented Oct 25, 2024

The frame buffer (0xfc_1000_0000) address is in the second pml4 entry, interesting. Currently, we only copy the first pml4 entry, but when the bootloader tries to access the frame buffer it needs the second pml4e. The assumption in this comment was incorrect. Your fix (copying more entries) seems reasonable unless maybe that's what's causing the panic below? Freel free to open at PR. I'll investigate some more later this evening.

@Colepng Colepng linked a pull request Oct 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants