Compiling MS-DOS 4.0 from DOS 4.0, on a PS/2!

have patience. It does work. Even booting from the SPOCK SCSI CARD which all the other DOS4 images all failed.

The best way for a native build is the zip in the releases.

Release Now can boot from hard disk! ยท neozeed/dos400 (github.com)

With a 16Mhz 80386 it took 70 minutes. I just formatted a blank image on the gotek, copied IO.SYS, MSDOS.SYS and COMMAND.COM, then rebooted. went back to the compiled DOS 4, and re-formatted the floppy as a system disk so the attributes are set. (DOS 5 lets you change system files), and yeah. It can be done!

Let me spell out the steps, in this case I’m going to use Windows 10. I use the git from the WSL (Windows subsystem for Linux) I have DOSBox mount c:\dos as my c: drive . ZIP/UNZIP are Info-ZIP versions, you MUST have the Win32 native version!

- md \dos
- md \dos\temp
- wsl git clone https://github.com/microsoft/MS-DOS
- cd MS-DOS\v4.0
- zip -r \dos\temp\src.zip src\*.*
- cd \dos
- unzip -a -LL temp\src.zip
- start dosbox
- cd \src
- edit setenv.bat to reflect the paths:
  set BAKROOT=c:
  set LIB=%BAKROOT%\src\tools\bld\lib
  set INCLUDE=%BAKROOT%\src\tools\bld\inc
  set PATH=%PATH%;%BAKROOT%\src\tools
- setenv
- nmake
it will then fail in mapper on getmsg.asm change the 3 chars to a '-'
- nmake
- cd ..
- nmake

It will then fail building select

- edit select2.asm
- edit usa.inf
- nmake
- cd ..
- nmake

and now it’ll be done compiling.

continuing from dosbox, you need a 1.44mb fat formatted disk image somedos144.img . I used a dos 6.22 diskette, it needs the bootsector already in place to load io.sys/msdos.sys

- cd \src
- md bin
- cpy bin
- imgmount a somedos144.img -t floppy
- a:
- del *.*
- copy c:\src\bin\io.sys
- copy c:\src\bin\msdos.sys
- copy c:\src\bin\http://command.com
- boot -l a:

And now I’ve booted MS-DOS 4.00 from within DOBOX!

Also as interest to most people there is a bug in msload.asm, where DOS 4.0 won’t boot on a lot of machines, from VMware, Qemu and even my PS/2. It’s a small fix to the IO.SYS initial stack being too small. Props to Michal Necasek for the fix!

For further guidance here is a video spelling it all out:

22 thoughts on “Compiling MS-DOS 4.0 from DOS 4.0, on a PS/2!

  1. Is it really Microsoft’s love affair with Linux? All that remains is to make the Windows source code available soon, and the Linux desktop may cease to exist. This seems like an old “if you can’t beat your enemy, join him” tactic.

    • That would be nice! Though it would require heavy understanding of both PC hardware and of how the MS-DOS kernel itself works on a the deepest of levels so don’t expect it tomorrow.

  2. Not tomorrow , but if there is the source code under some similar license to gpl or compatible with it , is expected(or maybe not) there is no much in the dos to be expected to be developed

  3. Neozeed i was viewing your GitHub and you have himem.sys sources. Can you add It to dos 4.0 source code in order to compile the complete set for dos40? I know it’s missing dosshell but at least IS far more complete with the bit missing of himem.sys.

  4. I think there was no problem at all. As i was thinking why IBM did not release sources for OS/2.
    That was an is a shame.

Leave a Reply