21 lines
2.4 KiB
Plaintext
21 lines
2.4 KiB
Plaintext
$FG,5$$TX+CX,"MultiTasking"$$FG$
|
|
|
|
$WW,1$LoseThos is a preemptive multitasking operating system. However, you can turn-off preemption on a task by task basis and the task will not yield control unless it volunteers with $LK,"SwapInNext","MN:SwapInNext"$(), $LK,"Sleep","MN:Sleep"$() or a call to I/O which yields control. Use the $LK,"Preempt","MN:Preempt"$() cmd to turn on or off preemption. This is useful when you have multiple tasks modifying data structures simultaneously. Interrupts still occur when preemption is off.
|
|
|
|
$BK,1$Preemption is turned-off by default when a task is $LK,"Spawn","MN:Spawn"$()ed.$BK,0$
|
|
|
|
The time-slice rate is set by $LK,"JIFFY_FREQ","MN:JIFFY_FREQ"$.
|
|
|
|
LoseThos does not remove tasks from "the queue" when they are waiting. They swap-in, check for whatever condition they are waiting for and swap-out. This keeps it simple, but would cause problems if too many tasks existed. LoseThos is intended for non-server home computers with a maximum of around ten, or so, tasks.
|
|
|
|
LoseThos has no task priority scheme.
|
|
|
|
$FG,5$$TX+CX,"Interrupts"$$FG$
|
|
|
|
You can turn-on and off interrupts, in your user programs. This is part of the mission statement, giving complete freedom to programmers Use $LK,"Cli","MN:Cli"$() or $LK,"Sti","MN:Sti"$(). LoseThos currently doesn't use interrupt besides the timer and keyboard interrupt. Since the interrupt flag is part of your task context and since you are voluntarily swapped-out if you call $LK,"GetChar","MN:GetChar"$() or whatever, you won't even notice if you turn-off interrupts at the cmd prompt because you are being swapped-out and interrupts are being turned-on by the next task.
|
|
|
|
I used to have mouse interrupts working, but, now, can't get my APIC chip to generate them, so I poll the mouse. It sucks because conflicts occur when you access the keyboard/mouse shared port without interrupts keeping the two devices independant. Mouse polling routine can grab a keystroke and screw things-up.
|
|
|
|
I saw no reason to make the hard drive or CD-ROM drive code interrupt driven -- it just creates potential compatibility issues. On a home system, you do one thing at a time, mostly. LoseThos can do multiple things at once, but not as effeciently as a server operating system. It would bogg down with a hundred tasks asking for service. It sure is simpler, though... smaller... simpler to maintain... and understandable by a layman!
|
|
|
|
|