BigLadWhillis wrote:
I Am under the assurance of some members of the Forum that i should have my memory layout as ROM -> VIA -> RAM
However, How Much Of The Map Space should my RAM and ROM be taking up 50/50 25/75 etc..
As is common in the Newbies section, I am a beginner but looking to write my own kernel as i come from a background of Software Engineering so am up for the challenge
By way of adding (I hope) to the discussion, my POC V1.0 and V1.1 units had the following map:
Code:
$0000-$CFFF RAM (52KB)
$D000-$D7FF I/O (2KB, decoded into pages)
$D800-$DFFF unused (mirrors $D000-$D7FF)
$E000-$FFFF ROM (8KB)
Although I used the 65C816 in those units I did not implement any addressing beyond $FFFF.
POC V1.2, which is going through design right now, uses a similar map:
Code:
$0000-$BFFF RAM (48KB)
$C000-$C7FF I/O (2KB, decoded into pages)
$C800-$CFFF unused (mirrors $C000-$C7FF)
$D000-$FFFF ROM (12KB)
The above map is actually easier to decode than the map used in V1.0 and V1.1. No more than two gates sit between the address bus and the device being addressed, which minimizes circuit complexity and the effect of gate propagation times on performance.
Speaking of the 65C816, I recommend you use it instead of the 65C02. Interfacing is about the same and you gain the ability to use 16-bit loads/stores/operations, in addition to 8-bit operation. You also get more instructions and addressing modes, such as the very useful stack relative addressing. At reset, the '816 looks mostly like a 65C02 (emulation mode) and thus you can get started with it right away using standard 6502 programming methods. Once you get over the hurdle of getting your system to work, and have gotten comfortable with the 6502 assembly language, you can switch the '816 to native mode operation and start writing 16-bit code—which runs substantially faster than its 8-bit equivalent. When I undertook to build my first 6502 contraption I went with the 65C816 and never looked back.
As for the amount of ROM desired, it all depends on what you plan to do with the unit. My POC V1.0 and V1.1 units had a BIOS and a machine language monitor stuffed into the 8KB of ROM space. That included a SCSI driver, serial I/O, support for timekeeping (real time, plus uptime and a time delay function), console driver, and a jump table for access by programs. V1.2 will incorporate all of the above, plus a different method of calling BIOS services via software interrupts (the COP instruction, which is unique to the 65C816). I decided to go with 12KB of ROM to give me the "headroom" needed for experimenting with new BIOS features.