LinuxMCE Forums

General => Developers => Topic started by: csudcy on June 12, 2007, 11:40:26 pm

Title: Using XBox as an MD
Post by: csudcy on June 12, 2007, 11:40:26 pm
Firstly, hello to everyone & LMCE looks blooming amazing!

Secondly, to business:

I know XBox as an MD has been discussed before and I think it's a really good idea (£40 for an MD!). Ive read http://plutohome.com/support/phpbb2/viewtopic.php?t=110&start=30 (there is an archived verison here but Im linking to Pluto version as it has usernames) but the last post on that was over 6 months ago - wondering if anymore has been done? (Ive also just read the 'Diskless Boot Image' thread on the dev board I didnt find that as useful) I bought an XBox from eBay yesterday (Ill fallback to XBMC if LMCE doesnt work but I really hope it will) so I can work on this - just finished my exams and there's 2.5 weeks of term left - have to fill it somehow! So, Ive read about PXE now and it is not quite what I thought it was - I assumed LMCE compiled all the necessary files into one file to send to the MD (and therefore, it would involve changing config files and make) but it seems the MD gets them individually form the TFTP server. So, does that mean I would be using config & make on the vmlinuz (& possibly the initrd but, if I understand that correctly, it wouldnt need changing)? I have installed LMCE on my Kubuntu Feisty laptop - havent tried network boot yet because I dont have a crossover cable or hub to connect my desktop to the laptop.

So, has anyone done anything else on it since Nov 06? Im hoping darrenmason on here is the same darrenmason on Pluto forums so you might be able to give some help :).

Also, I dont have the XBox yet but Im guessing its most likely to be a 1.6 so I believe it will need a modchip & a rom with network boot - is Cromwell the only one that does network boot? Any recommendations for a modchip? sorry if Im not supposed to talk about this kind of thing on here.

Think thats all for now - any hints/tips would be much appreciated. Oh, Im a total XBox noob but have been using Linux on my laptop for over a month and on my departments computers for 4 years (University of Warwick, Im in my final year of Computer Science). Hope all of that made sense!

Thanks,

Nick
Title: Re: Using XBox as an MD
Post by: darrenmason on June 13, 2007, 02:14:53 am
I have not done much more since that thread unfortunately.

I was having no luck getting a kernel built that I could get to work using the PXE software that comes with cromwell.
Each time I tried something new I ran into a problem. Shifted my kernel compile to the actual XBox (Was doing it on the core) and didn't have the disk space, tried mounting remote drives and then got some permission problems. Sort of lost enthusiasm/motivation at this point.
Was also a bit put off as I was not getting good performance from PCs with similar specs (but more memory) to the XBox.
I think the tasks needed to do still are;
* Build a kernel using a mixture of the Pluto kernel source and XBox patches.
* Get the XBox to run this kernel, either using PXE and manually updating the CORE or by just installing it on the disk.
* Setup swap files etc on local XBox disks (even with network boot). I think this will definately be necessary.
* Then get all thej bits to work - this should not be too hard as most of the XBox linux projects have already attacked this (eg . lirc for remote and controllers, nvidia drivers, USB hubs).

Big problem with doing it with linuxMCE is that as far as I know they are not releasing the source to their releases. This is really worrying and certainly hinders anyone else from doing any modification that can be merged back into the project. This is the one reason why I still have most of my main components running Pluto (rather than linuxMCE) and I just have a single machine that I have started to play round with linuxMCE on.

There are heaps of websites telling you how to get cromwell onto the XBox, which if you just want to run linux on it - then that is all that you need.

If you get it and are still keen I would be willing to work together to try and get something working. I don't think that there is any reason why it won't work. I think it is just a matter of persistence. Most of the big problems have already been solved by others. Like I said I am a bit unsure about the performance because it looks like Orbiter and some of the other pieces seem to be very memory hungry, but it is ceratinly worth trying.

If not, then running XBMC on it works well and you can certainly see your media from the core and play it etc. You can also use it as a Myth Frontend.

Regards
Darren
Title: Re: Using XBox as an MD
Post by: ddamron on June 13, 2007, 07:15:19 am
I'll be watching this thread with much interest... I don't have an Xbox (yet) :)

BTW, Sony just released their PS3 version 1.8 which is supposed to be DLNA compliant... there's been a bunch of activity on myth's boards about it...

