VOGONS


First post, by GigAHerZ

User metadata
Rank Oldbie
Rank
Oldbie

I have a freedos based "ultimate boot floppy", but for certain cases i would need to prepare machine's hard drive with MS-DOS system files. But i have been unable to achieve that.

I've tried copying MSDOS.SYS, IO.SYS and COMMAND.COM on a freshly formatted HDD, and then tried both FDISK (latest version of the same present in freedos) and GDISK to write the MBR, but seems like something's still missing.

One simple case would be Win98 installer - It will not run if machine is booted from FreeDOS. But if i would have the ability to format and prepare the hdd with DOS 5, 6, 7 system files as a bootable drive (+copy the win98 installer to hdd, while at it) i would be able to reboot the machine into proper MS-DOS and start the Windows installation.

Any ideas how could i prepare HDD in a FreeDOS session with MS-DOS system files as a bootable drive?

"640K ought to be enough for anybody." - And i intend to get every last bit out of it even after loading every damn driver!
A little about software engineering: https://byteaether.github.io/

Reply 1 of 5, by thp

User metadata
Rank Member
Rank
Member

In order for it to boot, you need to have:

- A bootable MBR installed on the disk itself (fdisk /mbr)
- The partition marked as "active" in the partition table (fdisk)
- The partition with a volume boot record and the system files in the right locations (sys c:)

It's not enough to just copy the files onto the partition, they also have to be in a specific location at the disk and FAT. To quote Wikipedia:

Due to restrictions in the implementation of the boot loaders in the boot sector and DOS' IO system, these two files must reside in the first two directory entries and be stored at the beginning of the data area under MS-DOS and PC DOS.

Reply 2 of 5, by GigAHerZ

User metadata
Rank Oldbie
Rank
Oldbie
thp wrote on 2024-10-03, 14:03:
In order for it to boot, you need to have: […]
Show full quote

In order for it to boot, you need to have:

- A bootable MBR installed on the disk itself (fdisk /mbr)
- The partition marked as "active" in the partition table (fdisk)
- The partition with a volume boot record and the system files in the right locations (sys c:)

It's not enough to just copy the files onto the partition, they also have to be in a specific location at the disk and FAT. To quote Wikipedia:

Due to restrictions in the implementation of the boot loaders in the boot sector and DOS' IO system, these two files must reside in the first two directory entries and be stored at the beginning of the data area under MS-DOS and PC DOS.

Forgot to mention, that partition is marked as active.

So i've done all this. Doesn't work.

How to "position" the files into proper directory entries?

"640K ought to be enough for anybody." - And i intend to get every last bit out of it even after loading every damn driver!
A little about software engineering: https://byteaether.github.io/

Reply 3 of 5, by thp

User metadata
Rank Member
Rank
Member
GigAHerZ wrote on 2024-10-03, 14:06:
Forgot to mention, that partition is marked as active. […]
Show full quote
thp wrote on 2024-10-03, 14:03:
In order for it to boot, you need to have: […]
Show full quote

In order for it to boot, you need to have:

- A bootable MBR installed on the disk itself (fdisk /mbr)
- The partition marked as "active" in the partition table (fdisk)
- The partition with a volume boot record and the system files in the right locations (sys c:)

It's not enough to just copy the files onto the partition, they also have to be in a specific location at the disk and FAT. To quote Wikipedia:

Due to restrictions in the implementation of the boot loaders in the boot sector and DOS' IO system, these two files must reside in the first two directory entries and be stored at the beginning of the data area under MS-DOS and PC DOS.

Forgot to mention, that partition is marked as active.

So i've done all this. Doesn't work.

How to "position" the files into proper directory entries?

The "sys" utility takes care of this. It's included in MS-DOS and FreeDOS.

FreeDOS documentation: https://help.fdos.org/en/hhstndrd/base/sys.htm

I think you might need to use the MS-DOS "sys" for writing the MS-DOS boot files, and the FreeDOS "sys" for writing the FreeDOS files.

