On Making Progress
With my Wrap030 homebrew computer operational again, I could finally get back to the work I had been wanting to do with it in the first place. I was able to get it running my multi-user BASIC kernel from ROM with the main board, DRAM card, and 8-port serial card.
There's still more work I want to do with software, and pulling and burning the ROM for every little change is not a great way to develop software. It would be great if I could load programs from a disk instead. I did previously have disk access working, but that was with a different system configuration and a different ROM. There was also a limitation with my old code where files that spanned multiple clusters didn't load right.
So I needed to test the system with the FPU+IDE mezzanine board added to the stack, and I needed to add disk load functions to my ROM.
Adding the FPU board went better than expected. I added it to the stack and the system continued running as it had previously. I didn't even have to lower the clock speed to compensate for the new board.
So time to update that ROM. My previous disk load functions were written to work with the TSMON monitor program I had been using. I wanted something that could load my Multibasic system (or another OS) without intervention, so TSMON was not going to be a good fit. All I really needed was a simple bootloader — something that could load a file, BOOT.BIN, from the disk and run it.
Rather than try yet again to wrap my head around parsing FAT filesystem headers and how to traverse the allocation table, I decided to try using an existing library. The Elm-Chan FatFs library was just the thing I needed. It's written to be portable, needs only a few custom functions implemented by the host system for disk sector reads, and documented reasonably well. I was able to get it running in a weekend, including all the time it took for me to debug my own silly mistakes like reading only 510 bytes of each disk sector instead of 512 and accidentally swapping bytes when caching data read from the disk.
Getting Multibasic ready to run from disk instead of from ROM was actually fairly straightforward since it was already built to be loaded from ROM to RAM and then run from there. I just needed to make a few minor changes to the linker script and add a branch at the beginning of its vector table.
So after many hours of work, I am right back where I was at the start … but also miles ahead of where I started. If I need to make a change to the Multibasic kernel, I can just copy the new program to a CompactFlash card like any other file. If I want to load a new program I can do so easily. And swapping programs is as easy as swapping cards and hitting Reset.
















