interrupts in a monotasking kernel only OS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
GhostedGaming
Member
Member
Posts: 35
Joined: Wed Jul 02, 2025 11:46 pm
Libera.chat IRC: GhostedGaming

Re: interrupts in a monotasking kernel only OS

Post by GhostedGaming »

Holy I just realized what you said about the iretq instruction but since its an interrupts dont I need is to return from the interrupt
User avatar
bellezzasolo
Member
Member
Posts: 163
Joined: Sun Feb 20, 2011 2:01 pm

Re: interrupts in a monotasking kernel only OS

Post by bellezzasolo »

GhostedGaming wrote: Wed Jan 07, 2026 11:42 am Holy I just realized what you said about the iretq instruction but since its an interrupts dont I need is to return from the interrupt
You do, and iretq is the correct way to do it. But if the interrupt was software-triggered from a context with interrupts disabled, when you return, interrupts will be disabled once more.

Generally, general execution contexts should always have interrupts enabled. Certainly for user mode, but also for kernel mode. The only exception is when holding a spinlock, typically when enforcing mutual exclusion on data shared between an interrupt handler and the driver for that device (top and bottom halves, etc).

Interrupt contexts can be interrupts-enabled or disabled, depending on whether you want to handle reetrancy and avoid priority inversion.
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
GhostedGaming
Member
Member
Posts: 35
Joined: Wed Jul 02, 2025 11:46 pm
Libera.chat IRC: GhostedGaming

Re: interrupts in a monotasking kernel only OS

Post by GhostedGaming »

Ive came to the conclusion that I should just make a multitasking os that actually has a user space and isn't just kernel only I wanna make something that people will use I think I'll take inspiration from the Unix standards and what ever NT standards are
GhostedGaming
Member
Member
Posts: 35
Joined: Wed Jul 02, 2025 11:46 pm
Libera.chat IRC: GhostedGaming

Re: interrupts in a monotasking kernel only OS

Post by GhostedGaming »

also thanks for the help I've learned some stuff just by reading this
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: interrupts in a monotasking kernel only OS

Post by Octocontrabass »

GhostedGaming wrote: Thu Jan 08, 2026 11:44 amIve came to the conclusion that I should just make a multitasking os that actually has a user space and isn't just kernel only
You need multitasking in the kernel before you can have multitasking in user space.
GhostedGaming
Member
Member
Posts: 35
Joined: Wed Jul 02, 2025 11:46 pm
Libera.chat IRC: GhostedGaming

Re: interrupts in a monotasking kernel only OS

Post by GhostedGaming »

Post Reply