This page explains my project: OpenBSD on the MS Xbox. If there is any progress, I will publish it here. Since the old Xbox can run Linux (see http://www.xbox-linux.org), several other operating systems have been ported to the Xbox:
My name is Markus Ritzer, I study computer science at the technical university of munich where I have to do a system development project (in german: SEP, Systementwicklungsprojekt). I asked Michael Steil, the founder of the Xbox linux project (I used Xbox Linux a lot - so I wanted to give something back), if there is something that could be done for the project that I could also use for the project at university. His idea was to port NetBSD, and I started with that, but since January 2007, there is already a port for the Xbox, and so I switched to OpenBSD. The official beginning of my SEP is April 18th, 2007, and the end is July 18th, 2007.

More pictures here
The project is finished now (the port is not completely finished), and the most important parts are working. The kernel boots, memory gets initialized, there is output on the TV, network is working, the root fs gets mounted, users can log in and work with the system. But there are still things that could be done (see below). I have to do other things now, and I don't have time anymore to continue and completely finish the port. But the inhibition threshold for others who want OpenBSD at the Xbox should be very low now, the most annoying and time wasting problems are solved. I hope somebody will complete the port (please let me know if you plan to do so).
The Xbox isn't supported as an official platform by the OpenBSD developers, a pity.
A big thanks to the NetBSD and FreeBSD Xbox port, I have taken some code from there, and to all the other people that helped me.
I have only tested it on a 1.0 Xbox with 128 MB RAM!
last update: July 6th, 2007
Primary goals:
| goal | reached | comment |
|---|---|---|
| memory management | yes | size of the kernel is hardcoded; value should be taken from the linker script |
| framebuffer driver | yes | needs to be integrated in the system console |
| system console | yes | a lot of work!! |
| mount root file system | yes | from HDD, device name must be in kernel config |
| you can login and work with commandline | yes | |
| PCI enumeration bug fixed | yes | code taken from the NetBSD port |
| corrected timer frequency | yes | |
| reboot and poweroff works | yes | code mostly taken from NetBSD |
| write installation manual and kernel patch | yes | see below |
| write a detailed report in PDF and send it to all the helpers | yes | this is the report that I need for university; see below |
Secondary goals:
| goal | reached | comment |
|---|---|---|
| network driver | yes | I have a nfe0 device. The driver needed a little bit of patching |
| eject cd button support | no | On other OS, Xbox crashes when the open CD drive button is pressed, if not handled correctly |
switch to OpenBSD -current | yes |
Other goals
(just in case I have enough time, but these are not important to me):
| goal | reached | comment |
|---|---|---|
| X-Server | no | (see below) |
| write an installer | no | (not planned) |
| read hardware monitoring sensors | no | (not planned) |
| FATX file system implementation | no | (not planned) |
| Audio driver support | yes | driver was already in OpenBSD, I just activated it in the kernel configuration; I tested it, it was working out of the box |
When you type dmesg, the message
sysctl: KERN_MFGBUFSIZE: Device not configured
appears. A reason for this could be that kernel and userland are out of sync. The problem is the magic number of the buffer. 0xffffffff is passed, but 0x63061 is expected. So there is no dmesg output.
These two functions are not implemented. They are needed in order to run the X-Server (which suppots framebuffer devices with the wsfb driver).
You cannot scroll back in the console. The function header scrollback() is in the driver, but, however, it is not implemented.
The same is true for Alt+X screen switiching in the console.
Due to the lack of the interrupt handling framework on the SMBus in OpenBSD, there is no possibility to handle this problem (in my opinion).
Details on this problem can be found at:
It seems that the CD/DVD drive is not found or recognized.
Cromwell can't read the kernel from a FFS partition. Add FFS support to Cromwell. There are already the appropriate function headers.
EDIT: There is a patch for Cromwell made my Rink Springer, download it here.
See here on how you use it.
Write drivers for the eeprom (like NetBSD has one), the gamepad, the temperature sensors and the FATX filesystem of the Xbox.
Write an installer, so it's easier to get OpenBSD on the Xbox. Provide a LiveCD.
Cromwell should tell the kernel, how big its image is. In other words: the kernel needs to know the address of the first free page of the memory, in order to set up memory management.
For convenience reasons, there should be an installer to make it easier to get OpenBSD on the Xbox. A LiveCD for quick testing could be provided.
The content of the project homepage could be transferred into the Xbox-Linux Homepage.
This port should be tested on all hardware revisions of the Xbox. I tried it only on a 1.0 Xbox with 128 MB RAM. However, the RAM size shouldn't matter.
The framebuffer driver should set up the video mode itself and not rely on Cromwell.
A userspace tool to control the LED would be nice.
i386), compiled own kernelboot/compressed/misc.chead.S, learned assemblerlocore.S), compiled it, burned it to a DVD, booted it on the test-Xbox, it worked!locore.S and machdep.c; learned where the kernel panics cpu_configure()cpu_configure()vesafb driver; later switsching back; attach_mainbus crashes and I don't know whypmap_zero_phys_86() to make something change on the TV; until now, I just have black and white bars. My attempt works, I can display one-colored areasBUS_SPACE_MAP_LINEAR and bus_space_vaddr() don't exist on i386!output_char() of the Darwin port I can now draw characters and strings. This was in April 2007! \n handling, standard printf() works; however, the console is not integrated correctlyicsphy0 now.-current, but there a problems with the pci enumeration bug-current is doneconfig_found() and xboxfb_alloc_screen() workingprintf()wd0 it accepts it and mounts the fs. You can login then.nfe driver doesn't seem to work proper, added a flag to the icsphy driversnapshotsnfe driver. Taken some lines from the NetBSD driver. Now it works!setled()-Function.last update: July 16th, 2007
There is no one click solution to try OpenBSD yourself. But I can give a detailed step-by-step guide what you have to do in order to make your Xbox boot OpenBSD.
2.41-dev on it; see www.xbox-linux.org for details; I worked with this cromwell image and this one with FFS support.-current tree from CVSlinuxboot.cfg in the root directory of your CD/DVD with the following content: kernel isolinux/xbox
I think that should be enough; isolinux is the directory with the kernel, xbox is the name of the kernel file itself
Kernel übers Netzwerk booten)dhcpd.conf DHCP-Server configuration file; 192.168.2.2 is the pc, 192.168.2.1 is the Xbox; also look at the MAC address of your Xbox (I think Cromwell tells you what address your Xbox has)allow booting;
allow bootp;
authoritative;
ddns-update-style ad-hoc;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.20;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
}
host 192.168.2.1 {
hardware ethernet 00:50:F2:60:8D:5A;
fixed-address 192.168.2.1;
option host-name "xbox-neu";
option root-path "/xbox";
next-server 192.168.2.2;
filename "xbox";
}
Be careful with the ”s. Again, xbox is the filename of the kernel. next-server is the IP address of the TFTP server.
xinetd for this; should be installed on every modern linux distribution./etx/xinetd.d/tftp:service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = nobody
group = nobody
port = 69
server = /usr/sbin/in.tftpd
server_args = /home/markus/xbox-neu/tftpboot
disable = no
}
server_args is the line with directory holding the kernel file; that means, the kernel file is /home/markus/xbox-neu/tftpboot/xbox
Note that there are no ”s in this file.
xinetd: killall -HUP xinetd
tftp localhost
to connect to the server and
get filename
to download the file called filename. This should work now.
sudo dhcpd eth0, where eth0 is your network interfaceconfig bsd root on wd0a swap on wd0b
I haven't tried using a root fs from NFS, but probably this works also.
Here are the documents that I had to write for university.
Antrittsvortrag, ca. 800 KB
Abschlussvortrag, ca. 440 KB
Detailed Report, about 330 KB. This is my system development project.