first I bow to all the OS gods and immortals!!!
I have yet another problem that I just discovered...
context, I am running in kernel mode so there is no priviledge change...
the problem I have is that the code returning from ISR corrupts the stack
the magic_break option is enabled so "xchg %bs, %bs;" will generate a break point
the ISR common stub is the following, it is as standard as it gets
first I bow to all the OS gods and immortals!!!
I have yet another problem that I just discovered...
context, I am running in kernel mode so there is no priviledge change...
the problem I have is that the code returning from ISR
Code: Select all
isr_common_stub:
pusha
mov %ds, %ax
push %eax
mov $10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
call isr_handler
pop %ebx
mov %bx, %ds
mov %bx, %es
mov %bx, %fs
mov %ax, %gs
popa
add 8, %esp
sti
iret
on bochs debugging prompt, I notice that
produces the following assembly routine (it is a bit weird)
but the test code of the tutorial I am following, which behaves correctly
produces a slight different assembly:
so the net result is that the test code behaves correct. my own code corrupts the stack... I am wondering why the same isr_common_stub generates different code?