[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multithreading OS for the C64
Bruce R. McFarling (ecbm@cc.newcastle.edu.au) wrote:
: csbruce@ccnga.uwaterloo.ca (Craig Bruce) wrote:
: >In article <Dtvnp8.9p3@inter.NL.net>,
: >Maarten Ruigrok <M.Ruigrok@inter.nl.net> wrote:
: >
: >>fs1@aixterm2.urz.uni-heidelberg.de (Andre Fachat) wrote:
: >>> - preemptive multitasking/multithreading
: >> how did you make it pre-emptive when the 6502 processor
: >> itself has no way to check for boundaries or anything
: Notice that normally the 6502 address space is full
: with additional memory (if available) banked in by an external
: memory management arrangement. So if the 6502 *had* 'boundary
: errors' it would be pointless -- I believe the Andre's original
: 6502 box had memory banking on 4K boundaries (is that right?)
Yes, you're right. The sixteen chunks of 4k each could be mapped from
256 possible chunks in a maximum of 1MByte available memory.
That even gave me some memory protection scheme. Imagine one process
having allocated 8kByte of RAM. Then the first two pages are mapped
to different RAM pages. The pages up to the kernel are mapped to
some unused pages - well, actually there are copies of the kernel,
which is in the last page (with IRQ and NMI vectors).
So the process had access to its own 8kByte RAM and some read-only
copies of the kernel - no other processes' RAM available.
This way it would even be possible to do some paging mechanism,
i.e. swap out processes if they are waiting. The only thing that
must be taken care of is, that once a process is running,
_all_ memory pages belonging to this process must be mapped
and available.
As you all know, the 6502 doesn't detect memory faults. And even
if there were an NMI generator when accessing a wrong page, there
is no way to restore the register contents to the state before the
trap - which is essential, if the opcode is re-executed after the
page has been read in and mapped.
This feature, restoring the CPU registers to the value before an
address or bus error, was the improvement from the Motorola 68000
to the 68010 CPU.
: which give 16 different relocatable chunks of memory in the
: memory space. So the assumption that
: (logical address space) > (physical address space)
: is often strictly false for a 6502 machine. (That includes
: the original 6502, with 64K RAM, 16K ROM, and 0K < IO < 4K
You mean C64, don't you ;-)
: space, for a total physical address space (not counting
: duplicated register locations) of 80K < physical addresses < 84K.
Even the newer PET computer (8096, 8296 or so) had more than 64k
memory. They also did some kind of bank switching, although I don't
know how.
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