It does some low level stuff to put it in the right location (the reason why this restriction is in place is because it makes the VBR's life a little bit easier (and it's just got space for 512 bytes), it doesn't need to fully understand/parse FAT):

https://github.com/FDOS/kernel/blob/master/sys/sys.c

It does seem like FreeDOS sys might have support for writing MS-DOS system files, but not sure if that's built like that by default.

Reply 4 of 5, by GigAHerZ

User metadata
Rank Oldbie
Rank
Oldbie
thp wrote on 2024-10-03, 14:28:
The "sys" utility takes care of this. It's included in MS-DOS and FreeDOS. […]
Show full quote
GigAHerZ wrote on 2024-10-03, 14:06:
Forgot to mention, that partition is marked as active. […]
Show full quote
thp wrote on 2024-10-03, 14:03:
In order for it to boot, you need to have: […]
Show full quote

In order for it to boot, you need to have:

- A bootable MBR installed on the disk itself (fdisk /mbr)
- The partition marked as "active" in the partition table (fdisk)
- The partition with a volume boot record and the system files in the right locations (sys c:)

It's not enough to just copy the files onto the partition, they also have to be in a specific location at the disk and FAT. To quote Wikipedia:

Forgot to mention, that partition is marked as active.

So i've done all this. Doesn't work.

How to "position" the files into proper directory entries?

The "sys" utility takes care of this. It's included in MS-DOS and FreeDOS.

FreeDOS documentation: https://help.fdos.org/en/hhstndrd/base/sys.htm

I think you might need to use the MS-DOS "sys" for writing the MS-DOS boot files, and the FreeDOS "sys" for writing the FreeDOS files.

It does some low level stuff to put it in the right location (the reason why this restriction is in place is because it makes the VBR's life a little bit easier (and it's just got space for 512 bytes), it doesn't need to fully understand/parse FAT):

https://github.com/FDOS/kernel/blob/master/sys/sys.c

It does seem like FreeDOS sys might have support for writing MS-DOS system files, but not sure if that's built like that by default.

I've tried that. Doesn't work.

Freedos sys on floppy copies the freedos system files.
Freedos sys when executed while being in C: drive with copied MS-DOS files complains about missing KERNEL.SYS.
MS-DOS sys on floppy complains about wrong dos version.
MS-DOS on C: drive with copied MS-DOS files complains about not being able to copy system files to "default" drive.

"640K ought to be enough for anybody." - And i intend to get every last bit out of it even after loading every damn driver!
A little about software engineering: https://byteaether.github.io/

Reply 5 of 5, by weedeewee

User metadata
Rank l33t
Rank
l33t

no idea if it's possible with freedos sys but...

freedos [/b]sys /oem:ms[/b] ?

active primary partition yes,
correct Partition boot record ?
dos system files in correct location, true for old versions of dos. can't remember if it's still valid for msdos 6.x
dos system file entries in correct location of root directory... true for old versions of dos. can't remember if it's still valid for msdos 6.x but it boils down to IO.SYS first, MSDOS.SYS second, COMMAND.COM third.

if you have an old msdos formatted floppy, and you verify the boot sector has a reference to IO SYS in it, then if you copy the system files on the empty disk in the order of io, msdos, command, then you will have a bootable disk. if you add sys.com & fdisk.exe on it, you'll have everything you need to partition & make bootable a hard drive. oh wait, add format.com as well. add vide-cd.sys or oakcdrom.sys & mscdex to access a cdrom and make the appropriate config.sys entries.

ps. don't give me crap about autoexec.bat. it's not needed.

example config.sys

DEVICE=VIDE-CD.SYS /D:CDDRIVE1
INSTALL=MSCDEX.EXE /D:CDDRIVE1

Right to repair is fundamental. You own it, you're allowed to fix it.
How To Ask Questions The Smart Way
Do not ask Why !
https://www.vogonswiki.com/index.php/Serial_port