• Please review our updated Terms and Rules here

86-DOS 0.11 Source Code Reconstruction

PorkyPiggy

Member
Joined
Jan 11, 2024
Messages
46
I have reached a significant milestone in my disassembly project for 86-DOS 0.11, and I am excited to create a dedicated thread for it. Some of you may remember my previous work on the DOS kernel; well, now I am pleased to announce that I have completed the full disassembly! Special thanks to Lucas for providing a disassembly of the 86-DOS 1.14 kernel in SCP ASM syntax and documenting the DPB structure of 86-DOS 0.11. Also, a shout-out to @RichCini for his assistance in deciphering some weird logic in the code.

This project aims to reconstruct the original source code written by Tim Paterson, and all disassemblies are binary-exact, so if you find bugs/mistakes in the code, please do not ask me to correct them. However, you are more than welcome to post about errors in code comments (and label names and etc.), and I will fix them ASAP.

Status
Disassembled components:
  • 86-DOS Kernel
  • COMMAND.COM
  • HEX2BIN.COM
  • SYS.COM
Components not yet disassembled:
  • ASM.COM (source code of later version in SCP syntax available)
  • CHESS.COM (not really a part of the OS)
  • EDLIN.COM
  • RDCPM.COM
  • TRANS.COM (source code of later version in SCP syntax available)
Next Steps
My plan is to fully disassemble the entire OS, including utilities. The next thing on my agenda is RDCPM, which shouldn't be too hard considering that I've done it before. After that, I'll probably tackle EDLIN, and then ASM and TRANS. I'm not sure if I really want to touch the CHESS game, because to me, it doesn't look like it's a part of the OS. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
"86-dos_0.11_src_v1.zip" contains the reconstructed .ASM source files and "86-dos_0.11_src_v1_160k_disk.zip" contains a 160K 86-DOS 0.x formatted disk image with the exact same files. The latter is for assembling the source files under 86-DOS 0.11 on an IBM PC, which can easily take hours due to the slowness of my port. It is highly recommended that you assemble these under 32-bit Windows (or DOS VM).

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v1_160k_disk.zip
    13.4 KB · Views: 6
  • 86-dos_0.11_src_v1.zip
    14 KB · Views: 6
Update
Finished the source reconstruction of RDCPM and EDLIN. Updated all previous disassemblies to align with SCP/Tim Paterson's coding style.

Status
Disassembled components:
  • 86-DOS Kernel
  • COMMAND.COM
  • EDLIN.COM
  • HEX2BIN.COM
  • RDCPM.COM
  • SYS.COM
Components not yet disassembled:
  • ASM.COM (source code of later version in SCP syntax available)
  • CHESS.COM (not really a part of the OS)
  • TRANS.COM (source code of later version in SCP syntax available)
Next Steps
Will disassemble ASM and TRANS next. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
"86-dos_0.11_src_v2.zip" contains the reconstructed .ASM source files and "86-dos_0.11_src_v2_160k_disk.zip" contains a 160K 86-DOS 0.x formatted disk image with the exact same files. The latter is for assembling the source files under 86-DOS 0.11 on an IBM PC, which can easily take hours due to the slowness of my port. It is highly recommended that you assemble these under 32-bit Windows (or DOS VM).

Edit: Forgot to mention that @RichCini helped with figuring out the CP/M disk reading logic of RDCPM.

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v2_160k_disk.zip
    17.2 KB · Views: 6
  • 86-dos_0.11_src_v2.zip
    18.9 KB · Views: 7
Last edited:
Is there a utility to get files in and out of your 86-DOS PC port disks ?

Larry G
Yes and no. For file extraction, Lucas modified TotalImage to handle 86-DOS 0.x formatted disks. According to what he told me in DMs, it can open disk images formatted by my 86-DOS ports - but I haven't verified it yet. You can also use my 86-DOS 1.x ports to copy files from 86-DOS 0.x formatted disks to 86-DOS 1.x formatted disks, and then use PC-DOS 0.9's CONVERT utility to transfer them to PC-DOS formatted disks.

For file insertion/modification, I wrote a converter to convert PC-DOS formatted disks to 86-DOS 0.x/1.x disks. I will clean it up and upload it soon.

