XBOX LINUX PROJECT (Licensed under the GPL)
http://xbox-linux.sourceforge.net/
Release 0.1 (Hollings/Fatboss)  2002-08-16
By the many hackers of Xbox Limux


SCOPE

This is the first full release of a 'clean' 1MByte BIOS implementation
for the Xbox (<-- TM Microsoft) which actually contains and boots a
2.4.18 Linux Kernel, and brings up the network and some applications
like a small webserver, etc.

The BIOS can either be executed from the motherboard or LPC boot flash,
or from a specially constructed CD, which runs an unsigned XBE that
copies the BIOS into RAM and starts running it as if it was a warm
boot. (So for the CD method, you must have a mod installed allowing
unsigned code to be run.)

Yes, the box lights up on the network and can be telnetted into.
All Microsoft 'innovations' (ie, restrictions) have been burnt away.
The box is still 0wned, but now its 0wned by YOU.


OVERVIEW

What does a 'clean' BIOS mean? It means it does not use any MS code
from their BIOS. We have studied the original code and boiled away
everything we did not actually need to get Linux to boot.

All of this work is aimed at getting the Xbox to interoperate with
Linux according to the provisions in the US DMCA and EUCD. Why is
it that the representatives of our countries place the 'rights' of
bloated Copyright owners so far above those basic rights of the rest
of the Citizens they are elected to represent? Can you imagine a
reason why they might do what the fat, rich owners of the media might
ask of them, instead of looking after our interests?


PRINCIPLES

 - We do not use ANY original Code and only a dozen or so non-code
   bytes from the start of the ROM

 - In fact we use a single X-Code instruction which subverts and
   aborts the X-Code interpreter, this X-Code was obviously not
   used by MS originally :-)

 - Our ROM does not contain ANY original code or keys from the
   original Xbox. So its kind of hard for MS to complain about
   any kind of copyright violation.

 - We use a standard Linux kernel with a suitable configuration for
   the box

 - Everything is compressed into a 1MByte BIOS image - so you will
   either need to be able to program a 1MByte boot flash
   (motherboard or LPC) in order to use this release, or you
   will need to use the CD BIOS launcher method.


IMPLEMENTATION

So what does this first full release actually do?

 - If you boot from the CD BIOS launcher, the CD will eject as the
   boot begins. This is normal; don't press eject again or you'll
   get a reboot.

 - during the boot, Linux unpacks a compressed ram filing system
   from flash, called initrd this stands for Initial Ram Drive,
   and it contains root filesystem (that is, /), the shell and
   other utilities like webservers, telnet daemon, etc.

 - Linux can see and init the Ethernet adapter, default startup
   scripts from the initrd assign it an IP and so make it visible
   to your LAN and the internet using standard protocols

 - we can use NFS to make directories from other machines read/
   writable to the box

 - Linux can also mount non-locked HDDs on the box IDE port. By
   default we do not mount any HDD. Although we have the code
   and keys to unlock the drive in software we decided not to
   issue it yet due to the trouble bugs would cause. It is
   believed that a UDMA drive of reasonably recent vintage is
   required for correct operation with the nVidia chipset
   currently.

 - our default scripts bring the ethernet up as 192.168.0.64, 
   netmask 255.255.255.0 (<---set in ./bootdisk/etc/init.d/rcS).
   So what can you do with this default setup?

 - http://192.168.0.64    your box wants to tell you something
 - telnet 192.168.0.64    yes - a shell prompt


Source Package

./crom/                     The C BIOS ROM

 boot.h                     constants needed by ASM and C
 consts.h                   constants needed by C

 BootStartup.S              from-reset init, jumps into C
 BootResetAction.c          C manages reset sequence, calling other subs
 BootPerformXCodeActions.c  C to perform peripheral init
 BootPciPer...lization.c    C to perform more detailed peripheral init
 BootPerfor...onseAction.c  I2C code, PIC watchdog, LED setting
 BootVgaInitialization.c    C to bring up the video, not working yet
 BootLinux.c                C to bring up Linux kernel, not working yet

./kernel/                   Kernel patches and configuration
 config                     minimal kernel .config
 pci.c                      substitute for linux/drivers/pci/pci.c

