Linux: Linux On Xbox

Submitted by Jeremy
on October 11, 2002 - 7:46am

Michael Steil, a member of the Xbox Linux Project development team, recently posted a question to the lkml looking for hints on how they should prepare their patches in the hopes of getting them merged into the main kernel tree. Michael explains, "As you might already know, we successfully run standard distributions on ("modded") Microsoft Xbox gaming consoles with only minimal kernel changes."

Alan Cox [interview] replied to many of Michael's questions. Regarding whether or not the Xbox patches stand a chance of being merged, Alan offered, "Probably. I suspect the primary questions are political/lawyer ones rather than technical ones. Things like the IDE drive password are touchy obviously but that can be done from an initrd loaded with the kernel I guess."

The Xbox is Microsoft's gaming console, IBM-PC-based hardware that runs a stripped-down version of the Windows 2000 kernel which only allows games to run. The Xbox Linux Project makes it possible to fully utilizie the Xbox hardware, running a complete Linux distribution. "Xbox Linux Mandrake 9" was released October 7th. According to the project home page linked above, "An Xbox running Linux is very useful as a desktop computer, as a (web) server or as a node in a Linux cluster."


From: Michael Steil
To: linux-kernel mailing list
Subject: Xbox Linux Kernel Patches Questions
Date: 	Thu, 10 Oct 2002 22:13:56 +0200

Hi!

I am Michael Steil from the Xbox Linux Project. As you might already 
know, we successfully run standard distributions on ("modded") 
Microsoft Xbox gaming consoles with only minimal kernel changes.

Our question is now what way our patches will have to be in order to 
have a chance for them to be accepted into the main kernel tree. I'll 
tell you a bit about our kernel changes first:

1) PCI chipset bugfix
The Xbox chipset has a PCI bug that makes the system hang when reading 
from 00:00.2 or 00:00.3 in the PCI configuration space. We have added a 
check that ignores these devices, embraced by #ifdef CONFIG_XBOX in 
drivers/pci/pci.c

2) System timer fix
The system timer runs about 6% faster than on a PC. We have added a 
#ifdef CONFIG_XBOX section to include/asm-i386/timex.h

3) Shutdown/Reboot
The Xbox doesn't support standardized APM to shut down and doesn't have 
a keyboard controller to reset the system. We have added code to shut 
down and reboot the Xbox in arch/i386/kernel/process.c.

4) No keyboard controller
There already seems to be a patch available that doesn't print 100 
warnings and allocate IRQ1 for the keyboard if there is no keyboard 
controller present and we add the command line parameter "kbd-reset". 
This patch is in 2.4.19-16mdk, but not in plain vanilla 2.4.19. Without 
this patch, we have an interrupt conflict on IRQ1.

There are some more drivers we're working on at the moment:

