Hi!
I'm working on porting my OS from GRUB/x86_32 to a custom UEFI bootloader/x86_64. This is all well and good in QEMU, but I'm now running into trouble on real hardware, and am wondering if anyone has seen similar behaviour.
I've connected a serial cable to the computer to see what my bootloader/kernel is outputting. I get valid logs from the bootloader, but as soon as it jumps to a higher half address (and exits boot services), the serial port outputs a few garbage bytes and nothing more. The monitor also appears stuck, with no visible activity after the log line indicating the jump to the kernel, but otherwise my debugging capabilities are limited outside an emulator.
[Fixed]Serial port outputs garbage after jump to higher half
-
- Member
- Posts: 77
- Joined: Fri May 20, 2016 2:29 pm
- Location: London, UK
- GitHub: https://github.com/codyd51
- Contact:
[Fixed]Serial port outputs garbage after jump to higher half
Last edited by codyd51 on Wed Nov 10, 2021 4:43 pm, edited 1 time in total.
Re: Serial port outputs garbage after jump to higher half
after ExitBootServices(), all the UEFI protocols are unavailable and you should program UART by your OS. if you do this, then, obviously, you do this wrong. you know better what you do.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Serial port outputs garbage after jump to higher half
Some UEFI implementations have a wonderful bug where custom memory types cause ExitBootServices() to hang.
Perhaps you should try making your activity visible by drawing simple things to the framebuffer. For example, you could fill the whole screen with solid colors at different points to see how far you get before the hang.
Perhaps you should try making your activity visible by drawing simple things to the framebuffer. For example, you could fill the whole screen with solid colors at different points to see how far you get before the hang.
-
- Member
- Posts: 77
- Joined: Fri May 20, 2016 2:29 pm
- Location: London, UK
- GitHub: https://github.com/codyd51
- Contact:
Re: Serial port outputs garbage after jump to higher half
I am impressed by both the awareness of the bug and the tracking down of the affected code, considering this was in a feature branch!Octocontrabass wrote:Some UEFI implementations have a wonderful bug where custom memory types cause ExitBootServices() to hang.
Well spotted, I will give this a try when I'm next able to and will report back in this thread.
-
- Member
- Posts: 77
- Joined: Fri May 20, 2016 2:29 pm
- Location: London, UK
- GitHub: https://github.com/codyd51
- Contact:
Re: Serial port outputs garbage after jump to higher half
Confirmed, fixed! I will mark this post as solved. Thanks again.