Software multitasking.

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
xnix

Software multitasking.

Post 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.
RetainSoftware

Re:Software multitasking.

Post by RetainSoftware »

Cjmovie

Re:Software multitasking.

Post 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 :).
Post Reply