1) FATX driver
The Xbox uses a derivative of the MS-DOS FAT filesystem, but it's a lot 
simplified and completely legacy-free. Though, the file allocation 
table structure and the basic ideas of directory entries remain the 
same. We have done small changes to fs/fat/* and added a directory 
fs/fatx.

2) Xpad & remote control drivers
The Xpad (Xbox gamepad) driver module is already available in your 
latest development kernel, we can soon add additional or updated 
drivers for Xbox-specific (USB) hardware.

So these are our questions now:

Do we have a chance for our kernel fixes for the Xbox to be included 
into the standard kernel? All our changes are tiny and #ifdef 
CONFIG_XBOX and change nothing on a i386 PC or on any other 
architecture.

Would it be better to have a runtime check at kernel initialization to 
detect the Xbox and put all Xbox specific code between if (xbox) {}?

Can our FATX driver be accepted into the main kernel? It has been 
impossible to implement FATX on top of FAT without making the FATX code 
a bit more general. We hope that it wasn't too many changes there. By 
the way, FATX doesn't only make sense on the Xbox, it's a multi-purpose 
filesystem that might also be used for other applications, because of 
it's simplicity and its small kernel footprint. (Please note that our 
FATX code is still in beta).

Can our additional drivers be added to the standard kernel once they 
are finished?

Our project website is at http://xbox-linux.sourceforge.net/, we have 
our kernel changes in the CVS if you want to have a look at it. I 
didn't want to send a patch in this mail already, because we might have 
to discuss what way to do our patches first (especially on #ifdef 
CONFIG_XBOX vs. if (xbox) {}).

Thanks a lot for your time.

   Michael


From: Alan Cox Subject: Re: Xbox Linux Kernel Patches Questions Date: Thu, 10 Oct 2002 16:51:30 -0400 (EDT) > The Xbox chipset has a PCI bug that makes the system hang when reading > from 00:00.2 or 00:00.3 in the PCI configuration space. We have added a > check that ignores these devices, embraced by #ifdef CONFIG_XBOX in > drivers/pci/pci.c Can you tell the xbox by the subsystem id on the root bridges ? > 2) System timer fix > The system timer runs about 6% faster than on a PC. We have added a > #ifdef CONFIG_XBOX section to include/asm-i386/timex.h It isnt actually alone in that - 2.5 probably makes that pretty easy to accomodate. We have subtrees for x86 variants as a patch set now and used for the voyager platform. The newer IBM and certain other vendor "big x86" boxes are pretty weird probably weirder than X-box 8) > 3) Shutdown/Reboot > The Xbox doesn't support standardized APM to shut down and doesn't have > a keyboard controller to reset the system. We have added code to shut > down and reboot the Xbox in arch/i386/kernel/process.c. Ok. Thats true of some embedded x86 too > 4) No keyboard controller > There already seems to be a patch available that doesn't print 100 > warnings and allocate IRQ1 for the keyboard if there is no keyboard > controller present and we add the command line parameter "kbd-reset". > This patch is in 2.4.19-16mdk, but not in plain vanilla 2.4.19. Without > this patch, we have an interrupt conflict on IRQ1. The latest code has a kbd_present function. That lets you add the logic you need. > Do we have a chance for our kernel fixes for the Xbox to be included > into the standard kernel? All our changes are tiny and #ifdef > CONFIG_XBOX and change nothing on a i386 PC or on any other > architecture. Probably. I suspect the primary questions are political/lawyer ones rather than technical ones. Things like the IDE drive password are touchy obviously but that can be done from an initrd loaded with the kernel I guess. > Would it be better to have a runtime check at kernel initialization to > detect the Xbox and put all Xbox specific code between if (xbox) {}? IMHO yes. > the way, FATX doesn't only make sense on the Xbox, it's a multi-purpose > filesystem that might also be used for other applications, because of > it's simplicity and its small kernel footprint. (Please note that our > FATX code is still in beta). > > Can our additional drivers be added to the standard kernel once they > are finished? Yes - you should probably aim at 2.5 for merging rather than 2.4 however, especially for things like the FATX file system work.
From: Michael Steil Subject: Re: Xbox Linux Kernel Patches Questions Date: Thu, 10 Oct 2002 23:35:30 +0200 > Can you tell the xbox by the subsystem id on the root bridges ? Yes, these are unique. >> Do we have a chance for our kernel fixes for the Xbox to be included >> into the standard kernel? All our changes are tiny and #ifdef >> CONFIG_XBOX and change nothing on a i386 PC or on any other >> architecture. > > Probably. I suspect the primary questions are political/lawyer ones > rather than > technical ones. Things like the IDE drive password are touchy obviously > but that can be done from an initrd loaded with the kernel I guess. Yes, we have already moved the IDE unlock code into the bootloader and it won't be needed in the kernel for most systems, so it won't have to be included into the main kernel. All other changes shouldn't be (politically/legally) problematic in any way. >> Would it be better to have a runtime check at kernel initialization to >> detect the Xbox and put all Xbox specific code between if (xbox) {}? > > IMHO yes. So all all Xbox specific code would look like this: #ifdef CONFIG_XBOX_SUPPORT if (xbox) { ... } #endif Where would we put out Xbox detection code? If it detects the Xbox as described above, CONFIG_XBOX_SUPPORT will depend on CONFIG_PCI. Michael
From: Alan Cox Subject: Re: Xbox Linux Kernel Patches Questions Date: 10 Oct 2002 23:06:35 +0100 On Thu, 2002-10-10 at 22:35, Michael Steil wrote: > > Can you tell the xbox by the subsystem id on the root bridges ? > > Yes, these are unique. > Where would we put out Xbox detection code? If it detects the Xbox as > described above, CONFIG_XBOX_SUPPORT will depend on CONFIG_PCI. Which seems fair enough. ISA bus X-box systems are suprisingly rare
From: Greg KH Subject: Re: Xbox Linux Kernel Patches Questions Date: Thu, 10 Oct 2002 13:48:11 -0700 On Thu, Oct 10, 2002 at 10:13:56PM +0200, Michael Steil wrote: > > 2) Xpad & remote control drivers > The Xpad (Xbox gamepad) driver module is already available in your > latest development kernel, we can soon add additional or updated > drivers for Xbox-specific (USB) hardware. I'll gladly look over any USB drivers or changes. Feel free to send them to the linux-usb-devel list when you feel they are ready to be added to the tree. thanks, greg k-h

2.5 vs. 2.7

schneelocke
on
October 11, 2002 - 9:18am

Although I neither own an xbox myself nor have any plans to buy one, I would be happy to see xbox support merged into the main kernel. However, I'm wondering whether this should be aimed at 2.5 or 2.7; I'd be interested in hearing what others think would be the pros and cons of either approach.

--
schnee

2.7... man

David Nielsen
on
October 11, 2002 - 11:56am

I think the Xbox will be a bit dated when 2.7 development starts.. 2.5, but they need to hurry, the freeze starts in a few days - I think it should make it in there, considering that they have no drastic changes.

I also don't see any legal issues, it's not like they used the M$ SDK to develop this, it's AFAIK 100% Xbox Linux effort and charm.
(didn't everybody just love that Windows 2k running on Linux on the Xbox video... the irony)

FATX

Anonymous
on
October 11, 2002 - 3:36pm

hmm.. the FATX sounds nice.. just plug your Xbox HD into your pc and mount it =).. then you can do saved game editing and probably some other neat stuff with the data on there...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.