Date: Tue, 28 Jul 2026 22:01:53 -0500 (CDT) Subject: Re: Getting back on TRK00 On Thu, 17 Jul 2025, John D. Baker wrote: > It seems that the Davidge ROM loading the floppy-disk boot sector over > itself at 0080h is a result of them mimicing CCS. The CCS FDC ROM loads > the boot sector at 0080h. And, as I mentioned before, all of the floppy > formats the Davidge supports are identical to those used by CCS. Since > I have a CCS S-100 system, I should dig it out and play with it as well. > Somewhere I have 5 bare GIDE boards that need building up (and see if > any of the salvaged GALs I have can be reprogrammed). I haven't returned to this project--I have a couple of others blocking the workspace--but I found myself looking up EPROM pin-outs to see if I could hack my Rev. B DSB-4000 to use a 4K EPROM instead of 2K. This led me to the wonderful repository of manuals, pictures and other things at "deramp.com". I think my CCS board set inclues the 2810 CPU and 2422 FDC and reading the manual for the 2422 showed that it included the firmware listing. for the disk version of the CCS "MOSS" monitor v2.2 (the 2810 manual has a similar listing for the non-disk version of MOSS v2.2). It was instructive to see things I'd disassembled, re-symbol'ed and commented in their original form. The disk version of MOSS includes floppy I/O primitives that are suitable to be used directly from one's CP/M CBIOS. The various data areas are useful to see named and described. I hope I can get back to the Davidge soon-ish, or maybe detour through the CCS S-100 machine if I can. ----- Date: Wed, 29 Jul 2026 12:23:27 -0500 (CDT) Subject: Re: Getting back on TRK00 > On Tue, Jul 28, 2026 at 10:02 PM John D. Baker wrote: > >> On Thu, 17 Jul 2025, John D. Baker wrote: >> >>> It seems that the Davidge ROM loading the floppy-disk boot sector >>> over itself at 0080h is a result of them mimicing CCS. The CCS FDC >>> ROM loads the boot sector at 0080h. And, as I mentioned before, >>> all of the floppy More specifically, CCS boards put their ROMs at 0F000h and use various trickery to send the the Z80 there (Power-On Jump inserts C3 00 F0 on the data bus after reset; "Reset Glide" makes NOP instructions (00h) appear on the data bus until the CPU reaches the ROM address.) So, in a CCS system, MOSS resides in ROM at 0F000h, sizes the RAM, sets up its workspace just below the top of RAM, initializes RST locations and various other things in the region 0000h-007Fh. When the disk version of MOSS loads the boot sector(s) from disk beginning at 0080h, it's not overwriting anything. ----- Date: Wed, 29 Jul 2026 15:22:33 -0500 (CDT) Subject: Re: Getting back on TRK00 In my reading of the DISK MOSS v2.2 source (and in my disassembly of the Davidge FD-4000 v1.3 BIOS) I've come across the idiom: IN DSECTR OUT DTRCK The comments in the DISK MOSS v2.2 source makes it appear that following a successful READ ADDRESS command in the WD1793 FDC, the SECTOR register contains the number of the track from which the ID fields were read. The included WD179X data sheet mentions nothing about this either in the register description or the command description. I wonder if there's some errata floating around about this. ----- Date: Wed, 29 Jul 2026 15:37:48 -0500 (CDT) Subject: Re: Getting back on TRK00 On Wed, 29 Jul 2026, John D. Baker wrote: > In my reading of the DISK MOSS v2.2 source (and in my disassembly of > the Davidge FD-4000 v1.3 BIOS) I've come across the idiom: > > IN DSECTR > OUT DTRCK > > The comments in the DISK MOSS v2.2 source makes it appear that following > a successful READ ADDRESS command in the WD1793 FDC, the SECTOR register > contains the number of the track from which the ID fields were read. > The included WD179X data sheet mentions nothing about this either in > the register description or the command description. I wonder if there's > some errata floating around about this. I fail at reading. I was distracted by the diagram of the sector ID layout and the bit about the CRC bytes and how the FDC has already verified the CRC and completely missed the sentence after that which explicitly says that the sector register is set to the track number of the ID field just read. Hmm. So, if for some reason you don't know what track you're on, execute a READ ADDRESS command. Even if you read and discard the data, the sector register will still tell you the track and you can then program the Track register accordingly. ----- Date: Sun, 2 Aug 2026 21:55:16 -0500 (CDT) Subject: Re: Getting back on TRK00 On Tue, 28 Jul 2026, John D. Baker wrote: > On Thu, 17 Jul 2025, John D. Baker wrote: > > > It seems that the Davidge ROM loading the floppy-disk boot sector over > > itself at 0080h is a result of them mimicing CCS. The CCS FDC ROM loads > > the boot sector at 0080h. And, as I mentioned before, all of the floppy > > formats the Davidge supports are identical to those used by CCS. Since > > I have a CCS S-100 system, I should dig it out and play with it as well. More specifically, the DSB-4000 FDC implementation is very similar to that of the CCS 2422 FDC card. It uses the same FDC (WD FD1793) and implements the same external registers with the same organization. It just uses different port addresses and being on the same PCB with the other components can use real interrupts and real DMA. The ROM source I have printouts of (since transcribed to my disassembled and reconstructed source files on disk) include reference to a "BANK SELECT" port, with a value of 40h. Maybe they just cribbed stuff from CCS and left it in? There's no banks to switch on the DSB-4000. (The DSB-6000 series did support more than 64K RAM, so maybe they were covering that case as well.) Looking at the source for a BIOS extension for machines with CCS 2065 64K DRAM cards to use multiple cards in higher banks as a RAM disk under CP/M. Their technique to swap BIOS jump tables is virtually identical to what I did in my GIDE BIOS extension. Likewise each of their extension routines checks whether the call is for their drive and if not passes it off to the stock BIOS--just like mine do. ----- Date: Sun, 9 Aug 2026 20:05:33 -0500 (CDT) Subject: Re: Getting back on TRK00 So, while reading CCS manuals and perusing code listings on "deramp.com", I realized that there doesn't appear to be a source file for the disk version of CCS MOSS v2.2 monitor as found on the 2422 FDC. The only firmware directory is under the 2810 CPU board and that's for the non-disk (paper tape!) version of MOSS v2.2 that is in the ROM on the 2810 CPU card itself. I had downloaded Rev A, B, and C 2422 manuals which are PDFs containing image scans of the manual pages. The Rev A and C manuals couldn't produce anything with a selection box in 'xpdf', but the Rev B manual produced workable output when pasted into an editor. It made some strange word salad of some of the things, but I was able to untangle the mess. It's a good thing I had all three manual revisions. The Rev B and C manuals both have the same listing and are missing 2 instructions (5 bytes) across a page break. Fortunately, the Rev A manual had slightly different formatting and those lines fell in the middle of a page instead of at the end, so I was able to fix it. (Actually, I had already guessed at what the first instruction was and when I reviewed the Rev A manual, it proved me right. I finally got it all cut, pasted, and fixed as much as I could with just reading the listing and comparing it to my pasted and adjusted text file. I needed an assembler, specifically Digital Research's "MAC" macro assembler, but I wasn't ready to set the Davidge up again. Looking in NetBSD's "pkgsrc" (and "pkgsrc-wip") showed 4 options. I had been carrying "aliados" along for a while, but when I finally went to use it in earnest I found it sorely lacking and ultimately it bombed out trying to run something simple. Next is "simh" (and variants "open-simh" and "simh3"). The only suitable machine it emulates in an Altair with either an 8080 or Z80 CPU. It requires you to prepare disk images for it to use since it's emulating a specific machine. I think I would need a real Altair boot disk image to even get started. Then I found "ntvcm" which simply emulates the BDOS interface and the character-I/O BIOS interface so you just use the host filesystem and console I/O. I don't think it provides a complete environment but is good for quick command-line utilities. Then I found "runcpm" which likewise emulates the BDOS and character- I/O BIOS routines, but provides a simulated environment, much like "aliados" does and it seems to work very well. Once I remembered to convert UNIX EOL (\n) to CP/M EOL (\r\n), I was able to assemble "DMOSS22.ASM" and review the listing output to find and fix the errors that remained. It was mostly places where I missed the font-recognition failures putting "O" instead of "0" and vice versa and some truly garbled data where it made its best guess at what some character(s) was/were and got it completely wrong. I still need to do a line-by-line comparison with my listing versus the printed (PDF) listing to make sure I didn't miss anything. The copy/paste from xpdf had a tendency to compact things toware the upper left so labels would be shifted many lines up from where the were supposed to be and operand fields and comments were similarly displaced. Sometimes it was easier to start at the end of a block and move stray bits up or down to their correct places. Since then I've been exploring a rabbit hole inspired by a firmware listing in the "mfa_computer" subdirectory on "deramp.com". It shows how to arrange for ROM code at one address to copy itself to another address in RAM and then run from RAM. I'm getting notions for how to get the Davidge boot ROM out of the way so the floppy-disk boot sector won't overwrite the code and provide even more room for activities. So far, my test program seems to work. ----- Date: Thu, 13 Aug 2026 15:44:42 -0500 (CDT) Subject: Re: Getting back on TRK00 So, I've been beating the Davidge boot ROM (as modified for IDE hard disk boot) into a form that uses the relocation mechanism and making it look more like CCS Disk MOSS 2.2. Namely, that it should not expect writable memory within its confines either before or after relocation. As such RAM is available strictly below its base address after relocation, so all the workspace and stack are located below it instead of above (workspace) or at the top of RAM (stack). In so doing, I uncovered a bug in the simplified monitor it provides. Namely, that when collecting and converting parameters for a command, if the parameter length is 0, the parameter converter fills RAM with 256 bytes of whatever was last in the line/display buffer. Since the buffer is only 70 bytes, it overwrites its own workspace and since I had only allocated 128 bytes for the workspace (between the top of the stack and the runtime base address), it scribbled on the first 192 bytes or so of the runtime image. In only took 3 instructions (4 bytes) to fix--test the parameter byte count and branch to the error routine if it's zero. In the original ROM code, the workspace immediately followed the fixed code/data (ROM copied in-place to RAM and ROM disabled), so the bug was harmless. ----- Date: Thu, 13 Aug 2026 20:14:12 -0500 (CDT) Subject: Re: Getting back on TRK00 So, debugging it under ZSID running in the 'RunCPM' emulator, I had to modify the various console I/O routines to use BIOS calls rather than direct port I/O to the Z80 SIOs. One thing that bit me is that the original "CONOUT" routine returns with A the same on exit as it was on entry while the BIOS routine make no such guarantee. Just an extra PUSH PSW/POP PSW around the call to the BIOS CONOUT routine fixed that. (Actually, the emulated BIOS of 'RunCPM' returns from CONOUT with C the same as on entry, so the push/pop reduces to "mov a,c". I need to review the DRI manual as to whether that's a requirement. The skeleton CBIOS.ASM says nothing about it although the skeleton "conout" routine starts with "mov a,c" and leaves the rest to the programmer.) I changed the "DISMSG" string printing routine to terminate if the character has bit 7 set (like the analogous routine in the FD4000 v1.3 BIOS) with a tweak to clear the bit before calling CONOUT. Hmm. to complete the illusion of read-only text, I'll need to copy the DMAC control string from "ROM" to RAM since the FDC/DMAC code needs to write address and byte count into it. Maybe I'm overdoing it. Although the Davidge implementation closely mimic's the CCS 2810/2422, my inspiration for the relocation code comes from a system with ROM at 0000h and RAM at F000h after reset, so perhaps my earlier approach of keeping the fixed initialization code as short as possible (copy ROM to RAM, disable ROM, move code to runtime base) and then jump to 1-time init code that overlays what will become UDATA space at the end of the ROM image is the way to go. That said, the MOSS monitor listings are very instructive as to how to code for read-only text segments and minimal fixed data whether used in-place or copied to RAM. And it fits in a 2716 (2KB) ROM! ----- Date: Tue, 15 Sep 2026 20:41:04 -0500 (CDT) Subject: Re: Getting back on TRK00 I've been preparing materials to make an hysteric return to t3h 1n74rw3bz. I've extracted and redacted the previous email chain on the DSB-4000 hacking to be perused by any who find my page. Actually, I discovered a bit of Internet Fame when links (now dead) to documents I used to host show up in the technical manual for a product. In this case, an IDE interface for the Zenith Z100 Z80/8086 computer. Then, I found more such files on "ftp.apple2.asimov.net". One of which I wrote, someone formatted and produced a PDF version. All stuff about the PCPI Appli-Card (Z80 co-processor for Apple ]['s). So, reading lots of BIOS listings for ideas, I happen to have a printout of the PCPI Appli-Card Z80 BIOS. The structure of the Appli-Card system means that all the routines are essentially device-agnostic. They aren't tied to a rigid specification for either character or block devices. Sounds like an execellent model to adapt for the Davidge. So, I went looking for more Appli-Card stuff on the 'net since I can't actually get to my own (which is where all the source code and tools are). I actually cribbed some code from the Appli-Card BIOS in my GIDE BIOS extension. Reading *all* the BIOS listings on "deramp.com", I found only a couple that implemented the HOME routine according to the DRI example in "DEBLOCK.ASM" (and later clarified in a DRI-issued patch "CPM22PAT.09"--available at "deramp.com"). Namely: home: ;home the selected disk lda hstwrt ;check for pending write ora a jnz homed sta hstact ;mark host buffer inactive homed: ret All the BIOSes I'd read simply set BC (or often just C) to 0 and fell trough to "settrk". The Appli-Card BIOS does essentially the same thing: home: lda hstact ;host buffer active? ora a ;set flagz rz ;return if not active lda hstwrt ;check for pending write ora a rnz ;return if host buffer written sta hstact ;else mark host buffer inactive ret Neither routine actually "homes" the disk (or at a minimum sets the track number for the next operation to 0). The patch from DRI was instructive as in place of "ret" in the DEBLOCK.ASM code there is a note to "Continue with the rest of the home routine." There were two deblocked BIOSes for Tarbell FDCs (and hard disks!) that used the DEBLOCK.ASM "home" routine as explained in the patch and instead of returning, that's when they set [B]C to 0 and fall through to "settrk". Until I fire up the Davidge again, I don't have much of my source code accessible, but I did have the original sources from my old web pages on hand, so I've been fixing them up and tweaking them. I started looking at my commented disassembly of the Davidge's CBIOS and my GIDE BIOS extension and realized I could patch back into the CBIOS in a couple of places and save duplicating the code. Namely, the "gocpm" part at the end of the CBIOS' WBOOT routine that initialized the necessary items for itself and the CP/M zero-page requirements. In so doing, I think I have found a bug in the FD-4000 v1.3 BIOS. B is used to hold the count of sectors remaining on each of the system tracks. Naturally track 0 is single-density, 128 bytes/sector, so 25 (19h) sectors remain on 8-inch and 17 (11h) remain for "mini-disks". When it's time to switch tracks, B is reloaded from memory addressed by the IX register with a 0 displacement: ldx b,0 ;in DRI Z80.LIB macro form or ld b,(IX+0) ;in Zilog form or mov b,0(IX) ;in TDL form The only place the IX register is initialized is in the cold boot subroutine that converts the CP/M serial number from hex/binary to ASCII decimal digits. Even then, it's only used to point to the portion of the string where the ASCII representation of the digits are put for printing. So IX is left pointing to some random byte in the CBIOS' host sector buffer instead of the physical sector/track value for the disk in use. As long as the value is big enough to load all of CCP+BDOS, it doesn't show itself. The code checks the high byte of the next buffer address to see if it has reached the BIOS' starting page and uses that to determine that it has loaded everything before doing the initializations and jumping to the CCP/CCP+3. There's still a lot of the disk-identification code to untangle and it makes my head hurt.