At 08:46 PM 11/26/98 +0600, you wrote:
>>I have a slightly different idea. Allow write protect option for a part of
>>the RAM. Just like turbo R BIOS in DRAM, or ESE-SCC in ROM mode.
>
>Can You Write me about details?
Using write protect:
Let's say you have a Z380 system with 4MB RAM, at addresses 000000-3FFFFF.
System software code is 256K in size, system software data is another 256K.
The code is placed at 000000-03FFFF, the data at 040000-07FFFF.
You can choose to write protect only 000000-03FFFF, giving low protection
but less overhead, or write protect entire 000000-07FFFF area, giving
better protection but demanding the system software to turn off write
protect before modifying its data and turning write protect on afterwards.
Implementing write protect:
You could use a address mask, allowing only sizes that are a power of 2 to
be write protected (..., 010000, 020000, 040000, ...). I think you
suggested something like that in your previous message, but I'm not sure I
understood all of it.
A more flexible way is to make segments of a fixed size, and decide per
segment wether it can be written or not. Segment size could be 64K for
example. This would be very flexible:
- you can protect variable sizes of memory (not just powers of 2)
- in a multitasking system, you could write protect memory of idle tasks
But the costs are also high: you have to do a table lookup for every memory
access. Unless you can implement this very fast in hardware, it would bring
down system performance a lot.
How to handle an illegal memory write:
I see two options:
- Ignore the write attempt. This can be done by not sending the memory IC
the write enable signal. Advantage: simple to implement. Disadvantage: the
user won't know a program is behaving badly.
- Generate some kind of exception. For example, generate an interrupt and
use a certain flag to incidate a write violation. The operating system can
act upon this, for example by shutting down the offending program.
If you have more questions, please ask them.
Bye,
Maarten
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****