./initrd/                   The initrd contents before packing

 busybox-0.60.3/            Busybox shell library
 busybox                    Symbolic link to current busybox library
 bin/                       contains syslinux 
 initrd.src/                contains the default filesystem
   etc/                     configuration files go here
    init.d/
      rcS                   Startup script sets up IP address/mask, etc
    boa/
      boa.conf              Configuration for boa
    initab                  Maps system actions to scripts
    group                   Maps users to the login group they belong to
    passwd                  Information about users and home directories
    fstab                   What partitions or devices to mount where
    mime.types              Maps Mime types to file types for boa
   lib/
    modules/
     2.4.18/                Kernel modules for our version
      xbox_proc.o           Customized proc filesystem driver
      nvnet.o               nVidia network driver compiled against 2.4.18
   mnt/                     Other filesystems can be attached here
   proc/                    A synthetic filesystem that reports
	                           information about the system using text files
   sbin/                    Contains executable files mainly for root use
   usr/                     Files that are for all users
    httpd/                  The boa webserveruses files in here
     htbins/                CGI scripts for the webserver
       info                 a CGI script used to present information
                              about the xbox state in a remote browser
     htdocs/                Root directory for the web server content
      index.html            The default page for the whole webserver
      yourbox.jpg           picture
      freedom.jpg           picture for webpage
   var/                     Logs go here
	  httpd/                  Web server logs

	build                   Main build script.  You will probably need to 
                              edit the LINUX variable on line 26 to point
						 	  to your linux distribution you will be using

./xbe-boot-bin/             Source code for CD BIOS loader
  xbeboot.S                 Xbox kernel escape and BIOS boot code
  xbe.S                     XBE header
  font.S                    8x16 VGA font for debug messages
  logo.S                    Tux the penguin


ROM Package

./xbox-linux-0.1.bin        1MByte image to be burnt into flash BIOS (
                            LPC or motherboard)
                            Note there is no video yet, but the network is up


Bootable CD Package

./xbox-linux-0.1.iso        ISO ready to burn CD that will start up Linux
                            Note there is no video yet, but the network is up


BUILDING

The "build" script takes care of the complete building process, but note
that the commands replacing your kernel configuration are disabled in
"build" by default, to avoid accidently overwriting your current configuration.
Just use the configiration from the kernel subdirectory, and replace the
file linux/drivers/pci/pci.c with the version provided.
The build process will create a file xbox-linux-0.1.iso, which can be
written to CD, and image-rom.bin, which can be copied into a ROM chip.


ENVIRONMENT

Once you are booted, what does the envirnoment inside the box look like?

Note that as the system is setup, you are automatically logged in as root.

The / filesystem is a 4MByte ram drive called /dev/rd0.  Around 2.7MB
is free.

# ls -l
drwxr-xr-x    2 root     root         1024 Aug 16  2002 bin
drwxr-xr-x    1 root     root            0 Jan  1  1970 dev
drwxr-xr-x    4 root     root         1024 Aug 16  2002 etc
drwxr-xr-x    3 root     root         1024 Aug 16  2002 lib
lrwxrwxrwx    1 root     root           11 Aug 16  2002 linuxrc -> bin/busybox
drwx------    2 root     root        12288 Aug 16  2002 lost+found
drwxr-xr-x    2 root     root         1024 Aug 16  2002 mnt
dr-xr-xr-x   24 root     root            0 Oct 16 04:29 proc
drwxr-xr-x    2 root     root         1024 Aug 16  2002 sbin
drwxr-xr-x    5 root     root         1024 Aug 16  2002 usr
drwxr-x---    3 root     root         1024 Aug 16  2002 var



THE FUTURE

Microsoft have apparently made revisions to the ROM in the MPCX chip 
which are intended to break our code. At the time of writing (2000-08-16) 
these 'version 2' boxes have not been seen in the wild. We know that 
they are coming because nVidia, Microsft's uncomfortable looking partner 
in this endeavour (all of Microsoft's partners get that uncomfortable 
look after a while, like they want to put a little more distance between 
their body and the Microsoft guy they're standing next to, but they don't 
dare let them know they feel that way; cf Intel and Dell) told analysts
recently that some of their poor performance in the last quarter was due 
to having to write down stocks of obsoleted 'version 1' MCPX chips. This
caused a lot of amazement that nVidia had to take the hit for that and not
Microsoft, but its *Microsoft*, that's what its like to lie down with 
the Beast.

All of the Xboxes that are out today will work fine with our release, 
but another round of understanding the firmwware will be necessary before 
a version suitable for the 'version 2' boxes can be issued.


TODO

The next focus of development will be on making a genuinely friendly
distro, which will hopefully boot from CD directly from X like any
modern distro.


   -   *   -        -   *   -      -   *   -        -   *   -

If even one kid is saved from emptying his wallet into the livingroom
coinslot that is the retail Xbox, and instead turned on to how they
can contribute to free software for the enrichment of everyone's lives,
all of our work will have been worthwhile.
