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
Borland Pascal 7 MULTITASKING
Borland Pascal 7 MULTITASKING
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
-
- Member
- Posts: 33
- Joined: Wed Apr 26, 2006 11:00 pm
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
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
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.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
Or IRQ?
for example - When there is something typed to keyboard (IRQ1), change task to XYZ.
But how to change tasks?
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
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.
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.