Sincerely,
Pig
 
Larry -- if you're looking only for the source files, they're in the "src_v2" archive. For the binaries, you need to use the process Pig mentioned.
 
Thanks Rich. The PC-DOS CONVERT is a link in the chain I hadn't heard yet. I have a strange goal of getting 86-DOS running on 8" floppy
on either a PC or my Zenith Z-100. I have 8" running on both. They both can boot early MS-DOS. The Z-100 has the same WD1797 controller chip as Cromemco
which was an eye opener when 86-dos source code started showing up. Now with the recent work being done it's got my attention once again.

Larry G
 
The PC-DOS CONVERT is a link in the chain I hadn't heard yet.
The CONVERT utility belongs to PC-DOS "0.9" (a pre-release of PC-DOS 1.00 from late May 1981). Quick demo of copying files out of 86-DOS 0.x disks on the IBM PC:

1. Create a file using 86-DOS 0.11 on an 86-DOS 0.x disk.

Create File.png

2. Boot from 86-DOS 1.00, format a new disk in drive B and put the 86-DOS 0.x disk in drive A.
3. Copy the file(s) from drive A to drive B using 86-DOS 1.00.

Copy To 86-DOS 1.x Disk.png

4. Boot from PC-DOS 0.9, format a new disk, run CONVERT.
5. Put the freshly formatted disk in drive A and the 86-DOS 1.x disk in drive B.
6. Press a key to begin conversion. Disk in drive A will be in the PC-DOS/MS-DOS compatible 160K format after conversion.

Convert to PC-DOS Disk.png

I have a strange goal of getting 86-DOS running on 8" floppy
on either a PC or my Zenith Z-100. I have 8" running on both.
I can't help with getting it to run on the Z-100 but you can boot my 86-DOS ports on vanilla IBM PCs (with 5.25" drives). You will have to modify the DOS BIOS in order to make it boot on IBM PCs with 8" drives (I've customized 86-DOS to boot from 3.5" 1.44MB disks before, so 8" shouldn't be impossible).

Sincerely,
Pig
 
