OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: Issues with interrupts
PostPosted: Tue Aug 09, 2022 10:33 pm 
Offline
Member
Member

Joined: Sun May 08, 2022 2:10 am
Posts: 70
Octocontrabass wrote:
Okay... and what are the contents of the stack when you hit that breakpoint for the first time?

This seems... a little small:
Code:
Stack address size 8
| STACK 0xffffffffffffff10 [0xffffffff:0xffe04162] (<unknown>)
| STACK 0xffffffffffffff18 [0x00000000:0x0000001e] (<unknown>)
| STACK 0xffffffffffffff20 [0xffffffff:0xfffffff8] (<unknown>)
| STACK 0xffffffffffffff28 [0xffffffff:0xffe0390e] (<unknown>)
| STACK 0xffffffffffffff30 [0xffffffff:0xffe038d0] (<unknown>)
| STACK 0xffffffffffffff38 [0x00000000:0x00008e00] (<unknown>)
| STACK 0xffffffffffffff40 [0xffffffff:0xfffffff8] (<unknown>)
| STACK 0xffffffffffffff48 [0x00000000:0x0000001e] (<unknown>)
| STACK 0xffffffffffffff50 [0x0000ffff:0xffffffe0] (<unknown>)
| STACK 0xffffffffffffff58 [0x00000000:0x00000008] (<unknown>)
| STACK 0xffffffffffffff60 [0x00000000:0x00000000] (<unknown>)
| STACK 0xffffffffffffff68 [0x00000000:0x009a9a9a] (<unknown>)
| STACK 0xffffffffffffff70 [0x00000000:0x001f0414] (<unknown>)
| STACK 0xffffffffffffff78 [0x00000000:0x00000010] (<unknown>)
| STACK 0xffffffffffffff80 [0xffffffff:0xffe0480d] (<unknown>)
| STACK 0xffffffffffffff88 [0x00000000:0x00000000] (<unknown>)


Top
 Profile  
 
 Post subject: Re: Issues with interrupts
PostPosted: Tue Aug 09, 2022 10:53 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
It's small in the sense that you didn't print enough of the stack to see the entire registers struct.

Which I might not actually need, because that incomplete copy of the stack helped me spot a POP without a matching PUSH. Shouldn't this instruction be "mov $0x10, %eax"?


Top
 Profile  
 
 Post subject: Re: Issues with interrupts
PostPosted: Tue Aug 09, 2022 10:56 pm 
Offline
Member
Member

Joined: Sun May 08, 2022 2:10 am
Posts: 70
Octocontrabass wrote:
It's small in the sense that you didn't print enough of the stack to see the entire registers struct.

Which I might not actually need, because that incomplete copy of the stack helped me spot a POP without a matching PUSH. Shouldn't this instruction be "mov $0x10, %eax"?

Indeed it should. That instruction was from a few iterations of the code ago. Testing now.
UPDATE: It now no longer crashes, but I also don't know if it's working or not, since none of the interrupt handlers give any sort of feedback....

UPDATE 2: After making the handler panic on an unknown interrupt, it seems like I'm consistently getting suprious 0x5F interrupts, even on Bochs, eliminating any potential of hardware issues... Which is odd, considering that this probably not valid interrupt sheet lists 5F as "reserved":
Code:
5D-5F   BIOS   reserved for BIOS


Top
 Profile  
 
 Post subject: Re: Issues with interrupts
PostPosted: Wed Aug 10, 2022 10:18 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
There's no way I could tell what's going on without seeing either your code or the rest of the contents of the registers struct.

Although I did spot this mistake. (It's not causing any issues right now because the stack is already aligned due to the number of things you push, but that should be RSP instead of R12.)


Top
 Profile  
 
 Post subject: Re: Issues with interrupts
PostPosted: Wed Aug 10, 2022 4:27 pm 
Offline
Member
Member

Joined: Sun May 08, 2022 2:10 am
Posts: 70
Octocontrabass wrote:
There's no way I could tell what's going on without seeing either your code or the rest of the contents of the registers struct.

Although I did spot this mistake. (It's not causing any issues right now because the stack is already aligned due to the number of things you push, but that should be RSP instead of R12.)

Ah. That's what I get for having GitHub copilot installed. Well that's fixed now. And I also realized one of the potential causes literally 5 minutes after I went to bed yesterday: My handler doesn't actually yet fix the interrupt number by adding the 127 back to it that was used previously for proper alignment.

UPDATE: After some tinkering I think I got the real interrupt number (still doesn't make sense though, as from what I can find it seems to be a DOS specific interrupt??.....), 0x20.

UPDATE 2: I still simply can't figure out what that interrupt is supposed to be. I'm going to comment out the code that panic's for an unknown interrupt and just simply run the generic handler that should handle the majority of interrupts.

UPDATE 3: After removing that piece of code. It seems like it just goes to a black screen and jumps to some junk code (somehow doesn't crash although it is an inf loop) pushing the current code now. Although: I currently can't test it, I'm at school. But I do have a link back to the PC with the code. So I can make any edits now. But I won't be able to test them for at least a few more hours.

Also something: I'm not entirely sure that the regs stuct is coming through perfectly unscathed. Some of the values seem rather busted (e.g. the RDI register should at the time of the panic contain the address of the "message" variable (so it should start with some 0xF's), however it seems rather random.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC - 6 hours


Who is online

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