Page 1 of 1

Software multitasking.

Posted: Tue Feb 07, 2006 2:21 pm
by xnix
I have this code:

timer_s:
pusha
push ds
push es
push fs
push gs

mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, esp

push eax
mov eax, timer_call
call eax
pop eax
   mov esp,eax
pop gs
pop fs
pop es
pop ds
popa
add esp, 8
iret


-----------------------


struct reg
{
unsigned int gs, fs, es, ds;
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
unsigned int int_no, err_code;
unsigned int eip, cs, eflags, useresp, ss;
};

void timer_call(struct reg *r){
//?
}

And what i must do here ?
I think, I must change registers.
How to change crX ?
I know , how to create process.I have correct GDT and working hw task switching, but i want software.

Re:Software multitasking.

Posted: Wed Feb 08, 2006 2:18 am
by RetainSoftware

Re:Software multitasking.

Posted: Sat Feb 11, 2006 12:53 am
by Cjmovie
Or you could try looking at my little tutorial, if that helps...
http://hosted.cjmovie.net/TutMultitask.htm

And for those of you who've been wondering, no I'm not dead, just been busy :).