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

bootloader v0.11 broken under bochs and qemu/kvm #327

Closed
Stary2001 opened this issue Jan 15, 2023 · 3 comments · Fixed by #328
Closed

bootloader v0.11 broken under bochs and qemu/kvm #327

Stary2001 opened this issue Jan 15, 2023 · 3 comments · Fixed by #328
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Stary2001
Copy link
Contributor

Two issues here:

  • enter_unreal_mode should be the very first thing in stage2 main, because the screen write call touches some memory above 64k (movzx ebx, byte ptr ds:[ecx] with ecx=0x13ccc)
    error output in bochs: 00017458470e[CPU0 ] read_virtual_checks(): read beyond limit

  • Rust generates some code that uses ss for accesses (mov eax, dword ptr ss:[ebp+edi*8+4], where ss is the default for ebp), and enter_unreal_mode only sets up ds. Unsure how this should be fixed properly - set ss to 32 bit as well?
    error output in bochs: 00695082304e[CPU0 ] stackPrefetch(4): access [0x00013ff8] > SS.limit [0x0000ffff]

As for why this works in qemu in emulation mode: qemu is really inaccurate :(

@phil-opp
Copy link
Member

Thanks a lot for reporting these issues! Your proposed fixes sound good.

@phil-opp phil-opp added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 16, 2023
@Stary2001
Copy link
Contributor Author

Do you want me to make a PR?

@phil-opp
Copy link
Member

That would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants