How do you boot freedos in an extended partition?
#1
Posted 13 January 2017 - 11:21 PM
#2
Posted 14 January 2017 - 12:30 PM
What partitions and OS are already on the disk?
What disk is it (USB/IDE/SATA).
Could you for instance install grub4dos to the MBR?
#3
Posted 14 January 2017 - 03:48 PM
Almost surely you need to correct the "sectors before" or "hidden sectors" in the bootsector, if your "bootmanager" (WHICH one?) uses the bootsector.
The usual reference is:
http://www.goodells....ot/ptable.shtml
(grub4dos can BTW do it using the partnew command)
BUT then it has to be seen if you need some other modification.
Is the volume FAT12/16 or FAT32?
MS-DOS did require the right disk number 0x80 and the partition to be active, the FreeDos bootsector has a 255 value that supposedly means "autodetect", see:
https://sourceforge....ssage/19623130/
If you use (say) grub4dos and re-map the volume, then everything should work fine, as there is also another possible issue:
http://freedos.gds.t...chnote/145.html
Also you may be hitting some CHS or LBA limit, please describe in detail what is your setup, understand how the more info you provide the more is likely that someone can find the issue and offer a solution or an alternative.
Wonko
#4
Posted 15 January 2017 - 08:10 AM
Thanks Wonko,
The remap facility looks interesting. I'm not overly familiar with grub4dos. If I had 2 entries in the partition table, 1 for grub4dos partition and an extended full of filesystems, could I map 3 of the filesystems into the partition table? Overwriting one of the existing partition entry? Does it handle un-mapping on next boot, restoring to the original 2 entries again?
understand how the more info you provide the more is likely that someone can find the issue and offer a solution
Without knowing what the problem is, its difficult to know what to include. Here is the disk layout:
T0 0:0:2 0:0:63 plop BM P1 7F 0:1:1 81:31:63 63 165249 ) P2 * 81 82:0:1 132:31:63 165312 102816 ) modified minix P3 80 133:0:1 163:31:63 268128 62496 ) L1 06 164:1:1 225:31:63 63 124929 freedos, bootable L2 06 226:1:1 265:31:63 125055 80577 freedos non-bootable - 266:0:1 519:31:63 unused: future linux
and a hex dump of the freedos boot sector:
EB 3C 90 46 52 44 4F 53 35 2E 31 00 02 04 01 00 02 00 02 00 00 F8 7A 00 3F 00 20 00 BE 0B 05 00 01 E8 01 00 80 00 29 EE 08 4D 1E 50 32 2D 44 31 20 20 20 20 20 20 46 41 54 31 36 20 20 20 FA FC 31 C0 8E D8 BD 00 7C B8 E0 1F 8E C0 89 EE 89 EF B9 00 01 F3 A5 EA 5E 7C E0 1F 00 00 60 00 8E D8 8E D0 8D 66 A0 FB 88 56 24 C7 46 C0 10 00 C7 46 C2 01 00 8C 5E C6 C7 46 C4 A0 63 8B 76 1C 8B 7E 1E 03 76 0E 83 D7 00 89 76 D2 89 7E D4 8A 46 10 98 F7 66 16 01 C6 11 D7 89 76 D6 89 7E D8 8B 5E 0B B1 05 D3 EB 8B 46 11 31 D2 F7 F3 50 01 C6 83 D7 00 89 76 DA 89 7E DC 8B 46 D6 8B 56 D8 5F C4 5E 5A E8 95 00 C4 7E 5A B9 0B 00 BE F1 7D 57 F3 A6 5F 26 8B 45 1A 74 0B 83 C7 20 26 80 3D 00 75 E7 72 65 50 C4 5E 5A 8B 7E 16 8B 46 D2 8B 56 D4 E8 67 00 58 1E 07 8E 5E 5C BF 00 20 AB 89 C6 8B 56 5C 01 F6 73 03 80 C6 10 8E DA AD 83 F8 F8 72 EB 31 C0 AB 0E 1F C4 5E 5A BE 00 20 AD 09 C0 75 05 88 D3 FF 6E 5A 48 48 8B 7E 0D 81 E7 FF 00 F7 E7 03 46 DA 13 56 DC E8 20 00 EB E0 5E AC 56 B4 0E CD 10 3C 2E 75 F5 C3 E8 F1 FF 45 72 72 6F 72 21 2E 30 E4 CD 13 CD 16 CD 19 56 89 46 C8 89 56 CA 8C 86 9E E7 89 9E 9C E7 E8 D0 FF 2E B4 41 BB AA 55 8A 56 24 84 D2 74 19 CD 13 72 15 D1 E9 81 DB 54 AA 75 0D 8D 76 C0 89 5E CC 89 5E CE B4 42 EB 26 8B 4E C8 8B 56 CA 8A 46 18 F6 66 1A 91 F7 F1 92 F6 76 18 89 D1 88 C6 86 E9 D0 C9 D0 C9 08 E1 41 C4 5E C4 B8 01 02 8A 56 24 CD 13 72 89 8B 46 0B 57 BE A0 63 C4 BE 9C E7 89 C1 F3 A4 5F B1 04 D3 E8 01 86 9E E7 83 46 C8 01 83 56 CA 00 4F 75 8B C4 9E 9C E7 5E C3 00 00 00 00 00 00 00 00 00 4B 45 52 4E 45 4C 20 20 53 59 53 00 00 55 AA
Hope these help.
Edited by mattrix, 15 January 2017 - 09:04 AM.
#5
Posted 15 January 2017 - 09:05 AM
As an experiment, I would make a grub4dos USB boot drive and boot on the target system with it to grub4dos.
Then try to boot to FreeDos partition on your hard drive
maybe try
map (hd1,4) (hd0,0) map --hook root (hd0,0) ls / chainloader /kernel.sys boot
If it works, you could you could rename kernel.sys to kernel1.sys and copy grldr to L1 and name it kernel.sys.
Then Plop would boot to grub4dos and you could use the menu above (in L1 or P1 if that didn't work) and chainload /kernel1.sys.
I have never played with logical partition like this, so I don't know if it would work. Maybe Wonko has a better suggestion?
#6
Posted 15 January 2017 - 11:10 AM
I don't know, there is something"wrong", but I am having trouble in understanding the reason.
Let's go in order.
L1 06 164:1:1 225:31:63 63 124929 freedos, bootable
L2 06 226:1:1 265:31:63 125055 80577 freedos non-bootable
the L1 is OK, it starts on relative sector 63 and ends on sector 124929+63=124992
But before it there are the primaries, that end on LBA 330623. (63+165249+102816+62496=330624)
So the first logical starts on LBA 330624+63=330687 (which does correspond to 164/1/1 on a n/32/63 geometry).
So the sectors before are 330687.
The first logical is 124929, thus it ends on LBA 455615 (330687+124929=455616)
Then there should be the extended partition 63 sectors "void" so that next volume starts on 455616+63=455679, this is also OK with 226/1/1.
So the sectors before are 455679
Now the posted bootsector (which is the one of the 1st logical volume, since it has size 124929 sectors) has instead 00050BBE i.e. 330686 sectors before, which is "wrong" (should be 330687).
EB 3C 90 46 52 44 4F 53
35 2E 31 00 02 04 01 00
02 00 02 00 00 F8 7A 00
3F 00 20 00 BE 0B 05 00
It's strange.
Anyway, the first thing is trying to correct:
EB 3C 90 46 52 44 4F 53
35 2E 31 00 02 04 01 00
02 00 02 00 00 F8 7A 00
3F 00 20 00 BF 0B 05 00
The other "queer" thing is the 32 head geometry, it is quite rare nowadays, since the overall size is so small, it makes me think of a CF card or similar.
This may pose a problem as not all systems/tools/BIOS/etc. will recognize this 32 head geometry.
@mattrix
I would like to see a screenshot of Ranish Partition Manager 2.44:
http://www.ranish.com/part/
of that partitioning, maybe something is escaping me.
About grub4dos the first thing to try is to use map --in-situ:
****************************************************************************** *** About the new map option --in-situ *** ****************************************************************************** --in-situ is used with hard drive images or hardrive partitions. With an in-situ map, we can typically use a logical partition as a primary partition. In-situ map is a whole drive map. It only virtualize the partition table and the number of hidden sectors in the BPB of the DOS Boot Record. While disk emulation may encounter various problems with win9x, the in-situ map works fine with win9x. Note that --in-situ will not change the real partition table. Example: map --in-situ (hd0,4)+1 (hd0)
Anyway, I will try to replicate your setup and see what comes out of it.
Wonko
#7
Posted 15 January 2017 - 12:30 PM
...
So the sectors before are 330687.
.....
Now the posted bootsector (which is the one of the 1st logical volume, since it has size 124929 sectors) has instead 00050BBE i.e. 330686 sectors before, which is "wrong" (should be 330687).
Thank you Wonko.
Your right, it does look odd, I had to transcribe the partitions by hand. I'm pretty sure about the CHS, but the relative sectors/size do look like I have used wrong figures, from an earlier time: mea culpa.
I edited in the 05BBE based on one of the links you sent me. I just got my maths wrong translating 1-based decimal to 0-based hex.
05BBF works OK.
Thank you so much.
In retrospect the grub remapping would have been more robust, provided I can remap 3 partitions safely.
Note that --in-situ will not change the real partition table.
So what about systems that don't use the BIOS calls?
cheers,
matt
Edited by mattrix, 15 January 2017 - 12:40 PM.
#8
Posted 15 January 2017 - 05:26 PM
Good.
Though you were "lucky" because the first primary partitions have a partition ID that FreeDOS doesn't recognize.
Otherwise you would have the wrong drive letter assignments.
The map --in-situ is only good for OS that use the BIOS (like DOS and similar) or for "special tricks", here specifically it works fine (I would say "better", because of the drive letter issue above) check the attached screenshots I used the same primary partition once with ID 06 (that FreeDOS "understands") and once eith ID07 (which FreeDOS "leaves alone")
The map --in-situ one remains the best option (though obviously you have a double mapping) and BTW you don't have to correct the sectors before if you use it.
Wonko
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users