PDA

View Full Version : "Non-system disk" Error Booting DOS from Second HDD


sburtchin
02-11-2007, 03:35 AM
Originally I planned to put DOS 5 on a logical on the second HDD. I first tried to install it directly there with SYS, then to a primary on the second HDD, but neither of these got any closer than the "Non-system disk" error. I think this means the only remaining problem is that it can't find IO.SYS, if I interpret this correctly. Then I installed DOS to a primary on the first HDD, and that worked after I moved it within the first 2GB.

Then I used Ghost to copy that bootable partition to a primary on the second HDD, and also to the logical partition on the second HDD. I was then able to boot the primary on the second HDD (with GRUB) by swapping the drives in BIOS - with drive ID = 0x80, however, with this boot arrangement trying to access any other volume on that drive resulted in the "Invalid media type" error. Setting the drive ID to 0x81 caused it to either hang or print garbage all over the screen depending on if the drives were swapped.

Trying to boot the logical on the second HDD I get "Non-system disk" error when the drive ID is set to 0x80 & drives not swapped, and when the drive ID is set to 0x81 & drives swapped; and configured the other two ways it hangs.

I searched the web about every way I could think of but I didn't find any information about booting DOS on a logical, or booting DOS on a second HDD (other than changing the drive ID and swapping drives - which I already tried). I found a couple links (How It Works: DOS Floppy Disk Boot Sector (http://www.ata-atapi.com/hiwdos.htm) and PC Bootsector Programming Tutorial in ASM (http://www.vnutz.com/content/program_a_bootstrap_loader)) with brief comments about how the boot code works, but I was not able to follow it to see how it finds IO.SYS.

I would really like to understand how the boot process works so I can stick to my original plans. The next best alternative would be to use a primary on the second disk, but that makes the maintenance logistics more complex. "C:" in the PARTINF2.TXT is the logical I want to boot. These two text files show the partitioning for both disks when trying to boot the logical "C:". The ZIP file contains the boot sector from this partition.

Any ideas that would help point me in the right direction would be very much appreciated. Thanks.

Rick
02-11-2007, 04:10 AM
I have Never been able to install or run dos 3.3-5 or even free dos off a logical drive

It (MS-dos ) requires itself to be installed on the primary partition ( Root) and has hooks to the MBR

Even on a triple /quad boot system. It had to be on the primary (root)
Gag43 did allow me to install it on the second drive But it (gag) also changed the active status of the drive

Gag43 (GAG-GRAPHICAL BOOT MANAGER)