Good luck 2u2 on this project!

Title: Re: Using XBox as an MD
Post by: sharlee_angelo on June 13, 2007, 12:35:53 pm
@darrenmason
the sources of LinuxMCE are released under GPL. and the "pluto" kernel is not a special one. it's just the kernel from Kubuntu. so, you can apply some patches and build a custom kernel which will be used by linuxmce to boot or to install on an Xbox MD.
Title: Re: Using XBox as an MD
Post by: kir on June 13, 2007, 03:00:58 pm
@darrenmason: there is even instruction how to build LMCE from scratch ;-) http://wiki.linuxmce.com/index.php/Building_From_Source  also it is about 1.0 at the moment
Title: Re: Using XBox as an MD
Post by: csudcy on June 13, 2007, 10:17:14 pm
Hmm well, that does sound more difficult than I first imagined but I will definitely still try! Unfortunately, the XBox hasnt arrived yet so cant do anything (even after it has arrived, Ill probably still have to order a chip). I installed LMCE a couple of days ago though (got through it after it decided to uninstall KNetworkManager) but I have since removed it as it was screwing things up on my system a bit (I think graphics overlays have problems now) and will make a partition just for LMCE.

One question - to build stuff for the XBox, do I have to use the XDK? As a side effect, would that mean the binaries could not be included in the LMCE install as they're illegal (at least, that seems to be what XBMC believe since they will not distribute binaries)?

Nick
Title: Re: Using XBox as an MD
Post by: darrenmason on June 14, 2007, 01:31:40 am
@darrenmason
the sources of LinuxMCE are released under GPL. and the "pluto" kernel is not a special one. it's just the kernel from Kubuntu. so, you can apply some patches and build a custom kernel which will be used by linuxmce to boot or to install on an Xbox MD.
sharlee_angelo,
Where are the latest sources? When I tried to find them I could only find the original sources from the 1.0 fork than ran on Ubuntu 6.10. A few people have asked this on other threads as well.

wrt. the kernel, I have only done the above with Pluto (ie: not linuxMCE) and it certainly had a custom built kernel which I was pretty sure had some updates. Since linuxMCE does not have the same dependency on controlling the OS it may be easier to get this working.
Title: Re: Using XBox as an MD
Post by: darrenmason on June 14, 2007, 01:36:41 am
One question - to build stuff for the XBox, do I have to use the XDK? As a side effect, would that mean the binaries could not be included in the LMCE install as they're illegal (at least, that seems to be what XBMC believe since they will not distribute binaries)?

Nick
No, you won't be using the XDK. The cromwell bios was reverse engineered without any microsoft code and then you are just installing a linux distribution on the machine.
I might have play with it on the weekend again.
Title: Re: Using XBox as an MD
Post by: csudcy on June 17, 2007, 05:41:46 pm
JUst an update on the XBox - parcel arrived yesterday but the post room closed by the time I woke up - hopefully Ill get it early tomorrow & see what has to be done.

Nick
Title: Re: Using XBox as an MD
Post by: ddamron on June 21, 2007, 06:38:58 am
watching with bated breath.... hehe
Good luck!
Title: Re: Using XBox as an MD
Post by: csudcy on June 21, 2007, 11:58:02 am
Right, another update - going to try to flash the XBox with Cromwell today then try to convince LMCE to boot - tried it once already from xromwell just to see what it did but it didnt get very far at all.

Also, Ive been reading quite a lot and found a page that I think will be very useful - http://www.xbox-linux.org/wiki/Making_a_Linux_distribution_Xbox_compatible_HOWTO

Anyway, just wanted to let everyone know I havent givent up on it yet.

Nick
Title: Re: Using XBox as an MD
Post by: ddamron on June 21, 2007, 07:26:16 pm
Thanks Nick, Good Luck!

... and still watching....
Title: Re: Using XBox as an MD
Post by: darrenmason on June 22, 2007, 02:02:35 am
Nick,

Have you built a patched kernel for it yet?

