cd /Projects/sun3-prom git clone https://github.com/MelkhiorVintageComputing/sun3-bootrom.git mv sun3-bootrom src_RomainThis gives me a local copy of what Romain did, and I can use diff to compare it to what I have. This has the "advantage" of letting me take a close look at the things he did.
diff -r Github src_Romain
The first thing is that Romain added to "tools" a utility to generate a checksum, and some entries in the Makefile in that directory.
He adds the -m32 switch to gcc to build genassym.c, but my Fedora system does not have the gcc libraries to support this. I can skip this (for now) and just not build genassym.c -- I'll use the assym.h that Romain generated (for now) and look into this later.
He also makes changes to tools/genassym.c itself. I rename mine to genassym.c.TOM and then copy his. I will look at this situation later.
Next we get to sys/reset.c -- here Romain adds a bunch of volatile declarations, and does some things with the following:
static void test_mem (const int, const int ); int mod3read_tramp(unsigned int start_addr, unsigned int end_addr, unsigned int pattern);Here again, I move my file to reset.c.TOM and copy his file into place.
Next we get to the routine prom_mem_batchrop() in the file /sys/fwritestr.c This was missing and I had placed a stub here. Romain changes my stub into an ANSI prototype, then supplies a blob of binary as build/rop.s!!
I should move the prototype for prom_mem_batchrop() into protos.h and maybe not call it static.
Next we get to build/Makefile. I play the same game, copying his verbatim and saving mine at ".TOM". I try running it and it works, but stumbles at the need for ../tools/sun3_checksum. The trick is to cd to tools, build it there using the proper makefile, then go back to "build" and run make.
I am resisting the urge to make any edits now, since they will just confuse the diff process I am using to drive this.
He makes a sensible change to sys/boot.c for the argument to nullsys().
He adds a comment to sun3/trap.s -- interestingly he uses "!" as the comment character rather than "|". And it turns out the compiler does not like this, so I change it to what works.
Now we get to sun3/romvec.s -- he commented out my shortcut "SHORT" (which is good) and he fixed all the global references by getting rid of the underscore prefix. We just copy this file and thank him.
He adds "packed" attributes to sun3/cpu.map.h and sun3/cpu.buserr.h In the first case for the wretched "struct pgmapent" and in the second for "struct buserrorreg". I copy both of these.
Now we get to sun3/assym.h -- here we save ours as .TOM and copy his. This really needs to get fixed back in tools, and someday it will.
Now two things get done to several header files. They get packed attributes, but also "guards" against being included more than once.
h/sunromvec.h -- struct bootparam, struct boottab, struct devinfo h/pixrect.h -- struct pr_pos, ..... h/memvar.h -- struct mpr_data h/diag.h -- struct diag_state h/buserr.h -- h/asyncbuf.h -- h/globram.h -- struct globramIn globram.h he designates g_nmiclock and g_keybid as volatile
The following get appropriate "volatile" declarations:
dev/saio.h -- in DELAY and CDELAY dev/sasun.h dev/zsreg.h
Then diag/diag.s gets FERRARI conditionals added (this is the 3/60) I copy this (keeping my old TOM version). I need to fix a comment character here also.
When I run it, the DIAG led sequence stops with the two LED at each end lit. I get no serial output.
The problem is that the image needs a checksum.
I change my setup to load "bootrom" rather than
bootrom.bin -- and it runs!
I type "k2" to the prompt and get:
>k2 Selftest Passed. Sun Workstation, Model Sun-3/75M or Sun-3/160M, Sun-2 keyboard ROM Rev 2.1, 4MB memory installed, Serial #17403 Ethernet address 8:0:20:1:DB:0 Testing 4 Megabytes of Memory ... Completed. Auto-boot in progress... Boot: ie(0,0,0) ie: cannot initialize
Tom's Computer Info / tom@mmto.org