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. ----- Date: Fri, 18 Sep 2026 05:38:32 -0500 (CDT) Subject: Re: Getting back on TRK00 > On Tue, Sep 15, 2026 at 8:41PM John D. Baker wrote: > > 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 I had a copy of the assembler listing (.PRN file) for the Davidge BIOS from the last time I modified the source and assembled, so I converted it back into assembler source by 'cut'ting off the annotation fields (and the line numbers added during the transfer with 'PIP') and sending it through 'tr' to effectively "tolower()" the whole thing. Then edit in 'vi' to re-tabify it and "toupper()" things that shouldn't have been "tolower()ed". Given the similarity with the BIOS for the CCS 2422 FDC, I actually opened a copy of that and read the two in parallel. I then began adapting the CCS BIOS' label names to the Davidge BIOS. I was able to make more progress deciphering some of the deep disk-handling routines--nearly all the registers are outputs from some of them. I was running 'MAC' and 'PIP' and 'ZSID' under 'ntvcm'. In particular, after I'd assembled the BIOS segment, I wanted to compare it to the binary from which it was originally disassembled. I loaded "CPM64.BIN" with ZSID, filled memory from the base of TPA to the base of BIOS (1f7f) w/00, loaded "CBIOS64.HEX" with an offset of "1180h" so it would be loaded at 0180h then used the block-compare routine assembled at 0100h to see if they produced the same code. I found one byte that I failed to "toupper()" in my editing, but testing the output from assembling the corrected source was not working. It was still showing the same wrong byte in the same place. I guess 'ntvcm' couldn't tell that the file content changed out from under what it last read and it was just re-reading from buffer cache. Quitting 'ZSID' and restarting showed that I had, in fact, fixed things and my reconstructed BIOS assembled identical to the original. I learned this block-compare routine 30 years ago when I first began disassembling the Davidge CBIOS and I've used it in a number of places. With the original binary at 1f80 and my reassembled dissassembly at 0180, I just had to do (using ZSID's a)ssembler): ld hl,180 ld de,1f80 ld bc,980 ld a,(de) cpi jr nz,120 jp po,128 inc de jr 109 and put "FF" bytes (rst 38h instructions) at 120 and 128. If bytes don't match, it branches to 120 and I use the "x)amine" command to see where the difference was (although HL will be pointing one byte beyond the mismatch). If all bytes matched (BC=0000), then it jumps to 128. I re-remembered a couple of places the stock CBIOS needs patching when the GIDE BIOS is in use. The error path for floppy operations ultimately performs a jump to WBOOT depending on user response. This needs to be changed to WBOOTE (bios+3) so it goes through the (swapped) jump table instead of directly to the routine. ----- Date: Sun, 20 Sep 2026 14:55:38 -0500 (CDT) Subject: Re: Getting back on TRK00 On Fri, 18 Sep 2026, John D. Baker wrote: > Given the similarity with the BIOS for the CCS 2422 FDC, I actually > opened a copy of that and read the two in parallel. I then began adapting > the CCS BIOS' label names to the Davidge BIOS. I was able to make more > progress deciphering some of the deep disk-handling routines--nearly > all the registers are outputs from some of them. When the disk-handling routines got too tedious, I looked at the serial and parallel port handlers--more specifically the IOBYTE selection routines and ultimately the routine that reads status and reads/writes data from/to the port. While the stock CCS BIOS only has the 8250 UART on the 2810 CPU board, the DSB-4/6 has 2 Z80 SIO/0 chips for 4 full serial ports and a simplified parallel port constructed from an 8-bit line-driver/receiver pair. Rather than defaulting to the "TTY" assignment for all CP/M logical devices (and non-TTY assignments prompting an error message), the Davidge makes some reasonable assignments of each logical device to one of the physical devices. The logic generally follows that of the CCS BIOS otherwise. So, I grafted more of the CCS BIOS labels into the Davidge BIOS. While working in that area of the code, I believe I have found some dead code. Nothing refers to it and there are no code paths that lead to it. It's not big, but hey, 5 bytes is 5 bytes. I also noticed a couple of places where a register transfer (ld dr,sr or mov dr,sr) would be more convenient that loading an immediate constant (usually to put a 0 in a register). Specifically, taking advantage of the fact that B=0 immediately following the last iteration of "DJNZ". Editing CP/M text files with 'vi' is tedious when you're adding more lines. It's important to scan the file periodically for lines that have something other than "^M" at the end of a line. Otherwise, MAC runs lines w/o a into the following line and may spew errors or in once case, the only way I noticed a problem was when the end address was 2 bytes off. I should probably make a point of using 'dos2unix' before editing and 'unix2dos' afterwards. I should poke at 'nvi' (BSD's 'vi') to see if it can be convinced to use whatever line-ending sequence it finds rather than strictly '\n'. I known 'vim' can do that, but, well, it's 'vim'. ----- Date: Mon, 21 Sep 2026 23:44:25 -0500 (CDT) Subject: Re: Getting back on TRK00 On Tue, 15 Sep 2026, John D. Baker wrote: > 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. I think I found the actual bug. WBOOT calls SELDSK which sets up the pointer to the translation table--the first entry in the Disk Parameter Header--and returns HL=DPH[dskno](.XLTN). WBOOT then copies the XLTN address into DE, pushes it on the stack then pops it back into HL. The previously-saved retry count and disk number in BC is then popped off the stack and HL is reloaded with the CCP base address to read in the system from disk. So: [...] call seldsk ld e,(hl) inc hl ld d,(hl) ;DE->xlt table for disk in selected drive push de pop hl ;BUGBUG: should be "pop ix" pop bc ld hl,ccp [...] The translation tables are pairs of numbers: physical sectors/track, skew factor HL points to the sectors/track for the disk in the warm boot drive, but then is ignored. If the "pop hl" above were instead "pop ix", then IX would point to the physical sectors/track value for reading from track 1(,2 on 5.25" disk) and the "ld b,(ix+0)" would load valid data. I don't dare actually fix it until I have it fully commented and all auto-generated labels replaced with more meaningful ones. Until then, I need to make sure that my disassembly and commenting assembles to the same the binary I took it from. There are two routines left to re-label. One is the routine that determines the disk type, size, sidedness, etc. The other does the various waits needed for floppy operation (head-load, settling time, motor-on). If I can grok them in more fullness, comments may be edited to be less literal and more descriptive of what's being done. ----- Date: Wed, 23 Sep 2026 07:27:39 -0500 (CDT) Subject: Re: Getting back on TRK00 On Fri, 18 Sep 2026, John D. Baker wrote: > I re-remembered a couple of places the stock CBIOS needs patching when > the GIDE BIOS is in use. The error path for floppy operations ultimately > performs a jump to WBOOT depending on user response. This needs to be > changed to WBOOTE (bios+3) so it goes through the (swapped) jump table > instead of directly to the routine. I've managed to complete re-labeling of the disassembled CBIOS and added some convenience EQUates to locate code and data of interest so they can be referenced by the GIDE BIOS extension. (I'm currently only working with the original versions that run as the CCP turnkey command as that's the only source I have without setting the Davidge up again.) My convenience EQUates include the offsets to the two "JMP WBOOT" operand addresses, so I've added code to the GIDEBIOS "Hboot" cold boot routine to patch them to "JMP WBOOTE". Stupid Z80 tricks: "swpjptbl" swaps the stock BIOS jump table with our replacement. On exit, HL=address in base page of CBIOS, so we use this to our advantage: swpjptbl: [...] ;HL->last byte of CBIOS jump table ld c,h ;save bios base page in c ld b,2 ;2 locations to patch ld de,ofs0 ;the first jr patch patch0: ld de,ofs1 ;the second ld h,c ;bios base page in H patch: ld l,0 ;0 in L add hl,de ;make address ld (hl),3 ;offset of wboote inc hl ;bump to high byte ld (hl),c ;in bios base page djnz patch0 ;and do the other [...] Also a slight rework of the code to stuff a new turnkey command into the CCP cibuff so that if the length byte is 0, the copy is skipped, the length in the CIBUFF is reset to 0 and the jump to the CCP (via "jp (hl) [or "pchl" in 8080 mnemonics]) will act like a jump to CCP+3. ----- Date: Thu, 24 Sep 2026 14:02:59 -0500 (CDT) Subject: Re: Getting back on TRK00 On Wed, 23 Sep 2026, John D. Baker wrote: > I've managed to complete re-labeling of the disassembled CBIOS and added > some convenience EQUates to locate code and data of interest so they > can be referenced by the GIDE BIOS extension. (I'm currently only > working with the original versions that run as the CCP turnkey command > as that's the only source I have without setting the Davidge up again.) Since I had previously uploaded the contents of what I would consider a minimum viable system disk, I had the Davidge-customized "MOVCPM.COM" available. I just needed to defeat the S/N checks to run it under the 'RunCPM' emulator (since I needed to be able to 'SAVE 40 CPMxx.COM' afterwards). I told it to generate a baseline 20K system image, saved it, then made a copy of my commented, regenerated source code with "msize equ 20" and reassembled it. After a bit of faffing around, I got CPM20.BIN and CBIOS20.HEX loaded in the correct spots. I had previously written "BLKCMP.ASM" so I wouldn't have to type it in manually each time, so I loaded its .HEX file (at 0100h, of course) and it reported that the two blocks were identical. Yay! I put in conditional assembly for what I propose as bug fixes and/or optimizations, so I can test that I haven't broken anything if I poke around in other parts of the code. There are some utilities on "deramp.com" that will let me regenerate a fully-relocatable system from two system images for different memory sizes. That way, I could patch in the BIOS segment with my fixes and optimizations and still have it relocatable. It also includes options for boot sectors larger than 256 bytes, so I could patch in my IDE hard- disk boot sector as well. The ultimate goal is to fully integrate my hard disk support rather than having it tacked on and needing loaders or hacks to activate it. I'm quite a bit closer to that goal now. Need to read more BIOS sources for ideas... ----- Date: Thu, 24 Sep 2026 23:56:34 -0500 (CDT) Subject: Re: Getting back on TRK00 On Wed, 23 Sep 2026, John D. Baker wrote: > I put in conditional assembly for what I propose as bug fixes and/or > optimizations, so I can test that I haven't broken anything if I poke > around in other parts of the code. I realised there were two more places where one routine calls another that should go through the jump table. I made the changes in my conditionally-applied fixes, but I also captured their address offsets so they could be patched in the unmodified system. Now that there are 4 patches instead of two, I needed a proper table and routine to handle them, so in place of the stupid Z80 tricks, I did the following: ; ; patch two "jmp wboot" and calls to "seldsk" and "sectran" so they ; go through the BIOS jump table. ; wbpof0 equ 42eh wbpof1 equ 43ch sldpof equ 0eah sctrnof equ 2c3h ; ld c,h ;save BIOS base page in C ld b,nptchs ;number of patches to make ld hl,ptchtbl ;point at patch table patch: ld e,(hl) ;get offset inc hl ld d,(hl) ;in DE inc hl ld a,(hl) ;get replacement offset push hl ;save pointer ld l,0 ;HL=bios ld h,c add hl,de ;make address ld (hl),a ;install replacement offset inc hl ;bump to high byte ld (hl),c ;install replacement page pop hl ;restore patch table pointer inc hl ;bump to next djnz patch ;and go again ; [...] ; ; patch array to make CBIOS calls go through jump table. ; format: 2 bytes offset to patch, 1 byte of offset in jump table ptchtbl: dw wbpof0 db 3 ;offset of wboote in jmp tbl dw wbpof1 db 3 dw sldpof db 1bh ;offset of seldsk in jmp tbl dw sctrnof db 30h ;offset of sectran in jmp tbl nptchs equ ($-ptchtbl)/3 ----- Date: Fri, 25 Sep 2026 16:37:27 -0500 (CDT) Subject: Re: Getting back on TRK00 A friend asked: > When do you find time to do all of this? During the mid-day hours when it's too hot to work outside. During the midnight hours when I can't get back to sleep. The last bit of relabling was an attempt to reduce the number of "magic number" constants used in the code (despite the copious detailed comments. The macro libraries supplied with the system only provide a fraction of the definitions of bits in the various registers (particularly the floppy disk controller subsystem). I made some supplemental libraries to fill in the gaps, but for anyone assembling the unmodified BIOS code, they're unlikely to have more than what was supplied by Davidge. (Actually, now that I think about it, everyone but me probably doesn't have any orginal Davidge-supplied materials. So, given the extreme similarity of the DSB-4000 with the CCS 2422, I copy-pasta'd the relevant symbol definitions from Martin Eberhard's "MBIOS" (as found on "deramp.com") into the bios source directly. Of course, there followed the usual rounds of assemble and compare with the reference binary (mostly to make sure I didn't have a finger slip and delete or add something accidentally. And then comparing it to the binaries generated by the Davidge 'MOVCPM.COM' for various memory sizes. Satisfied that it was working as intended, I set "jdbfix" to "true" and assembled again and patched it into the appropriate "CPMxx.BIN" image. Then I started messing the Mike Douglas' ("deramp.com") "MAKEMOV.COM". There was some confusion when it claimed the memory size wasn't in the filename. Turns out the first filename must be an image for a 20K or larger system. The second can be for any size (I built the minimum allowed 16K system). Once I had the custom "BMOVCPM.COM", I had it generate 16K and 20K systems to compare with my hand-patched ones. They weren't the same. But where they differed was in the system log-on message. The ones produced by "BMOVCPM.COM" had garbage where the memory size should be. It took some poking and patching, but I finally got it working. The relocator code "CPMOVE.COM" as de-fanged by Mike Douglas looks for the string "K CP/M 2.2" in the system image and expects to patch the two bytes before it with the system memory size. Trouble is, the Davidge-OEM version of CPMOVE.COM (which is the first 200h bytes of MOVCPM.COM") looks for "k CP/M Vers 2.2", so the replacement CPMOVE.COM doesn't find the string and leaves those bytes at whatever value the relocator set them to rather than ASCII decimal digits. I edited and reassembled "CPMOVE.COM" and patched it into "MAKEMOV.COM", but that didn't help. In fact, the corrected string was getting trashed. CPMOVE tries to get the most out of the data, so the search string is also used as the message string. MAKEMOV prompts for 2 additional lines for CPMOVE to display when it generates the system and it had some hard-coded offsets for where the custom message was to be inserted-- overwriting my corrected log-on message string. So, with "MAKEMOV.COM loaded in 'ZSID' and reading the source in another window, I found where it loaded the address of the custom message and bumped it up to where it needed to be. After that the resulting "BMOVCPM" generates system images that are identical to my hand-patched versions. ----- Date: Mon, 28 Sep 2026 15:18:30 -0500 (CDT) Subject: Re: Getting back on TRK00 Since "better" is the enemy of "good", I've declared victory and made an hysteric return to t3h 1nt4rw3bz: http://bobdbob.com/~jdbaker/ Under the "computers" page, you can find all the Davidge-related stuff I've been working on.