Darren
Title: Re: Using XBox as an MD
Post by: csudcy on June 22, 2007, 01:06:29 pm
Darren,
Nope, Ive still been playing around with trying to get the xBox to work (I have now flashed it with Cromwell so thats ready to go) and then decided yesterday things would be much easier if I installed LMCE on a VirtualBox image so I can do stuff in Windows and LMCE at the same time. Unfortunately, that took most of yesterday because there was a bug in VirtualBox that wouldnt allow me to run any of the (K)Ubuntu 7's which I spent quite a while trying to run then got an update for VirtualBox which now works fine with Feisty so I left LMCE installing when I went to bed, woke up just now & it has finished.

So, today is going to be the first actual trying to get it to network boot - I tried yesterday and it said pxelinux.0 was not a valid image. Assuming the pxelinux.0 is an unmodified version of pxelinux, I'm planning to get latest version and see if that says invalid also. If that still doesnt work, I think Ill get the pxelinux source and see if any patching needs to be done. However, I think you said you got past that stage - how did you sort it? After that, I guess it will be onto a boot->fix errors->compile cycle! Although, has anyone managed to find the 1.1 sources yet? Just checked and there's no new replies on the 'SVN' thread. Do you know if the MD stuff has changed between 1.0 and 1.1? I wasnt around for v1.0 but I would guess it has changed significantly and therefore working with 1.0 sources would not be a good plan. Not really sure what to do if the 1.1 sources arent available somewhere - contact Paul I guess. Hmmm...

Nick
Title: Re: Using XBox as an MD
Post by: csudcy on June 24, 2007, 01:54:13 am
Well, yesterday was not so smooth as I had hoped - though the LMCE installation was fine, the VM wouldnt actually boot up. After much trying, I gave up on that and started again but did a LMCE dedicated install. This now works but took another day to get there.

Today, Ive been fighting with gently poking  virtualbox's network settings - I cant find settings that let me use my network and do a network boot but I think I now know how to set each up. So, onto the network booting...

As has been said before, Cromwell wont boot from the included pxelinux.0 file. I tried the latest version of PXELinux - didnt help. I looked online for stuff about the error ("error not a valid image, unable to load file") and found somewhere that said etherboot does not like booting pxelinux (Im not sure if this is correct - I used etherboot to boot my desktop from my laptop LMCE installation and that worked fine - thoguh that could have been a later version of etherboot that is in cromwell) and suggested using mkelf-linux (from mknbi) to make an ELF for etherboot to run. I tried mkelf-linux with the append from pxelinux.cfg/default and the initrd & vmlinuz from default/ (made a 6mb file). This definitely worked better - lots of .'s printed onscreen (presumably, indicating it was downloading the file). Unfortunately, the .'s went off the bottom of the screen but I watched the network light on the XBox - solid/rapidly flashing for a while then stopped. Unfortunately, Cromwell didnt do anything after that 0 Im guessing there may have been an error message but because the .'s went off the screen, any error message was also off screen. However, when the first error ('unable to load file') was raised, Cromwell rebooted itself after a while. After the .'s it sat there for at least 30 minutes without doing anything (visible anyway).

I wasnt going to do anymore on it till tomorrow but writing this has made me want to try more - only useful idea is mkelf-linux without the initrd and hope it gets it through tftp. Ill see what happens...

Nick
Title: Re: Using XBox as an MD
Post by: csudcy on June 24, 2007, 03:44:29 am
Ok, Ive now actually bothered to read the Cromwell screen from Etherboot - version 5.2.4 and it says ELF and from reading more on Etherboot Im assuming this means it will boot ELFs. Ive just tried mkelf-linux with just vmlinuz and the .'s still go off the screen. Id really like to see whats at the end of those .'s! Other than trying to find out what the error message is (which I have no ideas for) I have one more idea - apparently Etherboot > 5.3.7 can boot pxe files. I could try to recompile Cromwell with an updated Etherboot - however, there could be many changes from the standard Etherboot and this would be taking the life of my XBox in my hands!

Scratch that, had another idea - if Etherboot could be compiled into an ELF then the latest version could be sent to Cromwell which could then load pxelinux.0! Excellent - an elf Etherboot can be obtained from Rom-o-matic using the 'forcedeth:nForce' rom type. Booting now...well, it says 'Loading Etherboot version 5.4.3' then 'Using cmdline: ELF'. Now tried with not waiting before booting (ASK_BOOT=-1). Then also tried with that and 2 different USE_STATIC_BOOT_INFO setups. All get stuck at 'Using cmdline: ELF'. So, I might be able to merge the 2 ideas - get the source code for Etherboot and try to apply changes made to the Cromwell version tot eh new version. Then compile it to ELF and use that. Hopefully the DHCP will cope with getting multiple DHCP requests from the same MAC address. Ill think more about that tomorrow - bedtime now!

