Page 1 of 1
Borland Pascal 7 MULTITASKING
Posted: Sun Nov 12, 2006 5:04 am
by inflater
Hi, i am writing PortixOS in Pascal - 16 bit, MONOTASKING
I want to put to my OS multitasking and I am REALLY TOTAL NOOB in multitasking; I only know that mutitasking can run more than one program but not more...
I have read the FAQ and Lino Commando OS dev'ing
yep, i feel like him
How I do multitasking? I can access BIOS (INT 15h, there are some functions) and I dont know what, where to start...
I have some mem managment though.
I also readed this:
http://www.osdev.org/osfaq2/index.php/M ... %20Systems
Thanks
inflater
Posted: Sun Nov 12, 2006 5:47 am
by PyroMathic
lo,
Basicly all you need is something that switches from 1 task to another, like if the PIC irq is trigert, you go from task x to another.
Between task-switsches you do need to save the state of the task, so the task can resume at some other point whitout even knowing it was interupted.
If you got something like that, you just need to make sure that 1 task cant modify data from task 2.
So for example if you alloc some memory it might be smart to make sure the task cant be interupted untill it is done whit changing kernell var's (globals), otherwise you can get very random error's and bugs.
I did the following in my os: a kernell which cant be interupted by IRQ's, and several (thus far only 2) user "programs" which all run in there own memory and can be interupted whenever an irq is trigert.
Regards.
Pyromathic
Posted: Sun Nov 12, 2006 6:53 am
by inflater
Basicly all you need is something that switches from 1 task to another, like if the PIC irq is trigert, you go from task x to another
OK. If I understand correctly, all i have to do is make a simple interrupt that will change task, like INT FFh, AX=0003 will point to "Change task to ring 3 (or something)", i know to make INTerrupts.
Or IRQ?
for example - When there is something typed to keyboard (IRQ1), change task to XYZ.
But how to change tasks?
inflater
Posted: Sun Nov 12, 2006 8:51 am
by Dex
Here a TP unit for multi-tasking
http://www.programmersheaven.com/downlo ... nload.aspx
Also i remember Alexei A. Frounze doing TP multi-tasking demo, but you need to search, or ask him as he is useally on here:
http://groups.google.com/group/alt.os.development/
PS: Your type of multi-tasking is differant, baseally you load two programs in to memory, give them differant stacks, you then hook into the timer int that fire about 18 times a second, what multi-tasking does, is store all the reg from one program on its stack than loads the reg from another program from it stack runs that program until the timer fires again, and keep swooping them round.
This is the most base, there lot of other thing but to understand i have just said the basics.