[Gllug] Beagle Board
Peter Corlett
abuse at cabal.org.uk
Mon Jan 12 18:30:58 UTC 2009
On 12 Jan 2009, at 17:48, Andrew Farnsworth wrote:
> In their defense, early PC Hardware did not include the necessary
> circuitry to permit preemptive multitasking. [...]
Actually, it did.
To do pre-emptive multitasking, all you need is some means of
generating a reasonably frequent and hopefully also regular interrupt.
Ideally this comes from some sort of programmable timer, but if all
else fails, zero-crossing of the PSU or some sort of timeout on an I/O
device will have to do.
On interrupt, the CPU can then push registers onto the stack, move the
stack pointer to a different location, and pop the registers to
restore the state for that process. Hey presto, a pre-emptive task
switch.
The great thing about /* you are not expected to understand this */ is
that it's really quite simple.
Sure, you don't get protection between processes or virtual memory,
and you may find you need to relink executables at launch time, but
that's not *necessary* for pre-emptive multitasking to work. That's
how the Amiga managed to pull off pre-emptive multitasking on a plain
68000 CPU.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list