% $Id$

\warn{Before starting this procedure, ensure that you have a copy
of the original \playerman{} firmware. Without this, it is
\emph{not} possible to uninstall Rockbox. It is also needed if you want to
install the dual-boot bootloader. The \playerman{}
firmware can be downloaded from
\url{http://www.tacp.toshiba.com/tacpassets-images/firmware/MESV12US.zip}.\\}
The single-boot bootloader can only boot Rockbox, whereas the dual-boot
bootloader can boot both Rockbox and the \playerman{} firmware.
The single-boot bootloader boots Rockbox more quickly if you no longer need
access to the \playerman{} firmware.\\

Installing the bootloader is only needed once. It involves replacing the
existing firmware file on your \dap{} with another version.
When running the original \playerman{} firmware (a version of Windows CE), it is
only possible to connect the \dap{} to a PC in ``MTP mode'', which hides
the actual content of your \daps{} disk and provides restricted access
to its contents.
In reality, the \daps{} hard disk contains two partitions, a small
(150~MB) ``firmware partition'' containing the \daps{} firmware (operating
system), and a second ``data partition'' containing your media files. The main
firmware file in the bootloader partition is called \fname{nk.bin}, and
this is the file that is loaded into RAM (by the \daps{} ROM-based
bootloader) and executed when your \dap{} is powered on.

\subsubsection{Bootloader installation from Windows}
\warn{You need to have at least Windows Media Player 11 installed for
installing the bootloader to work correctly. If you have Windows Media Player
10 installed beastpatcher will not be able to send the firmware file to the
player correctly.}

\begin{enumerate}

\item Attach your \dap{} to your computer.

\item Download \fname{beastpatcher.exe} from
\download{bootloader/toshiba/gigabeat-s/beastpatcher/win32/beastpatcher.exe}
and then perform one of the following, depending on whether you want single
or dual-boot.

\begin{description}
\item [Single Boot.] Run \fname{beastpatcher.exe}. You should see some
information displayed about
your \dap{} and a message asking you if you wish to install the Rockbox
bootloader. Press i followed by ENTER, and beastpatcher will
install the bootloader. After a short time you should see the message
``[INFO] Bootloader installed successfully''. Press ENTER again to exit
beastpatcher.

\item [Dual Boot.] Inside the \fname{MESV12US.zip} file you downloaded earlier
you should find an \fname{.iso} file.  Using e.g. 7zip
(\url{http://www.7-zip.org}) you can extract an \fname{.exe} file from this
\fname{.iso} file.  Using 7zip again, extract the \playerman{} firmware file
\fname{nk.bin} from the \fname{.exe} file and place it in the same
directory as \fname{beastpatcher.exe}.  Open a command prompt and navigate
to this directory, and then type the following commands:

\begin{code} 
    beastpatcher -d nk.bin
\end{code}

After a short time you should see the message
``[INFO] Bootloader installed successfully''. Press ENTER again to exit
beastpatcher.
\end{description}

\item After a successful installation, you need to disconnect your \dap{} from
USB, and then immediately reconnect it. It should reboot then enter the Rockbox
bootloader ``USB Mass Storage'' mode, which exposes your \daps{} disk to your
computer as a standard USB Mass Storage device.
\end{enumerate}

\subsubsection{Bootloader installation from Mac OS X}
\begin{enumerate}
\item Attach your \dap{} to your computer.

\item Download and open beastpatcher.dmg from 
\download{bootloader/toshiba/gigabeat-s/beastpatcher/macosx/beastpatcher.dmg} 
and then perform one of the following,
depending on whether you want single or dual-boot.

\begin{description}
\item [Single Boot.] Double-click on the beastpatcher icon. You can also
drag the beastpatcher icon to a location on your hard drive and launch
it from the Terminal. If all has gone well, you should see some 
information displayed about your \dap{} and a message asking you if you 
wish to install the Rockbox bootloader. Press i followed by ENTER, and 
beastpatcher will now install the bootloader. After a short time you 
should see the message ``[INFO] Bootloader installed successfully''
followed by some error messages that you can safely ignore. Press 
ENTER again to exit beastpatcher and then quit the Terminal application.

\item [Dual Boot.] Inside the \fname{MESV12US.zip} file you downloaded earlier
you should find an \fname{.iso} file.  Using e.g. 7zip
(\url{http://www.7-zip.org}) you can extract an \fname{.exe} file from this
\fname{.iso} file.  Using 7zip again, extract the \playerman{} firmware file
\fname{nk.bin} from the \fname{.exe} file and place it in the same
directory as \fname{beastpatcher}.  Open a terminal window and type the
following command:

\begin{code} 
    ./beastpatcher -d nk.bin
\end{code}
\end{description}

\item After a successful installation, your \dap{} will immediately turn off.
Turn it on again, and (because it is still connected to your Mac)
it will enter the Rockbox bootloader's
``USB Mass Storage'' mode, which exposes your \daps{} disk to your computer
as a standard USB Mass Storage device.
\end{enumerate}

\subsubsection{Bootloader installation from Linux}

\begin{enumerate}

\item Download beastpatcher from
\download{bootloader/toshiba/gigabeat-s/beastpatcher/linux32x86/beastpatcher}
(32-bit x86 binary) or 
\download{bootloader/toshiba/gigabeat-s/beastpatcher/linux64amd64/beastpatcher}
(64-bit amd64 binary). You can save this anywhere you wish, but the next 
steps will assume you have saved it in your home directory.

\item Attach your \dap{} to your computer and then perform one of the following,
depending on whether you want single or dual-boot.

\begin{description}
\item [Single Boot.] Open up a terminal window and type the following commands:

\begin{code} 
    cd $HOME
    chmod +x beastpatcher
    ./beastpatcher
\end{code}

If all has gone well, you should see some information displayed about
your \dap{} and a message asking you if you wish to install the Rockbox
bootloader. Press i followed by ENTER, and beastpatcher will now install the
bootloader. After a short time you should see the message ``[INFO] Bootloader
installed successfully'' followed by some error
messages that you can safely ignore. Press ENTER again to exit beastpatcher.

\item [Dual Boot.] Inside the \fname{MESV12US.zip} file you downloaded earlier
you should find an \fname{.iso} file.  Using e.g. 7zip
(\url{http://www.7-zip.org}) you can extract an \fname{.exe} file from this
\fname{.iso} file.  Using 7zip again, extract the \playerman{} firmware file
\fname{nk.bin} from the \fname{.exe} file and place it in the same
directory as \fname{beastpatcher}.  Open a terminal window and type the
following commands:

\begin{code} 
    cd $HOME
    chmod +x beastpatcher
    ./beastpatcher -d nk.bin
\end{code}

After a short time you should see the message
``[INFO] Bootloader installed successfully'' followed by some error
messages that you can safely ignore. Press ENTER again to exit
beastpatcher.
\end{description}

\item After a successful installation, your \dap{} will immediately turn off.
Turn it on again, and (because it is still connected to your PC)
it will enter the Rockbox bootloader's
``USB Mass Storage'' mode, which exposes your \daps{} disk to your computer
as a standard USB Mass Storage device.

\end{enumerate}