Is there copies of just the 86dos.sys binaries like v1.x ? ? I've got my Zenith Z-100 sourcecode assembled into an IO.SYS which should be able to interface
with an 86DOS.SYS 1.x . Right now I'm using what I think is similar to Paterson's 1.25 86DOS.SYS (just renamed to Z-DOS.SYS (which is what the Zenith bootloader looks for)
Paterson's source code he released in 2013 for SCP 86DOS 1.25 is missing a variable not declared MEMSTRT.FAT so it won't assemble.
86dos.JPG

Larry G
 
Only 86-DOS 1.10+ kernels are stored in 86DOS.SYS. For 86-DOS 0.x - 1.00, you have to use DEBUG or a hex/disk editor to extract it manually. MS-DOS 1.25 BIOS (IO.SYS) will not work with 86-DOS 0.x, and it is not guaranteed to work with 86-DOS 1.x. For 86-DOS 0.11, you can assemble my reconstructed source code to get you an 86DOS.COM.

Sincerely,
Pig
 
Update
Partially disassembled CHESS. @RichCini emailed Tim Paterson last week and Tim told us:
The Chess program was Sargon. We had it running on my Z80 computer in college ca. 1978. I used the source code translator to port it to DOS.

I managed to locate the source code of a Z80 port of Sargon (translated from 8080) and translated it to the 8086 using SCP's TRANS program. The translated Sargon source matches very well with the CHESS program, with the exception of the ATTACK routine and its subroutines, which appears to be Paterson's custom implementation. I do not know how to play chess, so I cannot understand the ATTACK logic and therefore I need someone to properly label and comment the ATTACK routine. I know Rich is currently working on it, but I don't mind more people helping out :).

Status
Disassembled components:
  • 86-DOS Kernel
  • CHESS.COM (ATTACK routine and subroutines not fully labelled and commented)
  • COMMAND.COM
  • EDLIN.COM
  • HEX2BIN.COM
  • RDCPM.COM
  • SYS.COM
Components not yet disassembled:
  • ASM.COM (source code of later version in SCP syntax available)
  • TRANS.COM (source code of later version in SCP syntax available)
Next Steps
Will disassemble ASM and TRANS next. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
"86-dos_0.11_src_v3.zip" contains the reconstructed .ASM source files and "86-dos_0.11_src_v3_160k_disk.zip" contains a 160K 86-DOS 0.x formatted disk image with the exact same files. The latter is for assembling the source files under 86-DOS 0.11 on an IBM PC, which can easily take hours due to the slowness of my port. It is highly recommended that you assemble these under 32-bit Windows (or DOS VM). Please note that the CHESS program source code is bigger than 64K.

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v3_160k_disk.zip
    33.1 KB · Views: 2
  • 86-dos_0.11_src_v3.zip
    35 KB · Views: 3
Update
Disassembled the original Cromemco 4FDC boot sector and DOS BIOS (also added Tarbell SD and DD switches). It is now possible to create a fully working copy of 86-DOS 0.11 based on the reconstructed source code.

Status
Disassembled components:
  • Boot Sector
  • DOS BIOS
  • 86-DOS Kernel
  • CHESS.COM (ATTACK routine and subroutines not fully labelled and commented)
  • COMMAND.COM
  • EDLIN.COM
  • HEX2BIN.COM
  • RDCPM.COM
  • SYS.COM
Components not yet disassembled:
  • ASM.COM (source code of later version in SCP syntax available)
  • TRANS.COM (source code of later version in SCP syntax available)
Next Steps
Will disassemble ASM and TRANS next. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
"86-dos_0.11_src_v4.zip" contains the reconstructed .ASM source files and "86-dos_0.11_src_v4_160k_disk.zip" contains a 160K 86-DOS 0.x formatted disk image with the exact same files. The latter is for assembling the source files under 86-DOS 0.11 on an IBM PC, which can easily take hours due to the slowness of my port. It is highly recommended that you assemble these under 32-bit Windows (or DOS VM). Please note that the CHESS program source code is bigger than 64K. "86-dos_0.11_src_v4_250.25k_disk.zip" contains an 8" 250.25K disk image of the source files.

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v4.zip
    39.1 KB · Views: 2
  • 86-dos_0.11_src_v4_250.25k_disk.zip
    76.2 KB · Views: 2
  • 86-dos_0.11_src_v4_160k_disk.zip
    36.3 KB · Views: 2
Update
Disassembled the TRANS utility. Now there is only 1 component left - ASM.

Status
Disassembled components:
  • Boot Sector
  • DOS BIOS
  • 86-DOS Kernel
  • CHESS.COM (ATTACK routine and subroutines not fully labelled and commented)
  • COMMAND.COM
  • EDLIN.COM
  • HEX2BIN.COM
  • RDCPM.COM
  • SYS.COM
  • TRANS.COM
Components not yet disassembled:
  • ASM.COM (source code of later version in SCP syntax available)
Next Steps
Will disassemble ASM next. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
"86-dos_0.11_src_v5.zip" contains the reconstructed .ASM source files and "86-dos_0.11_src_v5_160k_disk.zip" contains a 160K 86-DOS 0.x formatted disk image with the exact same files. The latter is for assembling the source files under 86-DOS 0.11 on an IBM PC, which can easily take hours due to the slowness of my port. It is highly recommended that you assemble these under 32-bit Windows (or DOS VM). Please note that the CHESS program source code is bigger than 64K. "86-dos_0.11_src_v5_250.25k_disk.zip" contains an 8" 250.25K disk image of the source files.

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v5_160k_disk.zip
    40.4 KB · Views: 3
  • 86-dos_0.11_src_v5_250.25k_disk.zip
    84.6 KB · Views: 3
  • 86-dos_0.11_src_v5.zip
    43.7 KB · Views: 3
Update
Fixed bugs in the boot sector and DOS BIOS disassembly. Working Tarbell DD copies of 86-DOS 0.11 can now be created using the reconstructed source code.

Status
Disassembled components:
  • Boot Sector
  • DOS BIOS
  • 86-DOS Kernel
  • CHESS.COM (ATTACK routine and subroutines not fully labelled and commented)
  • COMMAND.COM
  • EDLIN.COM
  • HEX2BIN.COM
  • RDCPM.COM
  • SYS.COM
  • TRANS.COM
Components not yet disassembled:
  • ASM.COM (source code of later version in SCP syntax available)
Next Steps
Will disassemble ASM next. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
"86-dos_0.11_src_v6.zip" contains the reconstructed .ASM source files and "86-dos_0.11_src_v6_160k_disk.zip" contains a 160K 86-DOS 0.x formatted disk image with the exact same files. The latter is for assembling the source files under 86-DOS 0.11 on an IBM PC, which can easily take hours due to the slowness of my port. It is highly recommended that you assemble these under 32-bit Windows (or DOS VM). Please note that the CHESS program source code is bigger than 64K. "86-dos_0.11_src_v6_250.25k_disk.zip" contains an 8" 250.25K disk image of the source files.

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v6_250.25k_disk.zip
    84.7 KB · Views: 4
  • 86-dos_0.11_src_v6_160k_disk.zip
    40.4 KB · Views: 5
  • 86-dos_0.11_src_v6.zip
    43.7 KB · Views: 5
Big Update
This is a very significant update; essentially, the disassembly is 100% complete, and there's only some labelling and commenting work left. I've also applied some style changes, once again, to match Paterson's code style. All components can now be built from the source code, and all binaries built from the reconstructed source will match the originals. I have completely migrated this project to GitHub, because it is easier to track changes than having 200 different folders on my desktop. Additionally, I am migrating the build environment from 86-DOS 0.11 itself to Cromemco CDOS (a CP/M-like operating system) because that is the operating system Tim Paterson used to build early versions of 86-DOS. The extension of the source files will be changed from .ASM to .A86 as well; however, this change will not be implemented for the GitHub repository anytime soon because it does not provide syntax highlighting for .A86 files.

CP/M Toolchain
To build 86-DOS 0.11 from CDOS or CP/M, we need a copy of the SCP 8086 Cross Assembler (ASM86), which no longer exists. However, since I have disassembled ASM.COM, and the original source code was translated from Z80, I wrote a translator to translate the 8086 source back to Z80. It was successful, and now we have a reconstructed ASM86 assembler that runs under Z80.

I've also developed a DOSGEN tool to transfer the system files from CP/M disks to the system area of DOS disks, similar to SYSGEN. It can optionally create a temporary disk by copying a temporary build of the system, which includes a special BIOS and command interpreter. Long story short, 86-DOS requires loading COMMAND.COM from the filesystem; however, CP/M cannot handle FAT disks. Therefore, we need to use this temporary system to copy the actual COMMAND.COM file to a DOS disk.

For more details and downloads, please visit here.

Status
Disassembled components:
  • Boot Sector
  • DOS BIOS
  • 86-DOS Kernel
  • ASM.COM (disassembly 100% done, labelling and commenting ~46% done)
  • CHESS.COM
  • COMMAND.COM
  • EDLIN.COM
  • HEX2BIN.COM
  • RDCPM.COM
  • SYS.COM
  • TRANS.COM
Next Steps
Will finish labelling and commenting ASM next. I still need help, so feel free to join in if you have experience reverse engineering DOS binaries!

Attachments
Since I am migrating the build environment to CDOS, the source code will no longer be provided on 160K IBM PC disks and 250.25K 86-DOS disks. Only .ZIP files and CDOS 8" SSSD images will be provided from now on. "86-dos_0.11_src_v7.zip" contains all of the source files, and "86-dos_0.11_src_v7_disk_image.zip" contains an 8" SSSD CDOS disk image with the source files on it.

Once again, special thanks to @RichCini for helping out and testing.

Sincerely,
Pig
 

Attachments

  • 86-dos_0.11_src_v7.zip
    59.9 KB · Views: 4
  • 86-dos_0.11_src_v7_disk_image.zip
    60.6 KB · Views: 5
Cool. Your asm86.com seems to work fine under cpm80. It's producing byte accurate code.
I had tried the DRI asm86.com before but the syntax had differences.

Larry G
 
Back
Top