VOGONS


First post, by eM-!3

User metadata
Rank Newbie
Rank
Newbie

I have a disk with FreeDOS ("FrankenDOS" really) installed. Let say that I boot into FreeDOS. I don't want to install DOS to a new partition. If it's possible I would prefer to just run it, boot DR-DOS from a file. I know it's possible to boot Linux that way. What tools should I use: Grub4DOS, Syslinux?

Reply 1 of 11, by elszgensa

User metadata
Rank Member
Rank
Member

Linux works because the kernel is much more advanced and knows how to pretend like that file-inside-a-partition is yet another partition. DOS can't do that. Well, strictly speaking I only know for sure that MS-DOS can't, maaaaaaaybe FreeDOS (being much more modern and having picked up a new feature or two along the way) added it but I highly doubt it... and even if so, that'd still only allow you to put FreeDOS "inside of" MS-DOS, not the other way round.

Don't waste time on this. Just bite the bullet and repartition.

edit: Oh I just noticed you want DR- instead of MS-DOS. That takes me from 100% sure down to 99%, but my point still stands.

Reply 2 of 11, by eM-!3

User metadata
Rank Newbie
Rank
Newbie

DOS version is not important here. Not much difference. I wouldn't mind if it was possible to boot floppy disk image as long as I would be able to use same FAT32 partition without rebooting. Repartitioning is not considered here as I can just run a batch file with sys c:, copy this, delete that but it requires me to reboot. Few years ago there was a reboot.pro forum but it's down and I'm not sure if Vogons is the right place to ask such an advanced question.

Reply 3 of 11, by eM-!3

User metadata
Rank Newbie
Rank
Newbie

OK, unless someone knows how to do it properly I think elszgensa was right. I can run grub.exe from grub4dos but I was forced to change my config so it won't load any TSR. It makes my plan pointless.

What I wanted to do? I wanted to have one directory synchronised:
1. Dosbox
2. DOS Virtual machine (86Box, Virtualbox) in VHDX disk
3. Partition on a DOS old thin client.

I use FreeDOS kernel and it works 99% well for me if it wasn't for one issue. It's not compatible with Windows 3.11. I can run it with xmgr.sys and by executing "win /s" but MS Office refuse to work. I have to use different DOS to run it properly. Any kind of DOS. But with other DOSes my config.sys skills are not good enough to get all other software/games/sbemu working. I think I will leave as it is for now with batch files to switch into DR-DOS and reboot into Windows. In the future I will make additional partition for Windows 3.11 and hopefully after another 30 years FreeDOS will finaly release a kernel that will allow to run Windows 3.11.

Reply 4 of 11, by kmeaw

User metadata
Rank Member
Rank
Member

