Some questions about adding an MMU to a 65c816 project
Posted: Thu Apr 30, 2015 9:51 am
Hi,
I have built some smaller 6502 based projects in the past, but want to create something more advanced, like a "real" computer and thought about using the 65c816 since it would be easier to handle a lot of memory (and it's faster to).
I would like to create a simple multitasking OS, so it had been nice to have an MMU and I was thinking about how advanced it should be.
I only knows the basics about how an MMU and CPU interacts so I have some questions about what would be the best way (atleast for this kind of project) to handle it.
The easy solution is ofcourse to have some kind of SRAM so that I can remap the 24 address lines and divide the RAM into pages of a few kb. The question is if memory protection is needed or not, since that would increase the difficulty of the project a lot.
When a new program is loaded, the total amount of RAM it needs should be specified already (could be written in the header of the file for example), so I can just reserve the amount of pages this program needs and run it without problems that it would try and read / write to an illegal address.
If I understand it correctly you only need memory protection if the program can allocate memory during runtime that you can't know in advance. So in C language you can't use malloc in the program, but fixed arrays will be fine.
I have built some smaller 6502 based projects in the past, but want to create something more advanced, like a "real" computer and thought about using the 65c816 since it would be easier to handle a lot of memory (and it's faster to).
I would like to create a simple multitasking OS, so it had been nice to have an MMU and I was thinking about how advanced it should be.
I only knows the basics about how an MMU and CPU interacts so I have some questions about what would be the best way (atleast for this kind of project) to handle it.
The easy solution is ofcourse to have some kind of SRAM so that I can remap the 24 address lines and divide the RAM into pages of a few kb. The question is if memory protection is needed or not, since that would increase the difficulty of the project a lot.
When a new program is loaded, the total amount of RAM it needs should be specified already (could be written in the header of the file for example), so I can just reserve the amount of pages this program needs and run it without problems that it would try and read / write to an illegal address.
If I understand it correctly you only need memory protection if the program can allocate memory during runtime that you can't know in advance. So in C language you can't use malloc in the program, but fixed arrays will be fine.