interrupts in a monotasking kernel only OS
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
interrupts in a monotasking kernel only OS
https://github.com/Eucalyptus-OS/Eucalypt-Kernel
so i plan on making a dos and i dont understand how i can keep interrupts going when switched to a program
since they take over the whole cpu i dont know how to get the interrupts to keep going it would be nice for the breakout game to work but i cant get interrupts going only the timer but thats because of another reason and just because the timer still ticks doesnt mean the other interrupts continue.
so i plan on making a dos and i dont understand how i can keep interrupts going when switched to a program
since they take over the whole cpu i dont know how to get the interrupts to keep going it would be nice for the breakout game to work but i cant get interrupts going only the timer but thats because of another reason and just because the timer still ticks doesnt mean the other interrupts continue.
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
please review the code as well if you dont mind so you can understand what im saying
-
Octocontrabass
- Member

- Posts: 6245
- Joined: Mon Mar 25, 2013 7:01 pm
Re: interrupts in a monotasking kernel only OS
If you don't want programs to take over the whole CPU, don't allow programs to take over the whole CPU.GhostedGaming wrote: ↑Tue Jan 06, 2026 8:18 pmi dont understand how i can keep interrupts going when switched to a program since they take over the whole cpu
Have you tried running "info pic" in QEMU's monitor to see if there's something wrong with the interrupt controllers?
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
It seems there's a pending keyboard interrupt in the pic but interrupts dont continue until the app returns
-
Octocontrabass
- Member

- Posts: 6245
- Joined: Mon Mar 25, 2013 7:01 pm
Re: interrupts in a monotasking kernel only OS
Where in the "info pic" output do you see that?GhostedGaming wrote: ↑Tue Jan 06, 2026 9:29 pmIt seems there's a pending keyboard interrupt in the pic
Is the interrupt pending while the app is running? Have you used your debugger to check the interrupt flag in RFLAGS?
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
The rflags show that interrupts are disabled but I dont understand why
-
Octocontrabass
- Member

- Posts: 6245
- Joined: Mon Mar 25, 2013 7:01 pm
Re: interrupts in a monotasking kernel only OS
Set a breakpoint before calling the app. Are interrupts enabled there?
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
Adding a breakpoints and checking the rflags show that interrupts are disabeld but even after I put the sti instruction before the application call interrupts are still disabled
-
Octocontrabass
- Member

- Posts: 6245
- Joined: Mon Mar 25, 2013 7:01 pm
Re: interrupts in a monotasking kernel only OS
Set a breakpoint right after the STI instruction. Are interrupts enabled there?
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
Yes interrupts are enabled it seems that jumping to the entry of the application is causing interrupts to be disabled but how?
-
Octocontrabass
- Member

- Posts: 6245
- Joined: Mon Mar 25, 2013 7:01 pm
Re: interrupts in a monotasking kernel only OS
Have you tried stepping through the instructions that execute at the entry point?
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
I've actually never had to do that so im gonna have to figure it out I may do it tomorrow but if it helps im executing 64bit elf
- bellezzasolo
- Member

- Posts: 163
- Joined: Sun Feb 20, 2011 2:01 pm
Re: interrupts in a monotasking kernel only OS
I can't look too deep right now, but regarding 128_handler, your STI instruction will enable interrupts, you call into syscall_handler, and then when that returns, you IRETQ.GhostedGaming wrote: ↑Tue Jan 06, 2026 11:35 pm I've actually never had to do that so im gonna have to figure it out I may do it tomorrow but if it helps im executing 64bit elf
IRETQ will restore the flags, including IF, from the stack. That's all that comes to mind right now.
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
https://github.com/ChaiSoft/ChaiOS
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
I removed the sti instruction in the 128
-
GhostedGaming
- Member

- Posts: 35
- Joined: Wed Jul 02, 2025 11:46 pm
- Libera.chat IRC: GhostedGaming
Re: interrupts in a monotasking kernel only OS
the sti instruction works in the isr128 but it only works when sleep is called and that goes to the timer interrupts I also need my keyboard to work so when ever I press a key I can use it in the applicationbellezzasolo wrote: ↑Wed Jan 07, 2026 3:11 amI can't look too deep right now, but regarding 128_handler, your STI instruction will enable interrupts, you call into syscall_handler, and then when that returns, you IRETQ.GhostedGaming wrote: ↑Tue Jan 06, 2026 11:35 pm I've actually never had to do that so im gonna have to figure it out I may do it tomorrow but if it helps im executing 64bit elf
IRETQ will restore the flags, including IF, from the stack. That's all that comes to mind right now.