BMOW title
Floppy Emu banner

Boot Loader

Following my experience with the video system, I decided to create a boot loader. It’s a little surprising that I never did this before, actually. While working on the video, after every tiny change to the video software, I had to reprogram the BMOW main ROM and stick it back on the board. I must have done it 100 times, and each time took a couple of minutes of fiddling with the chips, EPROM programmer, and software. What a pain.

Fortunately BMOW already had all the ingredients needed for a better solution, including a USB connection for communicating with a PC. I wrote a fairly simple boot loader program, which I programmed into the main ROM– hopefully my last ROM program for a while. At power-up, the boot loader listens for data from the PC on the USB port. It expects an initial signature, followed by two bytes to determine the download size, then the download data itself, and finally a checksum. The downloaded data is copied byte-for-byte to a fixed address in RAM. Once the download completes, if the checksum matches, the boot loader transfers control to the downloaded program and it’s off to the races.

Using the boot loader allows me to experiment with software changes far faster than before. I can change a couple of lines of code, assemble it, hit BMOW’s reset button, and download the new program using the boot loader. The whole process only takes a few seconds, compared with a few minutes for my old method of burning a new ROM each time.

Read 5 comments and join the conversation 

5 Comments so far

  1. Merlin Skinner - October 3rd, 2008 12:54 am

    Very nice! I’m really pleased that you have found the enthusiasm to develop this a bit further. Good luck with whatever you plan to do next.

    Merlin

  2. MGA - October 3rd, 2008 7:03 am

    Looks nice…

  3. Merlin Skinner - October 3rd, 2008 11:23 am

    I’ve sometimes though about getting a very simple chess program running on a homebrew machine. It would provide a good demonstration to people who don’t fully appreciate your achievement – an answer to the “so, what does it actually do?” question.

    There’s a Sinclair ZX81 (Timex made a clone in the US) program here – http://users.ox.ac.uk/~uzdm0006/scans/1kchess/ It’s incredibly short, and apparently not particularly good at chess, but it would make a good demo. The new graphics capabilities could possibly be used to provide a graphical representation of the board state, if you fancied it.

    The code is in Z80, so you’d have to convert it to BMOW. I’m happy to help with anything you need to know about the rather curious ZX81 environment.

    It’s just a thought – might be interesting!

  4. Steve - October 3rd, 2008 7:29 pm

    Thanks. I think I mistakenly gave the impression that I was quitting this project. I only meant that I’d obsessed a bit too much over the video system, and was looking forward to a break. I still have many more plans for BMOW: audio, persistence, a real case, and all sorts of software.

    A chess program is a great idea, and something I’ll probably do at some point. Earlier I found this simple 6502-based chess program, which would be a good match for BMOW’s instruction set: http://6502.org/source/games/uchess/uchess.htm

    I’d also like to write a BASIC interpreter, or port an existing one, so I can do the obligatory:

    10 PRINT “HELLO WORLD”
    20 GOTO 10

  5. Merlin Skinner - October 8th, 2008 11:23 pm

    The Acorn Atom had a very nice simple BASIC that should be pretty easy to port. This is in part because the “Machine Operating System” (MOS) – pretty much a BIOS – is fairly separate from the interpreter itself. The BBC micro had a much more sophisticated BASIC with floating point etc., but the BBC machine is much more complex. I’ve seem disassemblies of the BBC ROMs on the internet, which make interesting reading and would be very useful for a port.

    See:
    http://en.wikipedia.org/wiki/Acorn_Atom
    More data here http://www.iwriteiam.nl/Ha_Atom.html

    http://en.wikipedia.org/wiki/BBC_Microcomputer
    More data here http://bbc.nvg.org/history.php3 and http://www.btinternet.com/~lawrence.edwards/bbccomp/bbc.htm

Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.