IraqiGeek's Blog

Modded PHProxy 0.5b2

Ok, after about a year and a half of waiting, whiteFyre finally released a much awaited update to his popular PHProxy script. It was more like a major rewrite than an upgrade, but it fixed quite a few issues that PHProxy 0.4 suffered from. However, the new version still lacked descent filtering capabilities, and had no logging capabilities, which is vital to catch offending users and keep the filtering capabilities up-to-date. So, I took it to myself to add those two functions during the past two days, though I'm not much of a PHP programmer. Without further ado, here is my modified logging and filtering version of PHProxy.

Using a PS3 for raw image conversion

Earlier this year, I did some reading about the IBM-Sony-Toshiba Cell processor architecture, with its eight SPE (Synergistic Processing Elements). Like I said in a previous post, I believe that the Xbox360 tripple core PowerPC processor has more appeal for general purpose applications, but now that I am working on digital image processing applications, the two Cell processors inside Sony's Play Station 3 console start to look really appealing. There are quite a few reasons why a PS3 would rock if used to carry the heavy procesing required in digital image processing such as raw conversion and photo retouching. First, such applications lend themselves very well to heavy multithreading since most of the processing is simply running one or more functions iteratively on each pixel, so adapting code to run on the Cell's SPE units shouldn't be a complicated task. Second, The fact that each SPE has its own high speed local memory that is accessible and addressable by the softwre running on the main PPE (Power Processor Element) PowerPC core means that the application can quite easily load the image data they want to each of those processing elements. Now, even with two Cell processors on board the PS3, I doubt the computation power would be anything close to what your average Geforce 7 or ATI 1xxx series graphics card can deliver. However, those SPEs inside the Cell processor should be much easier to program, like I said because each has its own memory that the application running on the PPE core can access and program. Now that we have Linux running on the PS3, it would be interesting to see someone port, or create things like image processing, audio and/or video transcoding applications that can take advantage of the considerable amount of processing power that all those SPE units have to cut down processing times. Why am I concerned? Because I started working on an application that allows photographers to adjust raw digital images prior to debayering/demosaicing those images to full RGB. Since then, my work expanded into the raw conversion process itself, where I managed to come with my own debayering algorithm. I am still working on adding support for the various camera makers raw file formats but hope to get the chance to port my code to something like a PlayStation 3 which would allow my application to execute several times faster than any x86 desktop or workstation available today and probably anytime in the next year, if not more.

What can an Xbox 360 running Linux do?

I wonder how long, we will have to wait until the Xbox 360 is hacked, and some form of Linux port is run on this machine. It’s just a matter of time until someone figures out a way to hack the Xbox 360 protection, and figures out a way to get Linux up and running on this gaming console. We may even get a whole Linux distribution targeted at the Xbox 360. While the Xbox 360 is sold as a gaming console, under the hood, it packs a lot of processing power that is on par with a powerful server that costs about 30 times the price of this $299 console. Its true that a server costing $10,000 will pack much more RAM, a hell lot more storage space, and be designed from the ground up for reliability and 24/7 availability, but I will bet that the Xbox 360 with its IBM powered triple cores running at 3.2GHz will give a lot of those servers a run for their money when it comes to processing power, even though it only runs on 512MB of RAM. If we look a little closer at game consoles, while they may not be designed by the same high standards as the server market products, they are still designed with enough robustness to tolerate extremely long operation hours. Think of 12+ hours a day. Generally speaking, your average piece of hardware reaches thermal equilibrium about after 20 minutes of operation. If any component wants to fail, it will fail not so long after that, mostly due to thermal stress. Gaming consoles are generally manufactured with pretty high standards, probably even higher than many brand name computers which cost a lot more. In fact, gaming consoles are designed to tolerate a lot more abuse, require minimum to no maintenance, and survive a longer life cycle than your average PC. After all, no one will buy a console that fails after a few months of hard core gaming. Personally, I think that the Xbox 360 makes for a better and more practical hardware platform than the Play Station 3 will make. This is mainly due to the choice of processing platform that each console uses. While both will be powered by an IBM made chip, the Cell processor on the PS3 with its 8 SPEs (Synergic Processing Elements) and one general purpose processing core is a much harder platform to work with, and being a new idea, we will have to wait to see how well this combination performs. On the other hand, the Xbox 360 is powered by three general purpose processing cores, which is very similar to having a regular computer with three processors installed (take a look at this article from Tom's Hardware) is relatively easy to deal with when developing new code or when porting applications from other architectures, or platforms. Think of having an Xbox 360 running Linux with three 500GB drives attached through USB 2.0 running in a software RAID 5 configuration, for a redundant 1TB of storage, protecting your network from all the evils on the internet, converting all those music tracks you have, compressing all that vacation footage for DVD burning, acting as a centralized repository for all those files you have, storing all those backup images of all your home boxes, acting as your home asterisk VOIP PBX, while folding all those proteins, all while playing that DVD you want to watch on your TV without dropping a single frame. Some may argue that the Xbox 360 processor beast may be limited by its not so impressive 512MB of RAM, which is not upgradeable (at least not as far as I know), but I think this is more than compensated for by its blazing fast memory interface running at 700MHz DDR, delivering a stunning 22.4GB per second of data for the IBM CPU to work with. This fast memory interface reduces the impact of having a large cache on the CPU because it greatly reduces the penalty of a cache miss on the CPU. Considering that Linux and Linux applications and services aren’t as memory intensive as Windows, 512MB may turn to be plenty of memory to work with. There are a lot of examples on the net of people running a hell lot of servers on an old box with 128MB or less RAM on an old 200MHz Pentium box, and never complaining of lack responsiveness. If we look at the majority of applications and services that users run on their home computers such as media encoding, watching DVDs, listening to music, and others, they aren’t bound by the amount of RAM available, but rather by the speed of your storage sub-system, and the amount of processing power available. This is where the Xbox 360 shines. In theory, the three cores on the Xbox 360 processor can run up to 6 threads concurrently. At 3.2GHz per core, and factoring in how efficient the PowerPC architecture is, and you get an idea of how much stuff you could do with a hacked Xbox 360 running Linux. So, what can the Xbox 360 do with Linux on board? A hell lot.

My own Linux build

Yesterday, after a few delays, I finally finished my build of LFS (Linux From Scratch) and was able to successfully boot and login into this build. If you know LFS, you will already know that this is nothing big. Its not like I made your next Redhat or Suse distro. For those who dont know what LFS is, its just a base system build entirely from source code which can be used as a basis to build a full distro (provided that you have the time and the huge processing power resources) or a small task specific linux system. Currently, I am continuing with the BLFS (Beyond Linux From Scratch) trying to make that base system usable for some real world applications. One thing I want to do is build a root filesystem image and upload it on this blog so anyone who wants a base linux system for use in building their own linux system from the ground can download it without the need to reinvent the wheel like I did. One issue I am facing, is that the image I am getting from using dd is the size of the partition on which the system was built, even though du'ing that partition will reveal that I am using only 413MBs of space (which IMO is still too large considering that this is just a base system that can't do any real world task). As soon as I figure out a way to build an image that reflects the size of the actual system on the disk, I will zip it, and upload it somewhere here on the website.