Nick
Title: Re: Using XBox as an MD
Post by: csudcy on June 25, 2007, 04:34:03 am
Right, after a long day of source code Ive concluded the Etherboots cannot be chained (I think standard Etherboots could be but the Cromwell version does some XBox specific stuff after a standard Etherboot would finish). That took about half the day and since that Ive been trying to reflash my bios. When I flashed the bios previously, I used Cromwell 2.40. Since then, Ive read that CD booting in that version doesnt work. So, I had to install Xebian to the hard drive - should have been easy but my desktop wouldnt boot the graphical so eventually I got the basic Debian setup and then it worked fine. So, I now have my Bios flashed with Cromwell 2.41-dev which doesnt look that great but does work. When I compiled it I changed an option in Etherboot to see if it would still compile & run which it did (I was quite nervous when I flashed it with my own compilation - much possibility for XBox death!).

So, today I tried to Cromwell-ise the latest Etherboot. Tomorrow I will try to Etherboot-ise the latest Cromwell! Well, update the Etherboot version anyway. Then (hopefully) I can boot the standard pxelinux.0 (or at least get further than 'invalid boot image')! Then the 1.1 sources have to be hunted down...

Nick
Title: Re: Using XBox as an MD
Post by: csudcy on June 28, 2007, 02:42:43 am
Just thought I should give another update. Monday involved lots of source code, make files and waiting for things to make. I think progress was made - think there are about 20 linker errors left (about 10 unique) assuming I dont have to add any more files to the makefiles. Unfortunately, lots of the errors are to do with things that were specified in the Etherboot 5.4.3 ld files so I have to work out where to put them in the new Cromwell makefiles - Im guessing if I get this wrong I could kill my bios! On that note, anyone know of an xbox emulator where you can specify your own bios? I havent looked at all yet, I will after writing this. There is also another smaller problem - the Cromwell makefiles specify the target files not the source files (i.e. filename.o not filename.c) but I now have a file with extension .S so Im not sure how to make the makefiles use filename.S not filename.c for this one file.

Tuesday & Wednesday I was busy with other things. Hopefully Ill do more tomorrow. I was hoping to have gotten further with this before I left uni (leaving Saturday).

Nick
Title: Re: Using XBox as an MD
Post by: darrenmason on June 29, 2007, 03:38:04 am
Nick,

I don't know about emulators, but are you flashing to your actual bios or to a modchip?
My modchip has switchable banks so that you can flash to either and then switch between them. Therefore if you stuff one up it doesn't matter too much. I thought most modchips had this.

Sounds like you are making some progress.
You will definately need a new kernel though, I think linuxMCE is using an unmodified 2.6.20 kernel from other posts.
The XBOX patches only seem to go up to 2.6.16 - not sure if this will create problems.

Anyway, keep us informed.

regards
Darren
Title: Re: Using XBox as an MD
Post by: csudcy on July 02, 2007, 02:30:15 am
Hi Darren (and others),

I am flashing my actual bios - I hotswapped the hard drive and used the NDure install/exploit via XBoxHDM so no modchip needed. Im assuming (hoping?) that if I did kill my bios Id still be able to get a modchip and boot from that so I can then either safely reflash the onboard bios or - as you suggest- flash different bits of the modchip. Anyway, the could be a while away anyway - I did do some more on Thursday although not that much. Worked out why the assembly stuff wasnt compiling right - it needed ASSEMBLY to be defined but the makefile was using -DASSEMBLER. I added -DASSEMBLY and that now compiles - things still all crash at the linker stage though. After that, Ive done no more - Friday I was packing to come home from uni, Saturday I came home and today Ive been unpacking more and enjoying being home! So, now Im home I have some other things I need to do but hopefully I will get some more done this week but Im not sure how much time Ill have.

Nick
Title: Re: Using XBox as an MD
Post by: Zaerc on July 04, 2007, 09:07:56 pm
Excuse me for being a simpleton, but why not just install Xebian and go from there?  Chances are even that the  LMCE binaries (i386) will run under there. 

