I've recently acquired a fondness for the original Xbox from 2001, henceforth known as the Xbox Classic. It is very similar to an Intel Pentium III based PC with an Nvidia GPU. It is also a game console, which means that its hardware is (or was) completely static (with a few well-documented exceptions between the different versions) so you can be sure that even low-level programs written for one Xbox will run on another. The Xbox's security features were thoroughly broken soon after its release, so there are many ways of getting unsigned code to run on it. Further, even though I insist on calling it a classic console, it is usually not yet regarded as a retro console so there are lots of tiny things to improve on it for the keen hacker. All of these reasons tempt me to try to develop some toy programs for the Xbox Classic.

File transfer protocol(s)

A practical example that I have in mind is a file server. Not for actually storing generic files, but for easily transferring Xbox games to and from it. The Xbox scene settled on FTP for this, but FTP is a terrible protocol. See FTP Must Die for a whole list of its shortcomings.

Fast local area networks that were around even in the early 2000's hide some of FTP's deficiencies. For example, setting up a new TCP connection for every file isn't that costly when the network latency is less than a millisecond. And when everything runs at the same speed on an unsaturated network there is next to no packet loss. But fast forward 10 years and gigabit speed network equipment is getting into homes. So now we have mixed-speed networks and FTP's problems are getting noticeable again because it now needs TCP to do flow control.

It seems to me that the TCP stack in the Microsoft XDK (pirated versions of which have been used to compile the popular dashboards and utility programs for the Xbox) maybe isn't as good as it could have been, as it doesn't seem to handle lost packets well, but nevertheless there is the issue of negotiating a new TCP connection for every file transfer.

Looking for alternatives to FTP I wanted something that was fairly simple to understand the workings of. It should run on a single or at least constant number of TCP connections. It should preferably not attempt to be encrypted or secure in any way other than maybe having a simple authentication scheme. Let's be honest here: this is a toy project that I will probably abandon when version 1.0 is out (if not sooner) and I will certainly not be immediately issuing security updates when new bugs are found in SSH or TLS. It's going to be designed for secure (home) networks. The protocol should also be light on multi-user features like locking, as this is basically a single user machine.

Rsync is such a protocol. While often run over SSH, rsync can also run in daemon mode, serving files over its custom protocol. Since it is bundled with most Linux distributions, most Linux users will not have to download anything in order to transfer files to and from their Xbox. There are also Windows clients available.

As a proof of concept I have built the latest version of rsync on X-DSL (Xbox-Damn Small Linux) and run it in server mode (rsyncd). It works quite well and will almost saturate the 100 Mbps Ethernet connection (around 9 MB/s average for a typical Xbox game directory tree).

So this will be my new project: A tiny Linux distribution that basically only runs rsyncd and serves the Xbox local file systems over the network. Next up I'll compile an Xbox compatible Linux 2.4 kernel.

Next Post Previous Post