I don't know that one has been written, but it looks like it should be pretty easy to write one. If we look at the code for DOS 4.0 on GitHub, the boot sector has code like this:
MOV DI,BX
MOV CX,11
MOV SI,OFFSET BIO ; point to "ibmbio com"
REPZ CMPSB ; see if the same
JNZ CKERR ; if not there advise the user
;
; Found the BIOS. Check the second directory entry.
;
LEA DI,[BX+20h]
MOV SI,OFFSET DOS ; point to "ibmdos com"
MOV CX,11
REPZ CMPSB
JZ DoLoad
To make it work for either, we'd basically duplicate this code, but in the duplicate modify the data to search for "IO SYS"
and "MSDOS SYS"
(which are already present in the code, and the PC-DOS/MS-DOS version selected with an ifdef
). At the jnz CKERR
, you'd jump to the second set of code to search for the second set of entries. And if either pair matches, do the jz DoLoad
. That adds around 30 bytes of code and 22 bytes of data for the directory entries. I haven't assembled the existing boot sector to see whether there's ~55 bytes free to do this the easy way, or whether you'd have to get tricky to make it fit. There is a comment further down in the code saying there's not room for a full 32-bit division though, so fitting this change in could be non-trivial.
Reference
https://github.com/microsoft/MS-DOS/blob/main/v4.0/src/BOOT/MSBOOT.ASM
[lines 256-268]
boot protocol msdos6
thenif (! rc) then q
to try booting a certain protocol. However, like grub this requires installing the entire debugger (> 80 KiB in a file). Unlike grub it runs in 8086 Mode throughout. @Justme I documented the MS-DOS v6 protocol in the lDOS boot manual, basically you read msload (first 1.5 KiB of io.sys) to 00700h, enter it at 70h:0, pass the two directory entries at 00500h and 00520h, dl = unit, +BPB, DPT.