makebootfat FAT32+MSDOS
#1
Posted 25 June 2009 - 03:20 AM
If I use HP's USB Storage Tool, my FAT32 USB Drive boots successfully!
WORKS: FreeDOS, 32MB USB Drive, FAT16
makebootfat -o usb -2 Freedos.bss -c COMMAND.COM -c KERNEL.SYS -v D:\Dummy
WORKS: FreeDOS, 1GB USB Drive, FAT32
makebootfat -o usb -3 FDFAT32.bin -c COMMAND.COM -c KERNEL.SYS -v D:\Dummy
WORKS! MSDOS (Win98 4.1), 32MB USB Drive, FAT16
makebootfat -o usb -b MSFAT16.bin -c COMMAND.COM -c MSDOS.SYS -c IO.SYS -v D:\Dummy
FAILS.... MSDOS (Win98 4.1), 1GB USB Drive, FAT32
makebootfat -o usb -3 FAT32USB.bin -c COMMAND.COM -c MSDOS.SYS -c IO.SYS -v D:\Dummy
makebootfat creates the USB drive successfully, but when I try to boot, it just hangs with a flashing cursor.
I've tried countless makebootfat parameters, such as -m mbrfat.bin, -F, -Z, -D, -P, -E
I've tried different boot sector images, from a FAT32 HDD with Win98, from a FAT12 Floppy Disk, from a FAT32 USB Key that can boot (created by HP's tool), but nothing works
I've tried different command.com files, and even tried HP's system files.
Note that most boot sectors are 512bytes. But HP's built-in FAT32 boot sector is 1500Bytes!
When I try writing that 1500Byte sector using makebootfat, it only write 512bytes.
When I try writing that 1500Byte sector using HDHacker, the drive shows corrupted files and folders.
So my question is, how does HP write the 1500Byte boot sector? Is it writing an MBR with a partition table?
Can I force makebootfat to write the whole 1500bytes?
Maybe I need to use a different mbrfat.bin file?
#2
Posted 25 June 2009 - 03:59 PM
ALL the "DATA", but only most of the "CODE" in a FAT32 is within first sector.
An actual "complete" bootsector for FAT32 is actually:
1st, 2nd and 3rd sector FAT32 DOS.
1st, 2nd and 12th sector FAT32 (2K/XP/2003, etc.)
1st, 2nd and 14th sector FAT32 (ReactOS)
Check these:
http://www.boot-land...?...=7512&st=56
http://www.boot-land...?...=7739&st=89
And of course the "base reference":
http://thestarman.pc...mbr/MSWIN41.htm
On a freshly formatted FAT32 volume "default value" of bytes on 2nd sector are (Absolute offsets from begiinning of first sector, hex):
at 0x0200:
52 52 61 41at 0x03E4:
72 72 61 41at 0x03E8:
FF FF FF FFat 0x03EC usually:
02 00 00 00at 0x03FE:
55 AA
Thus:
1st sector contains both "CODE" (fixed) and "DATA" (variable)
2nd sector contains both "CODE" (fixed) and "DATA" (variable) but of which the "standard values" are known
3rd sector (as saind not necessarily the actual sector at offset 0x0400) contains only "CODE" (fixed)
It's a long time I experimented with makebootfat, cannot remember details, you may find something of interest in this report:
http://www.911cd.net...o...13784&st=44
The workaround was simply to run DOS 7.x/8.0 SYS.COM in a VM:
Please note that this option (FAT32 on a 512 Mb USB key) did NOT make a bootable volume. I suspect that there is something not right in the FAT32 identifier (hex 0b) and structure. By running (in Qemu) sys.com, it changed (between other things) the identifier to LBA mappped (hex 0c) and the volume booted.
I guess that SYS.COM fixed, besides the Partition ID, the missing 2nd and 3rd sector.
Since the 2nd and 3rd sector are "fixed" (at least for a freshly formatted system they should work allright if copied to the stick with dsfo/dsfi (or HDhacker).
I.e.:
- let makebootfat partition/format the and write the 1st bootsector, including "right" "fixed" CODE and (hopefully) "right" DATA
- duplicate if needed the first sector to 6th one
- write "pre-made" "fixed" 2nd and 3rd sectors
- write again same sectors to 7th and 8th sectors
Let me know how it goes....
jaclaz
#3
Posted 25 June 2009 - 10:44 PM
So basically I need to write more than 512bytes, which is why HP's utility writes 1.5KB of sectors.
The question is, can makebootfat v1.4 (latest) do this? or would it need to be updated?
Or would I need to use another tool?
#4
Posted 26 June 2009 - 08:19 AM
Yep.So basically I need to write more than 512bytes, which is why HP's utility writes 1.5KB of sectors.
It seems to me that your experience, summed up to the one I did at the time (and it was ALREADY version 1.4) already produced an answer: it seems like NOT.The question is, can makebootfat v1.4 (latest) do this? or would it need to be updated?
makebootfat seems like a dead project, unfortunately.
We would need a programmer to take the Source Code and fix/integrate/update it.
I guess you need one.Or would I need to use another tool?
You can use HDhacker:
http://dimio.altervista.org/eng/
to try ADDING the missing/wrong 2nd and "3rd" (beware of the placement of this last one as 12th sector for Windows 2K/XP/2003 and probably for Vista/2008/Windows7) as hinted above AFTER having used makebootfat to generate the 1st sector (and the other filesystem structure).
If it works, you can then script it and use dsfo/dsfi to automate the process.
You can take some examples of how to perform this kind of actions by reading the code of my small batches MBRBATCH/MKIMG:
http://www.boot-land...?showtopic=3191
http://www.boot-land...?showtopic=5000
jaclaz
#5
Posted 29 June 2009 - 02:21 AM
I know c++ so I can modify makebootfat, implementing the changes is the hard part. I'll have a look at the source when I get a chance.
#6
Posted 29 June 2009 - 02:17 PM
I'll need to read up on how boot sectors, FAT32, partition tables, etc.. work.
Standard (GOOD ) reference:
http://mirror.href.c.../mbr/index.html
http://www.goodells.net/multiboot/
http://home.att.net/...ot/w95b_mbr.htm
(several interestring pages on each of the above links)
Also, check these::
http://www.911cd.net...showtopic=21914
http://www.911cd.net...o...1702&st=129
And this:
http://homepages.tes...name-field.html
jaclaz
#7
Posted 03 July 2009 - 06:58 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users