Wednesday, December 16, 2020

NitrOS-9 boot from ROM

One of the shortcomings of this CMS 9619 system is the fairly complicated OS9 bootstrap procedure I had to use in the absence of any sort of disk drives. To summarize:

  1. DEBUG19 (in ROM) starts
  2. Host computer transfers a small loader program using DEBUG19's memory edit routine
  3. DEBUG19 jumps to the loader program, loading the kernel track from the drivewire server and runs it
  4. NitrOS-9 starts and continues loading the rest of the bootfile from drivewire
This works pretty well, but has several drawbacks:
  • 8K of address space is taken up by DEBUG09 ROM
  • The host computer needs a separate script to efficiently transfer the loader program using DEBUG19
  • 2 x 256 byte blocks of RAM need to be reserved to hold the RAM interrrupt vectors and data for DEBUG19

I had hoped that the kernel file could run from ROM and directly load disk images from drivewire. Unfortunately, the NitrOS-9 code is tied closely to the CoCo's hardware, and always relocates the kernel from ROM to RAM. To combat this problem, I replaced NitrOS‑9's relocation routines and added a module to initialize the CMS 9619 hardware for booting directly into the NitrOS-9 kernel. From there, the NitrOS-9 booter (on ROM) will load a disk image over drivewire. This is very similar to the set-up for the CMS 9639 (and I assume other computers sold with OS9). NITROS9 ROM BOOT NitrOS-9/6809 Level 1 V3.3.0 CMS 9619A (C) 2014 The NitrOS-9 Project ** DEVELOPMENT BUILD ** ** NOT FOR DISTRIBUTION! ** Wed Dec 16 16:07:07 2020 http://www.nitros9.org * Welcome to NitrOS-9 Level 1 * * on the CMS 9619A ASBM * yyyy/mm/dd hh:mm:ss Time ? 2020/12/12 05:55:55 >> Clock Initialization Errors << December 12, 2020 05:55:55 Shell OS9:

(The Clock init Error is because the code currently expects the DEBUG19 clock setting routines to be installed in ROM, which they are not. I still need to add these.)

It took some careful configuration to ensure that the CMS 9619 can boot from the DEBUG19 loading process OR directly from ROM, with no wasted memory in either case. Since the final NitrOS-9 boot ROM is less than 4K in size, an abbreviated DEBUG19 can also be programmed into the EEPROM. The code is available on Github.

On the note of programming EEPROMs, I discovered back when I was disassembling DEBUG19 that I can use DEBUG19's memory edit routine to program an EEPROM on the board. Of course, the timing is all wrong and the editor returns an error because the EEPROM takes much longer to store the value than RAM would. With some help from an expect script, it is fairly easy (though slow) to continuously run the memory edit routine, once for each byte, and ignore the errors. So, I can program EEPROMs on board by simply moving a jumper and running the script. If anybody has one of these boards without a ROM, I would be happy to send you a fully programmed EEPROM with NitrOS-9 and DEBUG19. In fact, I think I will add that to my tindie store soon!