It gave me a bit of a headache getting my head around it when I was first doing this and I ended up cheating and just modified the corsham variant of the code (particularly as that system was already very similar to the one that I was adapting for) because I wasn't sure how to create my own. Unfortunately the code base has changed since then ... however, I recently went through the same process adapting it to work with the Fujinet card (which also has an SD and WiFi access) and I worked out how to separate an "MECB" version and adapt it to work with the MECB system (although I didn't get as far as switching to 6309 on that). I've just added that to my GitHub in case it is helpful:
https://github.com/epaell/MECB/tree/mai ... SW/nitros9
I did have some rough notes in this second attempt to remind myself what needed to be changed which I'll post here in case it helps:
Code: Select all
defs/mecb.d
- Needs to define all hardware addresses and device specific information
Level1/mecb/bootfiles
- makefile (contains needed modules need for boot - need to replace pio with fnio, clock2_cshsd->clock2_mecbfn)
Level1/mecb/bootrom
- makefile (contains modules needed for boot rom - kin,krnp2,init and boot_mecbfn)
Level1/mecb/cmds
- makefile (can keep the same as corsham version)
Level1/mecb/defs
- defsfile.asm (use mecb.d instead of corsham.d
- makefile (use mecb.d instead of corsham.d)
Level1/mecb/defsfile - replace corsham.d with mecb.d
Level1/mecb/makefile - replace CORSHAM with MECB
Level1/mecb/modules/
- rel.asm (needed to initialise ACIA and provide basic terminal I/O during boot)
- boot_cshsd.asm (change to boot_mecbfn.asm)
- Provides disk read capability to perform initial load of nitrOS9 into memory
- pio.asm (provides parallel I/O routines to access disk and RTC) - replace with fnio.asm for FujiNet routines
- clock2_csdhsd.asm (Provides routines to read FN time)
Level1/modules/
- clock.asm (needs to set up and handle timer interrupt for time slicing processes)
- krn.asm (there are some bits that need to define memory use
You can also check for instances of "mecb" throughout the files to see where it comes up (particularly in the common files to see where it is modified to work with that system). I believe the only place I deviated from my original plan above was that I placed the FujiNet routines in ROM so that it could be used by both the boot process and the system (it's a bit of a hack as it requires jumping to a fixed location - which kind of goes against the philosophy of OS9). If I placed it in the module (fnio) then I'd still need to have a version of it in ROM and it seemed a bit silly to duplicate that code twice (the memory availability in OS9 was bad enough as it was). I also added a ccopy.sh script which helped to start from a clean slate, compile the code, make the disk and copy across various test files to it.
You'll also need to set up a couple of environment variables:
Code: Select all
export NITROS9DIR=$HOME/local/src/nitros9
export PORTS=mecb
export LISTDIR=$NITROS9DIR/lst
The first tells the make system where the source is, the second tells it which port to build (otherwise it builds everything) and the third one makes it generate listing files (which I found useful for debugging).
You may also want to update the startup and password file for your system (I added a bunch of dummy users in there when I was playing with the multiuser/task switching side of things.
Hope this helps you get up and running!
BTW, I do have the original codebase for the original version where I modified the corsham version of the code and can provide that if that is also helpful but as I mentioned, the GitHub codebase has moved on since I made those changes.