Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Building DOS-Compatible Hard Disks (pcjs.org)
2 points by ingve on Aug 10, 2023 | hide | past | favorite | 3 comments


About last paragraph/issue the situation with OS BPB OEM string has been historically very complex, there is an exhaustive article by jdebp about the matter:

http://jdebp.info/FGA/volume-boot-block-oem-name-field.html


Good to have your input here. That's some worthwhile information. I would estimate that further undocumented behaviors would need a bigger page yet.

I genrerally find the best bet is usually to use the DOS from Win98SE (with updated version of IO.SYS from 2001). It's quite advanced plus very backward-compatible at running older DOS programs.

Ideal to format all FAT32 that is accessible (non-GPT). FAT32 volumes on hard drives, floppies, USB devices, etc. Natively up to 32GB per partition and at 4 primary partitions or 3primary,1extended+logical(s) starting at locations on the hard drive up to 120GB and beyond. So you get "MSWIN4.1" OEM text rather than "MSDOS5.0" (or anything else) in your bootsector.

The DOS from WinME was crummier than Win98SE for the most part, it would format FAT32 up to 64GB but not very compatible with the rest of the world. Scandisk from WinME is the better choice for FAT32 though.

Caution: only allow one primary FAT partition to be unhidden per hard drive per reboot to DOS.

You'll need a modern disk-editor/partition-tool (like DMDE which has a DOS version) for things like easily changing the hidden/unhidden bit. And the active/inactive bit (boot flag). In the partition table. And for displaying the "OEM Name" for each bootsector in readable/editable form.

Label each volume uniquely descriptive and watch it as the DOS multi-partition hierarchy re-alphabetizes your volume letters upon reboot the way it is supposed to do, according to master/slave primary/logical order.


Yes, the DOS 7.1 (the one that comes with Windows 98) has also the capability (the actual IO.SYS or the bootsector code) to boot even if the IO.SYS and MSDOS.SYS are not the first files on the volume (unlike last "real" DOS 6.22).

In case, there is still bootpart (by Gilles Vollant) that can rewrite the root so that IO.SYS and MSDOS.SYS are first files:

https://www.winimage.com/bootpart.htm

To manage partition ID's, active and hidden status, etc, I would suggest instead grub4dos that has all the needed commands and of course a whole lot of (sometimes useful) booting capabilities, including the capability to boot a MS-DOS IO.SYS by directly chainloading it (i.e. bypassing the bootsector code, either the last 0.4.5c:

http://grub4dos.chenall.net/downloads/grub4dos-0.4.5c-2016-0...

or any more recent 0.4.6a version (legacy, not "for UEFI"):

https://github.com/chenall/grub4dos/releases

should be fine .

Of course in case of booting troubles you need to boot it from an external media.

The page by jdebp, as well as the article in the topic are all about "ancient" MS-DOS versions, they are very useful if you are trying reproducing the past, but they (fortunately) do not apply to latest DOS or NT systems, though there are still - here and there - a number of little quirks, even on NT based systems, only as a side note in some cases you need to disable the CHS checks in order to be able to boot NT/2K/XP (and possibly later):

https://clemens.endorphin.org/2007/12/removing-chs-based-acc...

http://reboot.pro/topic/8528-how-to-patch-fat32-boot-sector/...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: