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