[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multithreading OS for the C64
[Hi, I found out what was removing the messages: a cancelbot from
alt.comp.hardware.homebuilt! Grrr! So I removed it from the Followup-To-line
and the Newsgroups line and try to summarize my last posts. Please
ignore if you have already read my last posts, but please remove
alt.comp.hardware.homebuilt from the Newsgroups and Followup-To line
when replying to the other message. Sorry for the inconvenience. Andre]
--------------------snip-----------------
: 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 are right. The upper 4 address bits were taken as index
into 16 registers each 8 bit wide. So I had 16 chunks of memory,
each 4kByte in size.
These could then be mapped to any of 256 chunks within the
extended up to 1MByte memory.
--------------------snip-----------------
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.)
--------------------snip-----------------
Well, I'm using the timer interrupt. But then I use the IRQ timer.
A disadvantage is, that 'nasty' programs can take full control over
the machine. An advantage is that the system itself cannot be
interrupted when doing critical routines. Well, that could have been
taken care of with a flag (to immediately return from NMI) but
I thought it was easier this way.
And as I wanted to run close-to-hardware processes on the machine, I
wanted a process to be able to protect itself from task switching.
(for timing critical hardware handling)
Which is obviously easier when just doing a SEI instead of
calling some StopMultiTasking or RestartMultiTasking (as the Amiga does)
to access some kernel internal flag - which is not available in the
process memory.
--------------------snip-----------------
--
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