Paul Komski
02-11-2007, 05:14 AM
I presume you have hacked the hidden sectors value (http://www.goodells.net/multiboot/ptedit.htm) of the logical partition.

The other thing with these early versions of MS-DOS is that they expect to find a hard drive with only one small partition and, for example, their versions of fdisk (from memory) will only see and deal with a single partition starting at the start of the drive.

It may also be mandatory that io.sys is absolutely the first entry in the directory structure, which could mean the file's reference has a fixed LBA (or CHS) starting point on the hard drive. If that is the case and you have the partition anywhere else the bootstrap code's jump instruction to io.sys would need to be hacked appropriately. The Starman (http://www.geocities.com/thestarman3/) has examined io.sys and boot strap encoding in some detail and if you can't find anything on his site an email might get a response for you. If his own site locks you out then there are nearly always mirrors working somewhere.

sburtchin
02-11-2007, 06:41 AM
Yes - the hidden sectors were set to 45423 in the BS.

I repeated some tests that failed earlier because the results just didn't seem consistent. The small primary on the second disk that failed to boot earlier with the drive ID set to 0x81 passed this time (last test filled the screen with garbage). No idea what went wrong then.

So to do a simpler test for the partition starting at LBA 45423 I defined it in the first slot of the MPT like this:

06 00 3 1 1 70 239 63 45423 1028097

Then with everything else exactly like in the attachments, drives NOT swapped, drive ID = 0x81 - GRUB booted DOS 5 on this partition. This partition does not begin on a cylinder boundary. In fact nothing was moved! It is even still the first logical partition, and Dumb Operating System assigned two drive letters to it (C: and D: ).

So now the only missing piece to my puzzle is: "How does DOS know whether it's asked to boot on a logical or a primary, and why does that matter?"

It is interesting that about everything I read says that DOS can only be booted from the active partition. Even the GRUB manual states this and GRUB has a "makeactive" command specifically for booting DOS/Windows. In my testing with GRUB the active flag has been irrelevant.

I have read that early versions of DOS can only see the start of the drive, but no reference to specific versions. I will read the Starman site to see what I can find out there.

What is the hook to the MBR? Does the bootstrap code need to get information out of the MPT? Would it know which slot to look in. In my example here, the boot sector was created in a logical partition, then DOS was booted thinking that same partition was a primary.

Paul Komski
02-11-2007, 07:35 AM
What is the hook to the MBR?I'm not sure what Rick is referring to unless it is important that the partition table partition type is not 07h (extended) and that boot is 80 (active) but if using a boot manager I would think that both values would be appropriately munged regardless of the actual static (pre-boot) partition table values.

I have read that early versions of DOS can only see the start of the driveThere will definitely be a limit to what (numerically) the OS "can see" but I was right about io.sys (in part anyway) that (IO.SYS must be contiguous starting at cluster 2 (http://support.microsoft.com/?kbid=57730)). If this is exactly the case then the extended partition will push the relevant cluster up the drive and thus not be found even if any partition table munging has been effective and the PBS hidden sectors have been hacked. The only way round would be to hack the bootstrap code to this position and the Starman is the only person I can think of who might know how to do this.

Rick
02-11-2007, 08:31 AM
Early versions of dos could not be loaded unless they were loaded first on the disk.
I think it was version 5 that changed that

In fact you had to apply sys to a blank floppy or drive before putting anything else on the disk.

sburtchin
02-12-2007, 01:03 AM
if using a boot manager I would think that both values would be appropriately munged regardless of the actual static (pre-boot) partition table values.Almost! No matter what I put for filesystem type GRUB was able to start the boot process, but it hangs if DOS cannot assign a drive letter, so it can be any type that DOS would assign a drive letter to. The Active flage appears to be totally irrelevant though. Makes me wonder why the GRUB people are still pushing the "makeactive" command for all versions of DOS/Windows:confused:. I seem to remember other boot managers having that feature to set a partition Active too.

(IO.SYS must be contiguous starting at cluster 2 (http://support.microsoft.com/?kbid=57730)). If this is exactly the case then the extended partition will push the relevant cluster up the drive and thus not be found even if any partition table munging has been effective and the PBS hidden sectors have been hacked. The only way round would be to hack the bootstrap code to this position and the Starman is the only person I can think of who might know how to do this.That's definitely a hard nut to crack! What did you mean by "push the relevant cluster up the drive"? Are you refering to the fact that logical partitions usually start on head 1 vs. head 0 for primaries, or is the filesystem structure different?

:D:) Persistence did pay off with a workaround that I think is safe - crossing my fingers... DOS is still installed to the same logical partition. Nothing had to be moved. Just define the same partition in the MPT (yes, it is a primary AND a logical), and boot to the "primary" definition of it. The "logical" definition of the same partition is hidden to prevent DOS from assigning it two drive letters. See the attached images.

Paul Komski
02-12-2007, 03:56 AM
Nice bit of manipulation. I suppose what you have done to all intents and purposes is to have created a de facto primary partition but with mismatching CHS and LBA values (LOL - Partition Magic would go nuts) and not starting on a cylinder boundary. Don't suppose you could have created a partition starting directly at that point (other than by first creating an extended partition) unless you had used something like DD or WinHex to copy it there. It also indicates that DOS 5 uses the LBA values unless it is the BIOS that is reporting them back to the OS.

I guess that proves that the io.sys starting cluster is relative to the start of the partition and not to the start of the hard drive itself - but I still think it must be the very first directory entry. What's new to my understanding is that the FAT table cluster references must be contiguous, which you would expect if it is the first file written to a partition with an undamaged surface.

There's no reason to think that the file system itself would be any different on a logical or primary partition of the same size. The only differences would be in the metadata such as the hidden sectors and partition table references.

sburtchin
02-12-2007, 06:49 AM
Don't suppose you could have created a partition starting directly at that point (other than by first creating an extended partition) unless you had used something like DD or WinHex to copy it there. It also indicates that DOS 5 uses the LBA values unless it is the BIOS that is reporting them back to the OS.Actually - - - you can. I think it was on the Rannish site where I read that many operating systems will recognize any arbitrary beginning or ending point for a partition, so I thought now would be a good time to put that to the test. I created the following partition on the first disk with GRUB's "partnew" command:

06 00 46 71 8 48 67 19 700000 30000

Then I booted with my DOS 5 floppy and did a "format /s", then set the Active flag for it. Then <ctrl-alt-del> and DOS booted on that wierd partition. It appears to have a fully functional filesystem. IO.SYS is indeed the first entry in the root directory table. I think DOS 5 depends on CHS at least in some way because it cannot see anything above cylinder 1024.

FYI:
Two of the features I like best about GRUB are the "partnew" and "parttype" commands. With "partnew" you can create any primary partition in the slot of your choice by feeding it just the type, starting LBA and total sectors. I can have as many primary partitions as I want and still keep everything standard (as long as I document what's in that unpartitioned space). Unfortunately the developers of GRUB2 plan to drop those two.