Memory mapping
3.1 Overview
Zeal 8-bit Computer is based on a Z80 processor, thus it has two main buses to communicate with the different components on the board:
- Memory bus, used for communicating with RAM, ROM, VRAM, external memories, etc. Composed of 22 bits thanks to the Memory Management Unit, it can address 4MB.
- I/O bus, used for communicating with I/O devices, such as GPIOs, UART, MMU, etc. Composed of 8 bits, it can access 256 different addresses.
Let's see how both are mapped.
3.2 Physical memory mapping
Primary ROM mapping
It is important to note that the first 512KB of memory are both mapped to the internal primary ROM. By default, both 256KB areas composing this first chunk are mapped to the 256KB primary ROM. Thus, the second area acts as an Echo ROM.
However, if the primary ROM is replaced with a 512KB one, this second memory area, starting at 0x04_0000
will be mapped to the second 256KB part of ROM. Thus, Zeal 8-bit Computer supports a primary ROM of size up to 512KB.
Internal SRAM
Starting from address 0x08_0000
, the 512KB internal SRAM is mapped as a contiguous memory area.
Reserved area
The 128KB memory area starting at 0x10_0000
is currently reserved and shall not be used by any external component.
It is meant to be mapped to external video RAM, or VRAM in the future.
Unmapped area
The 2.9MB memory area starting at 0x12_0000
can be freely used by the user.
3.3 I/O mapping
The I/O mapping is separated into two 128-byte parts:
- Unused area
- System area
The users are free to map and use any address from the unused area. The system area, however, is meant to be used by Zeal 8-bit Computer's current or future internal devices.
Unmapped area
These first 128 bytes are unused in the system, it can be freely used by the users for mapping external devices or components.
Reserved area
This area is currently unused but not free. It shall not be used by users as it will be occupied by future features such as sound, video, TF card, etc...
Z80 PIO
The area of 16 bytes starting at address 0xD0
is mapped to the Zilog Z80 PIO. This area can be accessed in both read and write.
For more details, check Parallel I/O: Zilog Z80 PIO section.
PS/2 Keyboard
The area of 16 bytes starting at address 0xE0
is mapped to the PS/2 keyboard output register. This area is read-only, writing to it will have no effect.
For more details, check PS/2 Keyboard section.
Memory Management Unit
The area of 16 bytes starting at address 0xF0
is mapped to the Memory Management Unit/Memory Mapper. This area can be accessed in both read and write with some constraints. Indeed, reading from it requires a particular setup, explain in the
PS/2 Keyboard section, please refer to it for more details.