OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Impotent IDT
PostPosted: Sat Jan 08, 2022 7:19 pm 
Offline

Joined: Sat Jan 08, 2022 6:32 am
Posts: 1
Hi! I am working on a hobby OS I've named WiccanOS. I've currently been able to enter protected mode and start writing to the VGA buffer. The next step seemed to be to set up the IDT, so I started that. The IDT appears to have been set up properly because I immediately test the table by dividing by zero. The OS does not triple fault, so I am led to believe the exception is being handled somehow, but not how I intended. I have written a generic handler to catch double faults, but I intend to implement the other exceptions as I get to them after I get the double fault working. This generic handler currently writes to the VGA buffer a message saying that an unhandled exception as occurred then uses inline assembly for "cli" and "hlt." Everything seems to work fine except this message is never written to the buffer. I am not entirely certain what is wrong. I would guess that it is due to an incorrectly set up IDT, but I would expect a triple fault in that case. Any help would be appreciated.

My OS is in my signature, and here is a link to it.

_________________
My hobby OS: WiccanOS


Top
 Profile  
 
 Post subject: Re: Impotent IDT
PostPosted: Thu Jan 13, 2022 9:36 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Your linker script does not include a wildcard to catch all possible read-only data sections, so the string may not end up in the binary. You probably want to use something like "*(.rodata .rodata.*)" here instead. (This is a common bug in tutorials.)

Also, you're hardcoding the number of sectors to load from the disk, so you might not be loading the sector containing the string. (This is another common bug.)

I also spotted some ABI violations in your interrupt handlers, but you haven't finished writing those.

Why do you have function definitions in your header files? Headers are supposed to contain declarations only, with the definitions in separate compilation units that get linked together.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Amazonbot [bot], Bing [Bot], Majestic-12 [Bot] and 58 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