LINUX CLEAN BIOS PROJECT (Licensed under the GPL)
http://xbox-linux.sourceforge.net/
Prealpha release 1  2002-07-27
By (alphabetical order):
  Andy (andy@warmcat.com)
  Michael (mist@c64.org)
  Paul (oz_paulb@hotmail.com)
  Steve

SCOPE

This is the first release of a 'clean' BIOS implementation intended to be
the basis of a BIOS capable to initialize all of the peripherals in an
Xbox (<-- TM Microsoft) and to be able to boot - 'interoperate with' - Linux.

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 a functional and stable boot.

In addition, all of this work is aimed at getting the Xbox to interoperate
with Linux according to the provisions in the US DMCA.
Much of the work is being done outside the US where as yet there are no
such unfair, corrupt and downright evil bad laws.


PRINCIPLES

 - We do not use ANY original X-Codes or 'Jamtable entries' 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 are interested in using the BIOS to get Linux running on the box,
   that is the only goal.


IMPLEMENTATION

So what functionality and facilities are available in this first,
prealpha release?

 - The box is booted, all of the PCI peripherals are initialized and
   placed into the memory map.  (No video yet, although we have written
   much code initing it)
 - The PIC watchdog challenge is performed, so avoiding being rebooted:
   we have full and stable control of the machine thereafter
 - 64MByte RAM is available from 00000000
 - C is supported (gcc), much of the BIOS is written in C
 - A compressed Linux kernel is patched in at +0x8000 in the ROM image and
   copied into Xbox memory.  We have not yet got this executing.
 - Functionality to control I2C transactions, eg, control the frontpanel
   LED, read/write the EEPROM is implemented.

There are additional functions available with the use of a hardware assist
called Filtror (http://warmcat.com/milksop/filtror.html), including
telnet-type communications for boot messages, and a debugging shell, by
default this code is disabled by a #define in consts.h.

In short we have control of the machine, we are able to write in C, we have
routines to control the truly critical IO (I2C, PCI), we can decompress the
Linux kernel, but we do not have video yet.


LINUX BOOT

In this prealpha release, the Linux boot code is never called. In order to
work on the Linux boot code, a bzImage has to be patched into the ROM image
at offset 0x8000 (32 KB) by lmilk (see Makefile) or any other method. On the
Xbox Linux website, a kernel patch is available to make Linux output kernel
messages to the Filtror device.


FILE DESCRIPTION

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
BootPciPeripheralInitialization.c        C to perform more detailed
                                         peripheral init
BootPerformPicChallengeResponseAction.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

You will also need to get amd compile a small utility called lmilk from
http://warmcat.com/milksop/milk.html which is used to insert the kernel into
the binary ROM image (and is also used if you have Filtror).

Run make and the ROM image, including the linux kernel, is available in
image.bin.patched.


TODO

There is a lot to be done before this ROM image is finished. The next few
avenues of development we would suggest are most important are

1) Getting the nVidia video device completely up and issuing a raster. If
anyone has experience with this they are VERY WELCOME to contribute. At the
moment we are initializing a lot of things in the chip but are still not
seeing a raster.

2) Continuing the process of starting up the decompressed Linux kernel

