OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:23 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Fixed]Serial port outputs garbage after jump to higher half
PostPosted: Tue Nov 09, 2021 5:00 pm 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
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.

_________________
www.github.com/codyd51/axle.git


Last edited by codyd51 on Wed Nov 10, 2021 4:43 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Serial port outputs garbage after jump to higher half
PostPosted: Tue Nov 09, 2021 5:08 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 640
Location: Ukraine, Bachmut
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.

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Top
 Profile  
 
 Post subject: Re: Serial port outputs garbage after jump to higher half
PostPosted: Tue Nov 09, 2021 6:29 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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.


Top
 Profile  
 
 Post subject: Re: Serial port outputs garbage after jump to higher half
PostPosted: Wed Nov 10, 2021 7:29 am 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
Octocontrabass wrote:
Some UEFI implementations have a wonderful bug where custom memory types cause ExitBootServices() to hang.


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! :D

Well spotted, I will give this a try when I'm next able to and will report back in this thread.

_________________
www.github.com/codyd51/axle.git


Top
 Profile  
 
 Post subject: Re: Serial port outputs garbage after jump to higher half
PostPosted: Wed Nov 10, 2021 4:42 pm 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
Confirmed, fixed! I will mark this post as solved. Thanks again.

_________________
www.github.com/codyd51/axle.git


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group