ok, pusha pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
popa pops all of them except esp, which it skips over.
check the intel docs for more details volume 2b.
Ok, so if this is only kernel based then what i said was crap, also you can get rid of some stuff from your isr0 routine.
Code: Select all
_isr0:
cli
push byte 0 ; Push a dummy error code.
push byte 0 ; Push the interrupt number.
cli
pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
call _isr_c_timer
popa ; Pops edi,esi,ebp...
add esp, 8 ; Cleans up the pushed error code and pushed ISR number
sti
iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP
You don't need to save the data descriptors as they stay constant. Also you need to modify your registers struct, to remove them.
You don't have to do this, but meh.
Anyway, onto the main problem, I'm going to need some more details, how is it crashing? page fault / ...
What are you running this on?
If its bochs, check the bochout.txt and paste it to
www.slexy.org for me and link it.
if its Quemu, then do whatever is equivelent.
if its real hardware, try and get it running in bochs so we can get some debugging going on.
One last thing to try, if you look at the push command, it decrements the stack pointer by 4, then stores the word there. What you are doing is storing then decrementing.
Try getting rid of the:
t.useresp -= 4;
Wiggles.