Interrupt Handler.

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
huxuelei
Member
Member
Posts: 35
Joined: Tue May 27, 2008 8:32 am

Interrupt Handler.

Post by huxuelei »

Hi, I have written the interrupt handler followed the instruction at jamesmolloy.co.uk.
But I always got this information
[CPU0] iret: retrun CS selector null
from bochs.

Which case could cause the cs selector to be null?
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: Interrupt Handler.

Post by Korona »

Make sure that you remove the correct number of arguments from the stack before the iret instruction is executed.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Interrupt Handler.

Post by jal »

huxuelei wrote:Which case could cause the cs selector to be null?
cs is taken from the stack, so it pops 0 of the stack where it expects a valid cs. So either your stack pointer is messed up, or, like Korona pointed out, you have some pushes or pops too much somewhere.


JAL
Post Reply