68 - WEE (wee63) and WEEsetup.exe - an alternative bootloader

Unique hits counter on tumblr

Introduction

Grub4dos is a 2-stage boot manager - the first stage is the boot code which is loaded by directly reading sectors from a disk by the BIOS when it first boots. This Stage 1 boot code then looks for and loads the 2nd stage file grldr which contains all the grub4dos functions that we know and love!

WEE is a small cut-down boot manager which is based on grub4dos. The main advantage of wee is that it does not need to load a secondary file like the grldr file because a much reduced version of the grldr code is contained within the boot code itself (sectors 1-62). Also, wee may be more successful at booting 'difficult' systems that don't seem to want to boot using grub4dos and just display a flashing cursor (as no 2nd stage grldr file is required).

Note that WEE does not access CD-ROMs/DVDs or ext4 filesystems. WEE supports FAT12/16/32, NTFS and ext2/3/4, currently (Jan 2012) - no other file systems are supported. It is best (i.e. more reliable) to use a WEE command to directly find and load a bootloader (such as NTLDR) rather than boot from a partition bootstrap directly..

WEE is part of the grubutils utilities. WEE is not suitable for use with Easy2Boot+Clover.



You can either:
install WEE to the boot disk boot track (it modifies/replaces the MBR and the following sectors, up to 63 sectors)
or
you can load WEE from a wee63.mbr file (for instance, you can use BCDEdit or EasyBCD to add a boot entry to the Windows 7 BCD so that you can boot to WEE and then from there boot to whatever you like.

WEE should only be used on modern systems (after the year 2000) as it only uses Extended Int 13h EBIOS calls. WEE can boot up from IO.SYS (Win9x), KERNEL.SYS (FreeDOS), VMLINUZ (Linux), NTLDR/BOOTMGR (Windows), GRLDR (grub4dos) and GRUB.EXE (grub4dos).

Why is WEE useful?

Here are some reasons why you might want to try WEE

1. You want to create a bootable drive that has a hard-coded (unmodifiable) grub4dos menu and needs no grldr or boot menu.lst file.
2. You have a BitLocker encrypted boot drive and want to run grub4dos. You cannot install grub4dos as this would break the BitLocker protection and Bootmgr will not treat grldr as a valid boot file.
3. You have some 'bad' systems which do not seem to boot to the grub4dos menu (you just get a flashing cursor)
4. You want to use grub4dos but need to place the grldr file in a location other than the root of the boot volume.
5. You want to boot from an ext2/3/4 formatted volume to grub4dos (grub4dos cannot boot from ext2/3/4).

How to install or boot to WEE?

RMPrepUSB v2.1.635 and later versions now includes an 'Install WEE to Track 0' feature. Just press ALT+F12 or CTRL+W (or use the Drive tab menu) and you will be presented with the default WEE menu in NotePad which you may change if you wish ('No user prompts' must be unticked). When it is correct (the menu is limited to 512 bytes, this includes any comment lines), save it and then RMPrepUSB will run WeeSetup.exe for you with the correct parameters to install it into the first track of the selected disk. By default, the included WEE menu will load grldr, so it can be used after installing grub4dos to a disk. If the grldr file is not present, will you be presented with this default menu:


Default WEE menu presented if the grldr file cannot be found.


WeeSetup.exe

If you don't want to use RMPrepUSB to install WEE, then the manual way to install WEE is to use weesetup.exe from a command shell. The latest version of weesetup.exe can be found here in the Downloads area (latest = v1.3 2011-09-18 at the time writing). Weesetup.exe should be run from an Administrator Command Prompt or Command Shell under Windows XP or later.

In this example we are going to use WEE to load grub4dos (grldr) - this is just an example, you can make your own WEE menu.

To install WEE to a disk's boot track using weesetup type:

weesetup

You should see the Usage message similar to this:

weesetup v1.3.
Usage:
weesetup [OPTIONS] DEVICE

OPTIONS:
-i wee63.mbr Use a custom wee63.mbr file.
-o outfile Export new wee63.mbr to outfile.
-s scriptfile Import script from scriptfile.
-m mbrfile Read mbr from mbrfile(must use with option -o).
-f Force install.
-u Update.
-b Backup mbr to second sector(default is nt6mbr).
-l List all disks in system and exit

Report bugs to website:
http://code.google.com/p/grubutils/issues

Thanks:
wee63.mbr (minigrub for mbr by tinybit)

Now let's list the drives in your system, type:

weesetup -l

this will list all available 'hard disk' devices (including available card readers and USB Flash drives). Identify the drive that you want to install WEE to (for example it may be (hd2)).

(hd0): 488281250 (233g)
(hd1): 234441648 (112g)
(hd2): 78140160 (37g)


Create a text file called weemenu.txt with the following text in it:

title Load grub4dos
find --set-root /grldr
/grldr

title Boot from HD0
map () (hd0)
map (hd0) ()
map --hook
root (hd0)
chainloader +1


title Boot XP
find --set-root /ntldr
/ntldr



Now install WEE as follows:

weesetup -u -s weemenu.txt -f (hd2) where (hd2) is the drive where you want to overwrite the boot track and install WEE to (e.g. a USB drive)

Example WEE menu

You don't need to have menu entries, simply omit the 'title' lines and the commands will be immediately executed.

As WEE is a cut-down version of grub4dos, it does not support all the nice feature in grub4dos such as help text, many grub4dos commands, live editing of menu entries, etc. you can however use 'C' to get to a primitive command prompt. You may bypass the boot-up script by quickly pressing the key C at startup. You may single-step trace the boot-up script by quickly pressing the Insert key at startup, and you will get the opportunity of step-by-step confirmation on each command in the boot-up script.

List of WEE 'built-in' commands

This is a list of the only menu commands that are supported by WEE (2011-6-27 version).

a command run a 32-bit program designed for WEE
default x specify default menu number to select when menu is displayed
exit quits from a menu sequence
find {--set-root} find a file (and set device as root)
map map a device/file as a drive ???? may be missing in some versions ?????
pause e.g. pause --wait=3 This message will display for 3 seconds
root set the root device or folder
rootnoverify set the root device or folder (don't check contents for valid device/volume)
timeout set a timeout before default menu is automatically run
title defines text that appears as a menu item (note that \nhelp text feature is not supported for this command)

Examples:
These examples are taken from the WEE ReadMe file

Boot the MBR
(hd0)+1

Boot the bootsector of a partition
(hd0,0)+1
or equivalently