dinsdag 27 september 2011

Xbox Linux kernel development

As the development of Xbox Linux patches have halted since 2.6.16 (2006-03-28) I had the wild idea to develop the patches further to be compatible with the newer kernel sources (2.6.38 or 3).
The problem is that I don't have a lot of experience in C and none in assembly needless to say is that I haven't got any experience developing for kernels or drivers. I think this will be a nice challenge, good for the community (if anyone still uses the Xbox as a Linux machine) and it will broaden my knowledge of C and the Linux kernel.

Xbox server - W.I.P. #3

Friday I began connecting the VGA PCB to the Xbox, I finished this task Saturday so of course I tried the VGA PCB right away.
I then found out that I didn't got any image on the screen. First I thought this was because my monitor possibly wasn't compatible with the signals. So I tried a second monitor and again no image...

I didn't bother to troubleshoot until yesterday. Yesterday (of course when I wasn't at home) I thought of the mode setting that the Xbox requires and which wasn't handled by the PCB and possibly wasn't connected. This would explain why I couldn't get any image on both screens. So when I got home I saw the mode setting pins unconnected, this I immediately fixed in no time. I ran a test and.. again no image.
After a bit of searching I found out that to have a VGA compatible RGB signal the Xbox has to be set to NTSC in stead of PAL which is the default video mode here in Europe. Again this was fixed in no time. But still no image.

The mode setting was correct (mode 1+3) and the signal was NTSC so what else could be wrong?

The Xbox also needs a VGA compatible BIOS and I knew I had one. Cromwell to be exact. So I searched and searched and found nothing that resembled my problem.
So Cromwell didn't give me any visual response. Well I thought, let's try another BIOS, maybe it's just Cromwell trolling me. I still had a copy of Eurasia's generic flash disk laying around and a BIOS binary (Evox m8) on a CD so I flashed this. After flashing I rebooted the Xbox and kept my fingers crossed. And.. my monitor light changed from orange to green and I saw the flubber thing you're supposed to get. VGA worked!! A bit greenish but it worked.
Next I downloaded a VGA compatible BIOS, flashed it with Eurasia's flash disk and it did what I hoped it would. It corrected the colors and VGA was up and running. But how about Cromwell?

I again flashed Cromwell on the Xbox and rebooted the Xbox. Again no image. So maybe VGA isn't initialized at boot, but after Linux has taken control of the display? To check if my predictions were right I burned a copy of Xebian (as it was smaller to download/burn on a disk), popped it in the Xbox and booted it.
To my surprise it took a few seconds and then I saw a shiny happy penguin smiling at me. The display quality was better then expected, the colors were correct, I felt almost as satisfied as Tux.

Here's how I connected my VGA PCB.
The HSYNC and VSYNC points are accessible from the bottom side of the board. I took a bit of soldering tin and for both points I made a cone shaped pin.

Now it was time to solder wires to these pins. As always I stripped, twisted and plated the wires with tin. I then reheated the tin pins and connected the wires to the points.

Below is a picture of the Xbox main board where the AVIP connector used to be. I cleared the holes with very thin solder wick. After this the board was covered in remains of flux. I then cleaned the board with some acetone and a q-tip. The pin numbers are clearly exposed. and the board looks as good as new. The sync wires are visible on the right side of the picture.

The pin-out of the connector is as folowing:
1 VCC 13 Mode select 3
2 audio right 14 Mode GND
3 audio left 15 +12v
4 audio right GND 16 GND
5 audio left GND 17 pin19 GND
6 sp-dif digital audio 18 var (Blue)
7 H-Sync 19 var (Red)
8 V-Sync 20 pin18 GND
9 Mode select 1 21 pin23 GND
10 Mode GND 22 var (Green)
11 Mode select 2 23 var (Composite)
12 Mode GND 24 pin22 GND

The whole setup looked like this. In the top left is a composite to VGA adapter visible that provided me VGA output while my mod wasn't working, in the top right is the power supply visible, in the bottom left a 2.5" hard drive (the DVD drive is beneath the hard drive, there is a piece of paper in between to isolate the both), in the bottom right is the Xbox visible and in the middle is the PCB with a VGA connector connected.

And this was the display I did it for. As you can see the colors are normal and the display quality is like that of a normal VGA output.