Multitasking again...

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
drizzt

Multitasking again...

Post by drizzt »

HELP!!!

Is necessary to switch in protect mode to use multitasking???
There is a way to use multitasking in real mode???
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Multitasking again...

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

Re:Multitasking again...

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

Re:Multitasking again...

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

Re:Multitasking again...

Post by drizzt »

thanx!!! i begin to study this code...
Post Reply