Here is a description of the two phases boot process and the sources of the Loader and the uBIOS + Basic (as requested by some people).
At power on, the Atmega32A uses a DMA access to SRAM to copy the loader in the upper memory address space.
Because the loader is small, only a limited number of address lines are requested, saving some GPIOs for others tasks.
When the Atmega32A completes the DMA loading phase (first phase), it releases the Z80 bus and resets the Z80 CPU that starts to execute the loader from SRAM starting at address $0000.
Then the loader relocates itself at the bottom of the memory address space and it loads from the Atmega32A (this time used as a "virtual" sequential ROM in the I/O address space) the uBIOS + Basic image (second phase).
After this second load phase it jumps to the starting address of the uBIOS + Basic image, and executes it.
Inside the Arduino sketch you can see the two hex arrays. The smaller one is the Loader image, the bigger one is the uBIOS + Basic image.
In the Files section I've added the Loader source (S091116.asm) I wrote from scratch, and the two files (uBIOS and Basic) I took from the Grant's site. I've modified the first one (the one I've called uBIOS) that contains the I/O routines due the different HW design. In particular I changed the I/O addresses, the init code made for the original ACIA and the code to menage the internal registers of the ACIA. I've changed also the code that manages the ACIA serial handshaking because not needed here (the serial is managed inside the Atmega32A by the Arduino bootloader "environment") . You can easily see any modification in the source (S121216.asm) because they are marked with the string "Z80-MBC:" in the comment.
I left the Basic interpreter (basic.asm) untouched (for now, until I need some custom commands...).
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.