OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Can use Multiboot1 for x86_64 kernel?
PostPosted: Mon Dec 20, 2021 1:35 am 
Offline
Member
Member

Joined: Wed Oct 20, 2021 6:00 pm
Posts: 102
Location: Paraguay
kotovalexarian wrote:
Here is some stack tracing example: https://github.com/josehu07/hux-kernel/ ... -&-Testing

Thank you, I will reference and make it as 64-bit form.


Top
 Profile  
 
 Post subject: Re: Can use Multiboot1 for x86_64 kernel?
PostPosted: Mon Dec 20, 2021 3:04 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
kotovalexarian wrote:
Here is some stack tracing example: https://github.com/josehu07/hux-kernel/ ... -&-Testing
Well, that code is horrible. You can clean it up a whole lot by just using a self-referential data structure:
Code:
struct stackframe {
  struct stackframe *next;
  uint32_t ip;
};


This doesn't fix the problem that it just assumes the stackframe to be a certain way, that the compiler doesn't necessarily need to follow. But the alternative would be to build a parser for the DWARF structures in the exception frame (and instruct the compiler to insert instructions in there), but for that, you should probably use a library like libunwind. On the plus side, with libunwind, you can deal with whatever the compiler emits.

Linux doesn't bother with DWARF, by the way. They have a tool that turns the DWARF data into a simpler format of their invention, called ORC. And then they use that. So that is also a possibility.

_________________
Carpe diem!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 63 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