[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multithreading OS for the C64
: >> how did you make it pre-emptive when the 6502 processor
: >> itself has no way to check for boundaries or anything
: >> (so called trap errors coming from the processor itself
: >> (in pc systems btw)). In what way can the operating system
In my original design, the memory pages from other processes just couldn't
be accessed, as they were not mapped in. (As I explained in another
post). A process with 8kByte RAM just had access to 8 kByte RAM
and the rest of the address space would be mapped into some read-only
regions (well, I used the kernel image...)
So that the process can just change it's own RAM.
That's even a way to implement paging, i.e. put a process out on disk
if memory is short. Only one thing, as you mentioned, has to be taken
care of: The 6502 cannot detect memory faults, so that _all_ memory pages
belonging to the process must be mapped and accessible when it is run.
(Even if there were some hardware mechanism to detect the fault,
there is no way to restore the original register values as before the
trapped memory access - which is essential to correctly re-execute
the offending opcode after the page has been loaded.
The capability to restore the register values was one of the few
improvements of the Motorola 68010 CPU above the 68000.)
so long
Andre
--
Andre Fachat, Tel:++49-371-531-3551|"I do not feel obliged to believe that the
Stadlerstr 17, 09126 Chemnitz, FRG | same God who has endowed us with sense,
a.fachat@physik.tu-chemnitz.de | reason, and intellect has intended us to
http://www.tu-chemnitz.de/~fachat | forego their use" -- Galileo Galilei