% $Id$ %
\opt{e200}{\fixme{NOTE: These instructions will not work on the 
``Rhapsody'' version of the E200 series (also known as E200R).  Please 
follow the instructions at 
\url{http://www.rockbox.org/twiki/bin/view/Main/SansaE200RInstallation}.}}

In order to make your \playertype{} load and execute the Rockbox firmware you
have just installed, you will need to install the Rockbox
bootloader. Unless bugs are found in the bootloader code, or
significant new feature are added, you will only have to perform this
step once.

These steps use the sansapatcher tool. Source code is available in the Rockbox
SVN repository (\url{http://svn.rockbox.org/viewvc.cgi/trunk/rbutil/sansapatcher/}).

\subsubsection{Bootloader installation from Windows}

\begin{enumerate}

\item Make sure you are logged into your computer as Administrator, or a 
user with Administrator privileges and connect your \dap{}.

\item Download sansapatcher.exe from 
\download{bootloader/sandisk-sansa/sansapatcher/win32/sansapatcher.exe} 
and run it.

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

\item Disconnect your \dap{} in the usual way. The bootloader is now installed. 

\end{enumerate}

\subsubsection{Bootloader installation from Mac OS X}

\begin{enumerate}

\item Attach your \dap{} to your Mac and wait for its icon to appear in 
Finder.

\item\label{subsec:macos_umount} Open up Disk Utility
(in Applications $\rightarrow$ Utilities) and click 
on the name of your \dap{} (e.g. Sansa \opt{e200}{e280}\opt{c200}{c250})
in the list on the left pane. Then click on the ``unmount'' icon at the top.
\warn{Do \emph{not} click on the ``eject'' icon.}

\item Download and open sansa.dmg from 
\download{bootloader/sandisk-sansa/sansapatcher/macosx/sansapatcher.dmg} 
and then double-click on the sansapatcher icon inside. 

\item 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 
sansapatcher will now install the bootloader. After a short time you 
should see the message ``[INFO] Bootloader installed successfully.'' Press 
ENTER again to exit sansapatcher and then quit the Terminal application.

\item \warn{If you received a ``Resource busy'' error from 
sansapatcher, then this means you did not complete step 
\ref{subsec:macos_umount}. Go back to Disk Utility, unmount your
\dap{} and then run sansapatcher again.}

\item Your \dap{} will now automatically reconnect itself to your Mac. 
Wait for it to connect, and then eject and unplug it in the normal way. 

\end{enumerate}

\subsubsection{Bootloader installation from Linux}

\begin{enumerate}

\item Download sansapatcher from
\download{bootloader/sandisk-sansa/sansapatcher/linux32x86/sansapatcher} (32-bit x86 
binary) or \download{bootloader/sandisk-sansa/sansapatcher/linux64amd64/sansapatcher} 
(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.

\item Open up a terminal window and type the following commands:

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

\warn{You may need to be the root user in order for sansapatcher to have
sufficient permission to perform raw disk access to your \dap{}.}

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

\item Disconnect your \dap{} in the usual way. The bootloader is now installed.

\end{enumerate}
