Page 1 of 1

Multitasking again...

Posted: Wed Jun 19, 2002 6:21 am
by drizzt
HELP!!!

Is necessary to switch in protect mode to use multitasking???
There is a way to use multitasking in real mode???

Re:Multitasking again...

Posted: Wed Jun 19, 2002 6:38 am
by Pype.Clicker
well, technically, you could do stack-switching based multitasking in a real-mode environment (i.e. at a given time, store your registers on the stack, copy ss and sp into a thread-specific place, restore last ss and sp from the target thread in cpu registers and pop other registers from the new stack ;).

However, you must be aware that what you'll get using that technique is at best multithreading (several instruction flows in a program), but you can't do multiprogramming (different programs running simultaneously) because you can't isolate one program from another: everyone can override anyone's code/stack/datas, leading to a complete chaos...

In addition, trying to run several programs in parallel in the smal address space of 1Mb of real mode seems hard to achieve ...

Re:Multitasking again...

Posted: Wed Jun 19, 2002 6:53 am
by drizzt
thanx !!!
and do u know where could i find some simple example about multitasking code (in asm or C)???

i've already downloaded Alexei A. Frounze tutorial, but it's so difficult for me... i'm a newbie about multitasking and protec mode...

Re:Multitasking again...

Posted: Wed Jun 19, 2002 9:03 am
by anubis
You can have info on Multitasking in Protected Mode at

http://www.execpc.com/~geezer/os

It also has demo code for Protected mode
( in a zipped file). You would be interested in pm10.asm in this that shows preemptive multitasking with timer interrupt.

Hope You would be benifited.

Re:Multitasking again...

Posted: Wed Jun 19, 2002 11:29 am
by drizzt
thanx!!! i begin to study this code...