stack value changes inside isr_common_stub after sti

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
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

stack value changes inside isr_common_stub after sti

Post by ITchimp »

I am on my way to try set up and test idt... so far so good, using bochs, I was able to debug the instructions...
but what I discovered is that (see code below) right after I turned on interrupt (sti), the stack value just changed
dramatically from previous instructions, what happened????

Code: Select all

call isr_handler

pop %ebx
mov %bx, %ds
mov %bx, %es
mov %bx, %fs
mov %bx, %gs
mov %bx, %ss

popa
add 8, %esp
sti
iret
Octocontrabass
Member
Member
Posts: 5575
Joined: Mon Mar 25, 2013 7:01 pm

Re: stack value changes inside isr_common_stub after sti

Post by Octocontrabass »

It looks like you're copying buggy code from a tutorial.

Also, in AT&T syntax, immediate values have a $ prefix.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: stack value changes inside isr_common_stub after sti

Post by kzinti »

Yeah you are basically adding whatever is at address 8 to %esp. That's not going to work.
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

Re: stack value changes inside isr_common_stub after sti

Post by ITchimp »

the dollar sign was there it was $8, i thought about again,and realized that maybe some interrupt signals were causing these...
Post Reply