How big are interrupt error codes?

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.
Post Reply
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

How big are interrupt error codes?

Post by StartOS »

Right now I am working on implementing interrupts in my toy OS.
When a interrupt that pushes an error code occurs it pushes: ss, esp, eflags, cs, eip and finally the error code! Right?
But is the error code 32 bit?
If I want to pop it, i'd go: pop ah, pop ax or pop eax?
All a good OS needs to do is to run Linux inside QEMU :-)
tkausl
Posts: 17
Joined: Tue Jul 14, 2015 9:54 pm

Re: How big are interrupt error codes?

Post by tkausl »

StartOS wrote:When a interrupt that pushes an error code occurs it pushes: ss, esp, eflags, cs, eip and finally the error code! Right?
ss and esp are only pushed if you're interrupting from user-code through a TSS and in the other direction, are only poped if cs is not the same as the actual cs.

I use the full 4 bytes (from c) of the errorcode and it works
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: How big are interrupt error codes?

Post by StartOS »

Thanks tkausl !
All a good OS needs to do is to run Linux inside QEMU :-)
Post Reply