A network boot would be nice but if you have to flash the bios first that would kind of invalidate the ease of use in my opinion.  Personally I would prefer a solution that works with a softmod so you don't even have to open the case.  And it shouldn't be a problem to have multiple "dashboards" and/or systems installed like XBMC/EvoX/UnleashX/Xebian/Gentoox/etc. (even the original BIOS, if you want to play "live", for what it's worth).

That said, I might fix up the old Xebian install and have a stab at it too.  I never went as far as compiling my own firmware or flash the bios, and it's been a while, but I still have the stuff to build custom softmods (ndure). 

I think, but I'm not entirely sure, that the xbox kernel patch was mainly for providing "fatx" support (for reading/writing native xbox partitions, not really essential for what you want to do with it I reckon.

Either way, good luck and happy hacking.
Title: Re: Using XBox as an MD
Post by: darrenmason on July 05, 2007, 01:35:19 am
It is a fair statement, and this is what I had tried as well.

The main problem, at least as far as Pluto was concerned - assume it still applies for LMCE, is that there is code/scripts that forces checks between the CORE and all MD's to ensure they are using the same Kernel version.

My solution to this was to recompile a matching version with the XBox patches. I still think this should probably work. The only reason I didn't finish it was that I ran out of disk space on the XBox and lost enthusiasm to play around with it.

The other problem is the OS dependencies that exist. LMCE seems to be dependant upon specific distributions and their releases, so I guess you would need to get Kubuntu 7.04 running on the XBox. I don't think that anyone has done this.

I thought there was more to the Kernel patch than just the fatx support, but I havn't looked at it for a while.

I think it is desirable to determine what is actually required for just an MD installation and work  on just installing the MD components on a running OS. This then would open up a variety of machines to being MDs including XBoxs. Once you have it running as an installed machine then it should just be a packaging exercise to turn that into a network boot.

All that said, I was sortr of hoping that if the XBox network boot would work and it had a compatible kernel then the initial install that is done when adding an MD might just work, hence I am very interested to see what Nick can get working.

regards
Darren

Title: Re: Using XBox as an MD
Post by: Zaerc on July 05, 2007, 03:55:34 am
Shame you ran out of drivespace, you know you could just chuck in a bigger drive.  With a bit of preperation any old IDE drive should do, I upgraded mine to 250G.

I wonder if it's really all that necessary for them to all run the exact same kernel version, but I guess those checks are there for a reason. 

As far as the OS dependencies go, both Xebian and Kubuntu are derived from Debian, so the basics and infra-structure should at least be very similar.  Will probably be great fun to just add Kubuntu to the sources.list in Xebian and watch the sparks fly. ;)

When I get through with playing with my new LinuxMCE test system I could probably build a suitable kernel for this if that would help you guys out a bit.

Title: Re: Using XBox as an MD
Post by: Zaerc on July 11, 2007, 10:41:36 am
Aparently Grub can do PXE: http://www.gnu.org/software/grub/manual/html_node/Diskless.html#Diskless

But I'm guessing that it won't be easy to make a .XBE out of Grub.

Another possible option might be PXELinux: http://syslinux.zytor.com/pxe.php
Title: Re: Using XBox as an MD
Post by: Misogynist on December 08, 2007, 08:52:47 pm
Hi there - looked into this topic, because I think it still is interesting to use XBOXs as MDs .. Did you continue working on that project ? Maybe you could tell us how it went in the last time..
Would be a cheap and great way..
Title: Re: Using XBox as an MD
Post by: csudcy on December 09, 2007, 03:24:35 am
Hi,

Unfortunately, I got approximately nowhere. Everything I did do, I wrote about on here - I really didnt (and dont) have the necessary programming skills (I've only done a small amount of C/C++ and I remember trying to understand those linking files was difficult). But now, I use Xbox Media Centre (which I love) because I only have one Xbox (or anything that could be used for an MD) and that's in my room with my NAS (uses FreeNAS - £100 for box, £200 for 1.1TiB of RAID 5 disk). Anyway, when I get my own house, I may try looking at this again because I would love to have LinuxMCE throughout the house (I would really love the 'follow me' feature if I had enough MDs around). Anyway, if you have the skills it would be great if you could work on this. If not, I would recommend XBMC for playing media over the network (or from the HD) until someone else takes up the cause!

Nick