It's hard to guess what might be wrong without seeing the relevant code. Maybe your display driver isn't interrupt-safe? Maybe your stack setup is incorrect and corrupting memory? Maybe you forgot a line of debugging code that traps the CPU in an infinite loop?
You could attach a debugger to QEMU's built-in GDB stub, set a breakpoint, and step through your code.
You could try "info registers" in the QEMU monitor to see what the CPU is doing when it halts.
IDT troubles
-
- Member
- Posts: 787
- Joined: Fri Aug 26, 2016 1:41 pm
- Libera.chat IRC: mpetch
Re: IDT troubles
I'm actually curious why you aren't getting some other kind of exception after v=00.You have:
This sets all the entries to 0 and only 0xde (222) to an interrupt handler. What about the entries[0]? Where does it get set to a handler? Right now it is set to 0.
Code: Select all
for (idx = 0; idx < 256; idx++) {
entries[idx] = fill_idt_entry(0,0,0);
}
entries[0xDE] = fill_idt_entry((uint32_t) isr1, 0xCE, 1);
- restingwitchface
- Posts: 14
- Joined: Sat Nov 02, 2024 2:58 pm
- GitHub: https://github.com/NyxNeptune
Re: IDT troubles
> You could attach a debugger to QEMU's built-in GDB stub, set a breakpoint, and step through your code.
> You could try "info registers" in the QEMU monitor to see what the CPU is doing when it halts.
I'll try that in a moment. GDB is personally my go-to debugger, not sure why I forgot it has QEMU support!
> I'm actually curious why you aren't getting some other kind of exception after v=00.
As I mentioned later in the thread, I set up ISRs at 0, 6, 8, 11, 13 too.
Attached is a .tar.gz of the relevant part of my kernel code, as well as the resulting kernel and intermediate binaries (you should be able to build them yourself if you have i686-elf-{gcc,elf,as} installed to a directory in your PATH). Thanks for the help so far. You should be able to reproduce my errors with make run.
> You could try "info registers" in the QEMU monitor to see what the CPU is doing when it halts.
I'll try that in a moment. GDB is personally my go-to debugger, not sure why I forgot it has QEMU support!
> I'm actually curious why you aren't getting some other kind of exception after v=00.
As I mentioned later in the thread, I set up ISRs at 0, 6, 8, 11, 13 too.
Attached is a .tar.gz of the relevant part of my kernel code, as well as the resulting kernel and intermediate binaries (you should be able to build them yourself if you have i686-elf-{gcc,elf,as} installed to a directory in your PATH). Thanks for the help so far. You should be able to reproduce my errors with make run.
- Attachments
-
- pgos.tar.gz
- .tar.gz of the PGOS kernel, minus irrelevant drivers etc.
- (11.89 KiB) Downloaded 94 times
she/her, please.
Don't flirt with me.
Oderint dum metuant.
GPG fingerprints:
Don't flirt with me.
Oderint dum metuant.
GPG fingerprints:
Code: Select all
b16598566a5124946d87279fbc2d2dd299af811e (encryption)
b504ba54c5c164257156f53a32409b59258453e0 (signing)
-
- Member
- Posts: 5534
- Joined: Mon Mar 25, 2013 7:01 pm
Re: IDT troubles
Code: Select all
extern uint32_t _isr0;
entries[0] = fill_idt_entry(_isr0, 0x8E, 1);
- restingwitchface
- Posts: 14
- Joined: Sat Nov 02, 2024 2:58 pm
- GitHub: https://github.com/NyxNeptune
Re: IDT troubles
Oops!! I knew it'd be obvious in hindsight... It works well now, thanks for bearing with me. Sometime in the future you might see more of this little project.
she/her, please.
Don't flirt with me.
Oderint dum metuant.
GPG fingerprints:
Don't flirt with me.
Oderint dum metuant.
GPG fingerprints:
Code: Select all
b16598566a5124946d87279fbc2d2dd299af811e (encryption)
b504ba54c5c164257156f53a32409b59258453e0 (signing)
-
- Member
- Posts: 43
- Joined: Tue Jul 05, 2022 12:37 pm
Re: IDT troubles
Hey do u have a github, i might take a look
- restingwitchface
- Posts: 14
- Joined: Sat Nov 02, 2024 2:58 pm
- GitHub: https://github.com/NyxNeptune
Re: IDT troubles
1. My GitHub account is directly next to my posts, in my user summary or whatnot.
2. My issue has already been resolved.
3. I have already stated I don't want to upload it to GitHub yet.
2. My issue has already been resolved.
3. I have already stated I don't want to upload it to GitHub yet.
she/her, please.
Don't flirt with me.
Oderint dum metuant.
GPG fingerprints:
Don't flirt with me.
Oderint dum metuant.
GPG fingerprints:
Code: Select all
b16598566a5124946d87279fbc2d2dd299af811e (encryption)
b504ba54c5c164257156f53a32409b59258453e0 (signing)