You can do that with Grub4DOS - map your DR-DOS image to a file, then chainload into it.
Or (I haven't tried this one) you can try to use memdisk from syslinux with loadlin - use loadlin to boot memdisk, which would boot from the image.

Some versions of DOS are capable of chainloading into other DOS - MS-DOS 7 from Windows 95 has a "Previous version of MS-DOS" item in the F8 boot menu, which renames IO.SYS/MSDOS.SYS/COMAMND.COM to WINBOOT.SYS/MSDOS.W40/COMMAND.W40 and IO.DOS/MSDOS.DOS/COMMAND.DOS to IO.SYS/MSDOS.SYS/COMMAND.SYS, boots into other DOS, then renames everything back on reboot.

Reply 5 of 11, by elszgensa

User metadata
Rank Member
Rank
Member
kmeaw wrote on 2024-12-01, 00:19:

You can do that with Grub4DOS - map your DR-DOS image to a file, then chainload into it.
Or (I haven't tried this one) you can try to use memdisk from syslinux with loadlin - use loadlin to boot memdisk, which would boot from the image.

Those are doable I think, but unlike the Linux thing from the first post, you'll lose any changes to that image on reboot since it's basically a prepopulated ramdisk - you're not really "booting from a file" here but from a(n ephemeral in-memory only) copy of it. No idea if that's something OP can work with. Maybe watch for changes and regenerate the actual on-disk image before shutdown. Seems a bit inconvenient to me though, and a lot more work than just repartitioning. But what would I know about this, this is an advanced topic.

Reply 6 of 11, by kmeaw

User metadata
Rank Member
Rank
Member
elszgensa wrote on 2024-12-01, 01:16:

Those are doable I think, but unlike the Linux thing from the first post, you'll lose any changes to that image on reboot since it's basically a prepopulated ramdisk - you're not really "booting from a file" here but from a(n ephemeral in-memory only) copy of it. No idea if that's something OP can work with. Maybe watch for changes and regenerate the actual on-disk image before shutdown.

You can avoid this issue by having a bare minimum of boot files that you aren't going to change (like IO.SYS or COMMAND.COM) inside that ephemeral copy and keeping all the valuable state (like application and user data) on the same disk where FreeDOS is installed. If there is a name conflict (FreeDOS and other DOS are using the same file name), either a FreeDOS-specific name can be used (FDCONFIG.SYS instead of CONFIG.SYS), or that name can be changed with a hex editor.

My last option that I mentioned can be also implemented with GRUB4DOS or Syslinux - both are capable of chainloading from a disk but with a boot sector loaded from elsewhere. They can even boot some DOS kernels from IO.SYS directly without relying on a boot sector.

Reply 7 of 11, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
eM-!3 wrote on 2024-11-30, 20:10:

I have a disk with FreeDOS ("FrankenDOS" really) installed. Let say that I boot into FreeDOS. I don't want to install DOS to a new partition. If it's possible I would prefer to just run it, boot DR-DOS from a file. I know it's possible to boot Linux that way. What tools should I use: Grub4DOS, Syslinux?

Current GRUB4DOS versions can boot MS-DOS kernels (IO.SYS) via chainloader directive out-of-box. Been using this to boot MS-DOS 7.10 (Win98SE) and everything's good so far.

If you're interested in booting other DOS kernels like Enhanced DR-DOS you can have a look at ecm's lDebug which has a boot mode that can be used for the purpose.

You can either install a boot sector directly to hard disk to use lDebug as a starting point to boot other kernels, or write the boot sector to file that you can chainload with GRUB4DOS later on, if you prefer booting directly to FreeDOS by default.

NOTE: GRUB4DOS binary (grub.exe) can be loaded either from CONFIG.SYS (DEVICE, or the FreeDOS-specific INSTALL directive), or AUTOEXEC.BAT. There are some differences, however.
- DEVICE directives are done earliest. Use this directive if you want that boot option to go directly to GRUB4DOS without doing any additional configuration.
- For FreeDOS, INSTALL directives are called after DEVICE directives but before AUTOEXEC.BAT though there's no noticeable difference in mechanism -- Using INSTALL directive is the same as executing the binary in AUTOEXEC.BAT. If you need to set your system up for some reasons (e.g. modifying some system registers, setting up ISA PnP hardware early on) before actually going to GRUB4DOS, this way should be used.

Reply 8 of 11, by elszgensa

User metadata
Rank Member
Rank
Member

Alright, one good night's sleep later, I see we have two different discussions going on concurrently.

- One is "the entire OS installation, with all its files, lives contained inside a single file (hdd- or floppy image) within an existing file system, and that file somehow gets booted into". Which is what I thought OP meant by "Linux does that", because I've seen it done multiple times. For example it was a popular way to do it on the Xbox.

- The other is "we have loose files within the single hdd partition; there may be an arbitrary amount (but pretty much guaranteed to be >1) of them, there may be conflicts (like file names, or on disk positioning (because of hard coded offsets in the boot chain)) to solve, and we somehow chainload one of those and roll from there". Which is also something Linux can do ("loadlin" a kernel, from a single file, but then you do not yet have a rootfs, which can't live on a FAT file system) so this may be another interpretation of OP's post, but it's an entirely different can of worms.

Seems to me like OP might want to clarify which direction to go.

Reply 9 of 11, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie
eM-!3 wrote on 2024-11-30, 20:10:

I have a disk with FreeDOS ("FrankenDOS" really) installed. Let say that I boot into FreeDOS. I don't want to install DOS to a new partition. If it's possible I would prefer to just run it, boot DR-DOS from a file. I know it's possible to boot Linux that way. What tools should I use: Grub4DOS, Syslinux?

What you want is grub/syslinux, with memdisk.

https://wiki.syslinux.org/wiki/index.php?title=MEMDISK

This allows booting of a ram backed disk image, and allows for a very extensive list of possible boot images. (For example, a cdrom with multiple configurations or windows versions. Yes, win9x is fully bootable this way.)

This can be a hyper-minimal bootable floppy image, with just the dos kernel, command interpreter, and autoexec.bat/config.sys for that dos version, and appropriate PATH variables set for each, pointing to a universal FAT formatted volume serving as the C drive.

Eg, DR-DOS and MSDOS have their own 'dos' folders set up, and being a real hardware drive, is persistently writable. A ramdisk based A drive hosts the kernel and command interpreter.

It can also supply a whole bootable hard disk image, if that's your poison.

Reply 10 of 11, by eM-!3

User metadata
Rank Newbie
Rank
Newbie

Thanks for all your answers! It doesn't have to be (E)DR-DOS. I just want to get things working that's all I care about.

Right now I already managed to: boot FreeDOS without any drivers --> run GRUB4DOS --> run MS-DOS boot disk with IO.SYS --> run ramdisk from my own setup --> run Windows 3.11. It works. That's all I need.

Also I was able to boot other DOSes with the help of memdisk but in the end I will stay with MS-DOS option as it's already working and it's easier to customize it when I can write to floppy image. IDebug option is interesting but as I already have a working solution I don't think I will use it.

This is my menu.1st code:

title msdos8
find --set-root --ignore-floppies --ignore-cd /windows/grub4dos/msdos8.img
map /windows/grub4dos/msdos8.img (fd0)
map --hook
chainloader (fd0)/io.sys

Reply 11 of 11, by eM-!3

User metadata
Rank Newbie
Rank
Newbie

It worked well but in the end I've abandoned booting with Grub4DOS. Why? I've managed to get Windows 3.11 working with FreeDOS. It's not perfect as I have to run it in standard mode "win.com /s" but it's good enough for me and I had to use standard mode in floppy boot as well. Why it didn't work before? I didn't have fakeshar.com and I was using noshare.com instead. This single change allowed me to use MS Office in FreeDOS based operating system. On a side note I will repeat that I have to use xmgr.sys instead of himemx to get Windows working.