Page 1 of 1

int 0x20 problem

Posted: Thu Nov 11, 2010 8:32 pm
by shahadat
when i do int 0x20

it do the following:

0xc00014e0 push 0
0xc00014e2 push 0x20
0xc00014e4 jmp stub

but when cpu ( i assume pic as i remapped to ) fire the interrupt it start from the following

0xc00014e2 push 0x20
0xc00014e4 jmp stub

it dont even push user ss, user esp on the stack in both case.
what is the problem.?

i am using bochs.

Re: int 0x20 problem

Posted: Fri Nov 12, 2010 3:19 am
by Combuster
The processor only pushes SS/ESP on the stack when a privilege change occurs.

Re: int 0x20 problem

Posted: Fri Nov 12, 2010 3:58 pm
by shahadat
thanks combuster. but i dont understand when cpu do the interrupt, why it start from the second line

Re: int 0x20 problem

Posted: Mon Nov 15, 2010 8:13 am
by thepowersgang
I would assume that you have the base address in your IDT incorrect somehow

Re: int 0x20 problem

Posted: Mon Nov 15, 2010 8:36 am
by Combuster
I did hear some things about bochs and semi-broken breakpoints, and I see many more newbies use dated versions of that program. If you are using it, you can do a print-stack to see what's on it (and see if there's that push 0 has been performed inbetween). Similarly, you can verify thepowersgang's notion by asking bochs' debugger for "info idt".

In any case, the CPU will be doing what it was told to. Therefore, don't ask the CPU why, but yourself :wink:

Re: int 0x20 problem

Posted: Mon Nov 15, 2010 11:02 am
by shahadat
strange behavior of bochs.
it is working now.

to combuster,
i had checked print-stack before i post it here.

i removed the code of masking the interrupts. then it is working. but i dont think that is the problem.