VOGONS


First post, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie

UPDATE: Thanks to Grzyb's advice, I've confirmed it's indeed possible to make some DOS kernels read an external, off-image CONFIG.SYS file. For FreeDOS, you can simply edit the source code to add your own CONFIG.SYS path, while for others, such as MS-DOS, some hex-editing would be needed. Not all DOS kernels can be modified to work this way, however.

AUTOEXEC.BAT can be trivially chained in most DOS versions. FreeDOS (as well as some others) allows specifying your own AUTOEXEC.BAT to load from CONFIG.SYS via SHELL directive, though you can always put a dummy AUTOEXEC.BAT on-image that in turn calls your own off-image one, to avoid using SHELL directive if necessary, since the directive itself, as well as the command interpreter (COMMAND.COM), may vary a lot across different DOS versions. Note that you'll need to explicitly do a C: at the end of AUTOEXEC.BAT in order to make the command prompt point to C: instead of A:.

Generally speaking, this modding is mostly useful for those who want to boot a DOS kernel from BIOS flash using coreboot or ROMOS, as it allows one to customize the system configuration without having to modify the ROM afterwards, since flashing ROM is a risky and expensive task.

-- Original Post --

I don't know if anyone else has asked or tried to achieve this before.

The thing is, I'm interested in creating some DOS floppy images that contains only the kernel itself and a dummy CONFIG/AUTOEXEC to direct the system to load configurations and drivers on the first accessible hard disk partition (C:), so that anything else could be placed and configured off-image. The images themselves could then be put in a place normally inaccessible by DOS/Windows as they would be loaded through boot managers like GRUB, and can remain unchanged and read-only.

I wonder if some DOS variants ever implemented such a thing in the CONFIG.SYS syntax, while I am aware that the COMMAND interpreter of some DOS variants do have arguments to specify your own AUTOEXEC.BAT (through SHELL in CONFIG.SYS). I did google about this before, but I found nothing about directing DOS to continue reading configuration from a different CONFIG.SYS file elsewhere, so I'm afraid this is unlikely.

This is mainly for dealing with issues about multi-booting different DOS variants, as I noticed that some DOS variants, namely MS-DOS and ROM-DOS, cannot coexist on a FAT32 partition. Installing one will surely break the booting of the other.

If chaining CONFIG is really not that possible... I can always build the DOS floppy image to contain all the CONFIG/AUTOEXEC configurations (and respective programs) on-image, just that the image would have to be changed more frequently as I add or update configurations, and there would always be a risk for the image to end up broken (unbootable) at some point if I'm not careful...

Last edited by LSS10999 on 2023-02-19, 04:14. Edited 1 time in total.

Reply 1 of 8, by Disruptor

User metadata
Rank Oldbie
Rank
Oldbie

I don't think this is possible with your config.syss.
So your floppy still need a full CONFIG.SYS
Be sure to add these lines to your autoexec.bat
C:
SET COMSPEC=C:\DOS500\COMMAND.COM
PATH=C:\DOS500
CALL C:\AUTO.BAT

Reply 3 of 8, by Grzyb

User metadata
Rank Oldbie
Rank
Oldbie

In PC DOS/MS-DOS there's no official way.

But it should be possible to patch IBMBIO.COM/IO.SYS, replacing the string "\CONFIG.SYS" with "C:\CONF.SYS"...

Żywotwór planetarny, jego gnijące błoto, jest świtem egzystencji, fazą wstępną, i wyłoni się z krwawych ciastomózgowych miedź miłująca...

Reply 4 of 8, by Disruptor

User metadata
Rank Oldbie
Rank
Oldbie
Grzyb wrote on 2023-01-25, 09:35:

In PC DOS/MS-DOS there's no official way.

But it should be possible to patch IBMBIO.COM/IO.SYS, replacing the string "\CONFIG.SYS" with "C:\CONF.SYS"...

HAHA, but do not spread them via format /s or sys

Reply 5 of 8, by Gmlb256

User metadata
Rank l33t
Rank
l33t

It is possible with FreeDOS by adding the MetaKern bootloader for coexistence. If FDCONFIG.SYS file exists, FreeDOS will read it instead of CONFIG.SYS.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 6 of 8, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
elszgensa wrote on 2023-01-25, 09:30:

Wikipedia mentions DR-DOS 6.0 and up supporting this.

Some DOSes do have a CONFIG.SYS name that take precedence, like FreeDOS' FDCONFIG.SYS and PTS-DOS 32's CONFIG.PTS, as well as the examples you mentioned.

But in general that's more about the files on the same drive. It did mention about disk compression software, but I'm not really sure about the details.

Gmlb256 wrote on 2023-01-25, 12:35:

It is possible with FreeDOS by adding the MetaKern bootloader for coexistence. If FDCONFIG.SYS file exists, FreeDOS will read it instead of CONFIG.SYS.

