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.
pusha
push ds
push es
push fs
push gs
mov eax,0x10 ; Data segment
mov ds,eax
mov es,eax
cld
call _int_00 ; Divide by Zero #DE
pop gs
pop fs
pop es
pop ds
popa
iret
Is it neccessary to load the data segments inside each ISR?
All other samples I have seen do not do this so I was wondering why it is done here and if it is needed.
SFX wrote:
Is it neccessary to load the data segments inside each ISR?
It might sound useless as long as you only have a kernel (thus the DS segment never changes -- or at least you believe it doesn't)
but as soon as user-level process will be used, you'll find that user-mode has a different DS selector than kernel (even if just for access right) ... so saving/restoring segments registers like DS, ES, FS and GS (don't forget user code might not be written in C) is mandatory for any ISR.