int 0x20 problem

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
shahadat
Posts: 19
Joined: Thu May 13, 2010 2:53 am

int 0x20 problem

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: int 0x20 problem

Post by Combuster »

The processor only pushes SS/ESP on the stack when a privilege change occurs.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
shahadat
Posts: 19
Joined: Thu May 13, 2010 2:53 am

Re: int 0x20 problem

Post by shahadat »

thanks combuster. but i dont understand when cpu do the interrupt, why it start from the second line
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: int 0x20 problem

Post by thepowersgang »

I would assume that you have the base address in your IDT incorrect somehow
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: int 0x20 problem

Post 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:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
shahadat
Posts: 19
Joined: Thu May 13, 2010 2:53 am

Re: int 0x20 problem

Post 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.
Post Reply