I'll take a look at the METAKERN, if that can help with the DOS multibooting problems on hard disks. Don't know if METAKERN can be chainloaded by other loaders such as GRUB4DOS or NTLDR/BOOTMGR, so that I can still use my usual boot manager to load METAKERN and then let it boot the DOS kernel of my choice.

GRUB4DOS, on the other hand, can only boot FreeDOS directly. For other DOSes I have to use a boot sector dump with NTLDR/BOOTMGR. Direct booting doesn't work, even with GRUB4DOS' "--msdos" parameter.

Grzyb wrote on 2023-01-25, 09:35:

In PC DOS/MS-DOS there's no official way.

But it should be possible to patch IBMBIO.COM/IO.SYS, replacing the string "\CONFIG.SYS" with "C:\CONF.SYS"...

Hmmm... I think I can experiment with this one, using a VM. Will give this a try.

Reply 7 of 8, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
Grzyb wrote on 2023-01-25, 09:35:

But it should be possible to patch IBMBIO.COM/IO.SYS, replacing the string "\CONFIG.SYS" with "C:\CONF.SYS"...

Did an experiment with FreeDOS' KERNEL.SYS and can confirm this trick might really be possible. Maybe I can also try this with other kernels using hex editors...

Modified this particular line to point to a CONFIG file on my local disk, say, C:\FLCONFIG.SYS. (Technically you can simply modify it to just point to C:\FDCONFIG.SYS, but I intentionally chose a different filename just to be sure that it's indeed booting from the floppy and reading the right files).

Made a simple floppy image containing only COMMAND.COM and KERNEL.SYS from a vanilla FreeDOS install via SYS command, and replaced the KERNEL.SYS with the one I compiled, and it worked. The floppy proceeded to load the FLCONFIG.SYS file on C: (which is a copy of FDCONFIG.SYS with some changes so that I could know it's indeed reading the right file), and then read the AUTOEXEC file specified by the SHELL/SHELLHIGH directives.

There's a catch, though. After the boot process finished processing the configuration files, the command interpreter returns to A:, so I need to manually bring it to C: from the specified AUTOEXEC file.

EDIT: It seems FreeDOS kernel left the configFile part reserved (empty), the FDCONFIG.SYS is simply an alternative before finally falling back to old CONFIG.SYS. Therefore, the kernel can still boot to the default FDCONFIG.SYS if the config file I specified doesn't exist on the local disk. Maybe I can consider keeping a subset of utilities as well as fallback configuration files on-image just in case.

EDIT 2: Didn't really test what will happen to SYS or FORMAT /S in such scenarios, though by putting components vital to booting off-disk, these commands are no longer relevant.

EDIT 3: Managed to get the trick working on a MS-DOS 8.0 (WinME) IO.SYS as well, though I need to use a tool called IO8DCOMP to decompress it in order to modify it. Theoretically this should work for MS-DOS 7.1 as well assume the kernel is not compressed.

However, I kinda hit a wall with PTS-DOS 32 as PTSDOS.SYS doesn't contain the CONFIG.SYS string, but I found mentions of UPX. However, it seems the UPX version I installed on my Linux host doesn't seem to be able to decompress it. The PTSDOS.SYS binary also doesn't appear to have the correct MZ header.

EDIT 4: EDR-DOS can also work after modifying DRBIO.SYS. However, I cannot specify my own AUTOEXEC through the SHELL directive. It's possible that EDR-DOS doesn't understand SHELL. As such, I have to create a dummy AUTOEXEC.BAT on image that will in turn call a predefined custom AUTOEXEC file on drive C to achieve my goal.

EDIT 5: Tried modifying the string in ROM-DOS.SYS (IBMBIO.COM) from ROM-DOS 7.1, but this time it doesn't seem to work. The specified CONFIG file on my local disk wasn't loaded. I recall having modified the kernel file before, though that time was simply rename the CONFIG file to something different on the boot drive (not explicitly C:), and that worked. Probably ROM-DOS can't really access other drives at this phase.

EDIT 6: Just tested loading the created images with GRUB4DOS on physical PC. MS-DOS works and booted using specified CONFIG file on local disk, but for some reasons EDR-DOS doesn't. Maybe my physical PC is too new, since the image was already tested working on VM (which simulates a complaint environment). Additionally, I noticed some catches with certain TSRs that are hardcoded to look for files on the boot partition instead of the partition where the TSR itself resides, and these probably need to be patched as well or they won't cooperate properly unless I keep a copy of the files they want on-image so long as I still have room for them.

Last edited by LSS10999 on 2023-01-27, 15:49. Edited 7 times in total.

Reply 8 of 8, by Vic Zarratt

User metadata
Rank Member
Rank
Member

is anyone on vogons familliar with steven patersons boot cds for various iterations of dos? I could be wrong, but the pc-dos7 one i thought used somekind of boot image - i'm likely wrong

I manage a pot-pourri of video matter...