This should always do nothing, correct? yet on qemu and bochs it will print out 20h occasionally for no apparent reason. I added a part to my getKey() that assigns, reassigns and then trashes a variable, and that seems to get rid of the problem on qemu, but not bochs. Is there something "under the hood" that I'm missing?
(If you want to peek for yourself, my signature has a link to my github. set the first line of the getKey() function in ioutils.c to be return 0 and it'll do it)
thedude3253 wrote:Is there something "under the hood" that I'm missing?
Your ISRs don't save and restore the registers they modify.
Arg how could I be so blind??
Thank you so much, I see exactly where I'm going wrong and now I know what to fix. I somehow thought that the registers got pushed automatically during an interrupt call and popped during iretq haha
thedude3253 wrote:Is there something "under the hood" that I'm missing?
Your ISRs don't save and restore the registers they modify.
Arg how could I be so blind??
Thank you so much, I see exactly where I'm going wrong and now I know what to fix. I somehow thought that the registers got pushed automatically during an interrupt call and popped during iretq haha
Some do, yes. On 32-bit, EIP, CS and EFLAGS get pushed, unless you switch CPL (current privilege level), in which case SS and ESP also get pushed, and later taken by iretd. On 64-bit, RIP, CS, RFLAGS, SS and RSP get pushed and taken by iretq. The order is not the same, for more details check the Intel IA-32 or x86-64 Software Developer Manual
Hey! I'm developing two operating systems:
NanoShell --- A 32-bit operating system whose GUI takes inspiration from Windows 9x and early UNIX desktop managers. Boron --- A portable SMP operating system taking inspiration from the design of the Windows NT kernel.