Hi,
Latest fbinst can be downloaded from gna:
http://download.gna.org/grubutil/The tricky thing about flash boot disk is compatibility. There are three modes, HDD, ZIP and FDD, and different bios uses different disk parameter. Some bios support lba mode to access flash disk, some don't. Some of them even skips a certain number of sectors at the beginning of disk. It's difficult to create a flash disk that would work in all these circumstance.
This is what fbinst is for. I've come up with a special disk layout that works arond the various compatibility issue. Here are the steps to create an universal flash boot disk in Windows XP:
1. Insert the usb drive
fbinst would scratch the drive later, make sure to backup useful files.
2. List disk devices in system
Enter the following command in command prompt:
fbinst --list
The result may look something like this:
(hd0): 488392065 (233g)
(hd1): 3919860 (2g)
In this example, (hd1) is the flash disk
3. Format the usb drive
fbinst (hd1) format --force
WARNING: this step would destroy existing data in usb drive.
This would create the necessary disk layout, and add a single fat data partition. Remember to replace (hd1) with the actual device detected in step 2.
You can use the following options with format command:
--force
Without the --force option, fbinst only initializes the structure in mbr, leaving the data partition intact. However, this requires that the data partition is located at sector 0x3f00. Recommend to use --force once to create the necessary layout, then use format without --force when reinitialize is required.
--fat16
Format data partition as FAT16
--fat32
Format data partition as FAT32
--base NUM
Set base sector. In 1.2, the default value (63) works nicely, tt's not recommended to use other value.
--align
Optimize data storage in fat partition.
--size NUM
Set the size of fat partition, for example:
fbinst --size 500m (hd1) format
Without --size option, it uses all availble space in the flash disk.
--zip
Format flash as USB-ZIP. Please note that this option merely set some field in mbr to influence bios, however, different bios uses different algorithm to determine ZIP/HDD mode, so there is no guarantee which mode is detected by a certain bios.
I believe ZIP mode is more generic than HDD. Some bios can't boot from flash disk created with HDD mode. However, ZIP disk would be (fd0) at boot time, and the data partition is (fd0,0), some application can't handle this properly. To solve this, you can use grub4dos's map command to map (fd0) to (hd0).
Some bios use the MSWIN4.1 and FAT16 signature in the first data partition to determine ZIP mode. By reformatting the data partition as NTFS, you can change these two signatures and therefore trick the bios into using HDD mode.
4. Load grldr into mbr
fbinst (hd1) load c:/grldr
This commands store grldr to mbr, which would be loaded automatically on startup.
You can also use ntldr instead of grldr.
5. Other commands
You can use fbinst -h to display command usage.
* fbinst 1.3 update:
Support multiple boot entries and embedding data files in the 8m reserve area, you can also specify the size of reserve area.
To edit boot menu, use the following commands:
text TEXT
Add text item, it can be used to print header or footer information in the boot menu.
menu TEXT CSIP [KEY]
Add menu item, CSIP is the entry point. KEY is the hotkey, default value is the number key 1-9 for the first nine menu items. TEXT can be empty string "", which defines a hidden item. It's not showed in screen, but you can still boot in with the right hotkey.
load FILE ADDR
Add load item, load the content of FILE in memory address ADDR.The boot item must follow a menu item, and there can be more than one of them.
file FILE NAME
Add file item. It's used to add embedded file to the reserved area. The files can be access in grub4dos via the (ud) device.
clear
Clear all items.
For example, here is a steps to create a boot menu:
fbinst (hd1) text "Please select menu"
fbinst (hd1) menu "F1. grub4dos" 2000:0 F1
fbinst (hd1) load c:/grldr 0x20000
fbinst (hd1) menu "F2. grub2" 2000:0 F2
fbinst (hd1) load c:/g2ldr 0x20000
fbinst (hd1) text "---------"
fbinst (hd1) menu "F3. ntldr" 2000:0 F3
fbinst (hd1) load c:/ntldr 0x20000
fbinst (hd1) menu "" 2000:0 F4
fbinst (hd1) load c:/grldr_old 0x20000
fbinst (hd1) file c:/aa.img aa.img
fbinst (hd1) file c:/bb.img bb.img
There are two options that can be configured using config command:
default
The default menu item. The index starts with 0.
timeout
Timeout. If timeout is 0, it doesn't show the menu and boot default item directly. However, even with timeout=0, you can still force the menu to show by pressing ESC key at startup.
Here is the config samples:
fbinst (hd1) config --default 0
fbinst (hd1) config --timeout 5
fbinst 1.3 also allows you to customize the size of reserved area. The minimum size is 0x3f00, but you can set it higher. For example:
fbinst (hd1) format --reserve 10m --force
Without --force, format would try to create the necessary disk layout without scratching the partition table. But it requires that there is at least 0x3f00 sectors (about 8m) before the first partition. If reserved space is not enough, it just print an error message and quit. In this case, you don't need to use --reserve, as it would allocate all space before the first partition to reserve area by default.
And now there are two area for embedded data, one is sector 0-0x3f00, another is 0x3f00 to the end of reserved area. By default, it will fill the first area, when it's full, the file pointer is moved to the second area automatically, but you can also make the file pointer jump to second area with this:
fbinst (hd1) config --extended-data
One advantage of the second area is that it uses direct copy without inserting additional information, so you can use "map" instead of "map --mem" in grub4dos.
* grub4dos update
This version of grub4dos understands fb structure, it get disk geometry from fb instead of detect it again.
It also support virtual device (ud), which can be used to access the files embedded in reserved area using the file command in fbinst.
* grub4dos update
now support direct map on files in the extended area, find command can find files in (ud) device.
* fbinst 1.3 final
New command "restore", used to restore fb mbr scratched accidentally.
fbinst (hd1) restore
New command "export"
Export files
fbinst (hd1) export "aa.img" c:/aa.img
Download:
http://download.gna.org/grubutil/Corresponding grub4dos:
http://nufans.net/grub4dos/grub4dos-0.4.4-2009-05-23.zip