When Linus Torvalds’ practice with Minix led to Linux, the main development platform was a PC with the i386 architecture. Three years later, in 1994, he was asked to help Digital (DEC, or just Digital Equipment Corporation) port Linux onto the Alpha platform. After roughly a year, in 1995, it was officially declared that Linux supported two architectures — x86 and Alpha. However, unofficially, there was support for systems based on Motorola 68K as well.
At the beginning of the last decade, the Linux source tree had hardware support for a dozen architectures: x86, Alpha, Itanium, MIPS, SPARC, ARM and others. While several were designed to be used inside big crunching systems (Itanium, Alpha and SPARC), others like ARM, and the vast majority of MIPS, were focused on energy efficiency. Thus, almost all mobile phones today run ARM processors, just as tablets from Apple, Samsung, Acer and Lenovo. While one can find MIPS CPUs in the mobile segment, it isn’t widespread yet, because MIPS processors have conquered, and are concentrated in, various set-top boxes, DSL modems, etc. Surprisingly, you might find MIPS in several desktops and netbooks.
Today, we take a look at two systems with non-x86 CPUs: a TrimSlice H250 net-top (ARM-based) and a Yeeloong 8089 netbook (MIPS). The first is manufactured by CompuLab with software support provided by Canonical and Linaro, which made it possible to run Ubuntu for ARM systems. The second, manufactured by Lemote, uses the Debian MIPSEL OS. Additionally, do note that Lemote isn’t the only driver for porting software to MIPS. For example, the FSF fund is actively involved in the development of the Linux MIPS port, making possible the gNewSense distro.
Ubuntu at TrimSlice (ARM)
Canonical and Linaro’s joint efforts for Ubuntu on ARM means that you can find Ubuntu running on the Texas Instruments OMAP3/OMAP4 (BeagleBoard XM), Freescale i.MX5 (Efika MX smart-book), Nvidia Tegra2 (Toshiba AC100, TrimSlice) as well as a server appliance known as Project Moonshot, which is based on Calxeda ARM technology chips.
What is so remarkable about ARM? First, its extremely low power consumption — about 1.5 watts per CPU. Second, its chip size is much smaller than competing products. Third, there’s an integrated video chip built into the main CPU core. This symbiotic architecture offers a relatively cheap, but fairly efficient solution, because multimedia streams are decoded by specialised hardware video chips. True, you might not want to use it for a server with heavy loads (except ARM server appliances, where dozens of ARM CPUs work together), but as a desktop system for text editing, Internet browsing, and listening to music.
Let’s find out what this TrimSlice H250 net-top has:
trim@trimslice:~$ lspci 00:00.0 PCI bridge: nVidia Corporation Device 0bf0 (rev a0) 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03) trim@trimslice:~$ free total used free shared buffers cached Mem: 896120 879248 16872 0 7092 459192 -/+ buffers/cache: 412964 483156 Swap: 0 0 0 trim@trimslice:~$ cat /proc/cpuinfo Processor : ARMv7 Processor rev 0 (v7l) processor : 0 BogoMIPS : 996.14 processor : 1 BogoMIPS : 9.49 Features : swp half thumb fastmult vfp edsp thumbee vfpv3 vfpv3d16 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x1 CPU part : 0xc09 CPU revision : 0 Hardware : trimslice Revision : 0000 Serial : 0000000000000000
We can see that it really has a highly integrated core. The lspci command shows only a network controller and core bus information. There is no visible separate unit for sound or video, and even for disk I/O. Just compare it with your x86 PC for a contrast. Its RAM is only 900 MiB, though this box has 1 GB installed. The rest is allocated to video memory. The configuration parameters responsible for the allocation are in the uBoot bootloader’s configuration file
setenv memory mem=384M@0M mem=512M@512M nvmem=128M@384M setenv video vmalloc=248M video=tegrafb setenv console console=ttyS0,115200n8
This net-top can be equipped either with an SSD, or a 6.35 cm (2.5″) HDD. Let’s figure out what exactly CompuLab put inside our system.
trim@trimslice:~$ mount /dev/root on / type ext3 (rw,commit=0) proc on /proc type proc (rw) none on /sys type sysfs (rw,noexec,nosuid,nodev) devtmpfs on /dev type devtmpfs (rw,mode=0755) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) fusectl on /sys/fs/fuse/connections type fusectl (rw) gvfs-fuse-daemon on /home/trim/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=trim) trim@trimslice:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 240407392 227408564 789924 100% / devtmpfs 447912 500 447412 1% /dev none 448060 176 447884 1% /dev/shm none 448060 116 447944 1% /var/run none 448060 0 448060 0% /var/lock
Alright, obviously it has a bigger HDD (250 GB), and it is formatted as an ext3 partition. But the main secret is still unknown — how fast is this net-top? Let’s apply the test approach we used in the previous IBM pSeries article, “Linux on POWER”. We’ll run the 7zip archiving utility in benchmark mode. But before the test, let us update the system, making sure we have the correct settings for Ubuntu ARM repositories:
trim@trimslice:~$ cat /etc/apt/sources.list deb http://ports.ubuntu.com/ubuntu-ports/ natty-security universe main deb http://ports.ubuntu.com/ubuntu-ports natty-updates universe main deb http://ports.ubuntu.com/ubuntu-ports natty main universe multiverse ## Repository for Trim-Slice users provided by Compulab deb http://trimslice.com/download/ubuntu/natty binary/
aptitude update && aptitude safe-upgrade. Perfect. You can install the 7zip archiver:
aptitude install p7zip. Run it in benchmark mode, as follows:
trim@trimslice:~$ time 7zr b 7-Zip (A) 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30 p7zip Version 9.04 (locale=en_IN,Utf16=on,HugeFiles=on,2 CPUs) RAM size: 875 MB, # CPU hardware threads: 2 RAM usage: 425 MB, # Benchmark threads: 2 Dict Compressing | Decompressing Speed Usage R/U Rating | Speed Usage R/U Rating KB/s % MIPS MIPS | KB/s % MIPS MIPS 22: 633 135 456 615 | 14909 188 716 1346 23: 650 139 475 662 | 14749 189 716 1350 24: 640 141 489 688 | 13711 187 679 1272 25: 593 138 490 677 | 12709 169 708 1195 ---------------------------------------------------------------- Avr: 138 477 661 183 705 1291 Tot: 161 591 976 real 2m31.303s user 3m41.090s sys 0m7.320s
Well, this system appears to be not very fast, compared to an x86 PC. However, the significant advantage is, the net-top, including the active WiFi module and HDD, consumes roughly 5.4-6 W. Isn’t that great?
Next, let us check how fast Chromium and Firefox are with ACID3 and SunSpider tests. We can install them with
aptitude install chromium-browser and
aptitude install firefox. Then, let’s begin with the ACID3 test. Chromium passed without any problems (Figure 2), although it’s a relatively old version (10) in the repo. Next is Mozilla Firefox 9, which also passed the test without trouble (Figure 3).
The well-designed internal JS engines of both are unbeatable. Now we should try a more sophisticated benchmark, where CPU performance is important — SunSpider, as shown in Figures 4 and 5. Chromium shows marginally better results than Firefox.
The results may differ greatly from your desktop PC, but please consider the footprint and portability of the TrimSlice net-top! Don’t expect an experience like on a powerful desktop like an Intel Dual Core. Remember, we’re working on energy-efficient hardware, so there’s a balance between speed and energy consumption. But don’t worry — you can visit most websites. Moreover, the lack of (official) Flash support is definitely a plus — huge amounts of advertisements are thus blocked by the missing plug-in.
However, what if one wants Flash? Well, there’s a little hope; we could reuse the Flash library from Android tablets. Officially, Flash is supported on ARM-based Androids, though it has no dedicated download package at the Adobe site at all. Why take a chance with the Android version? Simple — this is the same Linux!
$ wget http://kotelett.no/ac100/phh/Android2.2/libflashplayer.so $ sudo cp libflashplayer.so /usr/lib/mozilla/plugins/
Let’s run Firefox and, voila! There’s Flash support on our TrimSlice unit now (Figure 6), despite the fact that it’s Ubuntu Linux with Firefox, and not Android.
Most important is stability — it’s highly advisable to use Firefox instead of Chromium; Flash with the latter managed to kill the entire system. What’s wrong is probably the V8 engine or general security, who knows!
Unfortunately, the Flash player cannot use the built-in Tegra2 hardware video acceleration, so it’s rather uncomfortable to watch videos with higher than 480p resolutions. Why this is so, we will try to figure out in the next section.
Video acceleration in Tegra2
Despite the fact that broad support for video and audio formats has been declared to be hardware accelerated by the Nvidia Tegra2 core, in practice, the situation is very poor. First, the Nvidia programmers’ efforts to ensure hardware decoding moved to Android land. I guess Nvidia is more interested in selling Android tablets based on their CPU than other computer boxes running Ubuntu, or other distros. As a result, some desktop and mobile products (the TrimSlice H250 net-top and the Toshiba AC100 smart-book) have no hardware acceleration in Linux at all. To reassure Toshiba users: though it comes with Android by default, it can be transformed into a normal Linux netbook.
Lately (December 2011), Nvidia announced that the SDK release for Tegra2 (L4T, Linux4Tegra) was out for free download — so we can expect hardware acceleration support in MPlayer/VLC/GStreamer soon. All I can say about hardware acceleration is that it really works well. The internally distributed Nvidia test application shows that 1080p video playback consumes just 25 per cent of CPU resources! With software decoding, there’s no such luck!
Unfortunately, neither MPlayer, nor VLC supports hardware acceleration features (functions) hidden inside Tegra2 chip. That’s why you can see such a slow playback for HD videos. If you compare Tegra2 with OMAP (another ARM CPU family, but from Cortex-A9 series), the latter will give you more software points and provide a better computational performance.
For example, Tegra2 floating-point implementation uses vfpv3-d16 instructions, while OMAP processors can run full-featured 32-bit instructions. There are also no extensions like SIMD Neon. Again, this can be surely compensated when graphics acceleration comes to town. Even the functions already in Tegra2 are enough to make a breakthrough.
Debian at Yeeloong (MIPS)
You can find a number of alternative solutions, which, like ARM, can be quite energy efficient, and suitable for the mobile sector. One bright example is the Yeeloong 8089B netbook from Lemote. It has 1 GB of installed RAM too, a 6.35 cm (2.5″) HDD, but only of 160 GB. It features a Loongson 2F processor at 800MHz.
It was manufactured a few years earlier than the Nvidia Tegra2, so please don’t expect any hardware acceleration because that has only appeared in the Loongson 2H (aka Godson-2H). So, our testing is without hardware acceleration in mind. I can’t wait to get my hands on the next-generation Yeeloong 8133, designed on the Loongson 3A.
loongson@debian:~$ time 7z b 7-Zip 9.04 beta Copyright (c) 1999-2009 Igor Pavlov 2009-05-30 p7zip Version 9.04 (locale=C,Utf16=off,HugeFiles=on,1 CPU) RAM size: 1004 MB, # CPU hardware threads: 1 RAM usage: 419 MB, # Benchmark threads: 1 Dict Compressing | Decompressing Speed Usage R/U Rating | Speed Usage R/U Rating KB/s % MIPS MIPS | KB/s % MIPS MIPS 22: 315 99 309 306 | 4989 99 454 450 23: 312 99 321 318 | 4937 99 455 452 24: 303 99 329 326 | 4880 99 457 452 25: 297 99 342 339 | 4839 99 459 455 ---------------------------------------------------------------- Avr: 99 325 322 99 456 452 Tot: 99 391 387 real 4m38.692s user 4m31.901s sys 0m3.776s
Compared with the TrimSlice, this is slower. But remember, they are not contemporary. Also, the Nvidia Tegra2 has two virtual cores, while the Loongson2F has only one.
Next is the hard disk partition. It has one large ext3 root partition of 60 GB. The remaining space is reserved, but can be manually added and formatted as new partitions.
loongson@debian:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/hda1 56G 53G 202M 100% / tmpfs 503M 0 503M 0% /lib/init/rw udev 10M 432K 9.6M 5% /dev tmpfs 503M 0 503M 0% /dev/shm loongson@debian:~$ mount /dev/hda1 on / type ext3 (rw,errors=remount-ro) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) fusectl on /sys/fs/fuse/connections type fusectl (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
This unit shipped with Debian Lenny by default. Three years have passed, so I decided to update it to Debian Squeeze. The operation requires two steps: a package list update and upgrade option, after editing repo information to add new “Squeeze” lines into
/etc/apt/sources.list, and comment out old ones:
##deb http://ftp.uk.debian.org/debian/ lenny main contrib non-free deb http://ftp.uk.debian.org/debian/ squeeze main contrib non-free
Now, let’s run
aptitude update && aptitude safe-upgrade. Once the update is done, it’s worth doing a reboot.
Web browsers for MIPS
The situation with MIPS is slightly worse than with ARM. First, there is no entity like Linaro/Canonical that would push software development for the MIPS Linux port. Yes, Lemote has a nice manufacturing basis. However, in terms of the optimal software development stack’s speed, the number of people allocated to the project is far from desirable. Neither popular browser (Chromium or Firefox) has been ported to MIPS. We can hope FOSS developers will do so, eventually.
Practically, it depends on the availability of desktop MIPS systems. Developers are humans; when you donate your hardware to them, you can raise interest in porting. Anyway, almost all general-purpose code is already being compiled for the MIPSEL architecture, so feel free to upgrade your Debian.
Among software already compiled for MIPS is the Firefox fork “Iceweasel”. At version 3.5.16, it’s a bit behind the current Firefox 9.0. There is a Qt-based browser called Arora, which can be installed off the repo, or compiled from scratch. However, having a slow processor makes it difficult to comfortably surf the Web.
Well, so what are the new features that have appeared in Debian Squeeze? In short: improved power management — the CPU can scale down to 200MHz when there’s no load. Flash videos now can be decoded by Gnash. At least it was stated so; I’ve actually never seen it. Kernel support was tuned a bit, too.
To get Flash player, we need to take a few extra steps. Because neither Adobe, nor MIPS Inc., nor even Debian have downloads for Flash-player. That’s why I have to find
libflashplayer.so file. Again, I was lucky. And again, it resides inside Android tablet — but this time, inside Ainol Novo7 Basic. I’ve exported it and I tried to start Firefox with that plugin library.
loongson@debian:~$ firefox LoadPlugin: failed to initialize shared library /usr/lib/mozilla/plugins/libflashplayer.so [/usr/lib/libc.so: ELF file version does not match current one] ERROR: Too many attempts to read from the player!
Alas! The trick that worked for the TrimSlice was unsuccessful this time. Apparently, the netbook and Ainol use two different MIPS processors, of different series.
loongson@debian:~$ file /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so: ELF 32-bit LSB shared object, MIPS, MIPS32 version 1 (SYSV), dynamically linked, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, stripped loongson@debian:~$ file /usr/lib/gnash/libgnashplugin.so /usr/lib/gnash/libgnashplugin.so: ELF 32-bit LSB shared object, MIPS, MIPS-I version 1 (SYSV), dynamically linked, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, stripped
Our hypothesis is partly correct. The “native” Gnash application (uses MIPS-I standard) is correct, but it doesn’t work. The “imported”
libflashplayer.so is believed to be compatible with MIPS, but is for another MIPS (MIPS32) family, and has the wrong dependencies for the
libc library. I read the tablet’s specifications and figured out that the Ainol tablet is built on an Ingenic JZ4770 Xburst CPU, which has some differences from the Loongson2F.
Iceweasel passed the ACID3 and SunSpider tests, scoring 98 out of 100 for ACID3, but showing an extremely low result for SunSpider — almost 10 times slower than Chromium/Firefox on ARM. As we can see, CPU performance is a bottleneck again.
In general, all software packages in the Debian/MIPSEL port are present. The main task for the manufacturer is to increase the speed of the MIPS processor to convert it into a faster desktop machine, so QEMU would report (for a virtual Windows XP installation — yes, QEMU on MIPS works smoothly) a quicker CPU, not the currently available 41 MHz (!) by Intel.
The fact that there are now more and more products based on alternative (non-x86) processors is very promising. Even more interesting is the fact that they are designed to be efficient in terms of energy consumption. Both ARM and MIPS showed the same consumption — a couple of watts. Moreover, the trend to integrate a hardware decoding/encoding chip into the CPU became so popular, we’re currently facing an outstanding moment — systems with quite ordinary central processors, yet with a brilliant capability to hardware-accelerate video- and audio-streams (like the Tegra2 processor). The chances for ARM/MIPS products to capture the conservative desktop market are enormous. Intel, your turn!
- UNIX/Linux History
- The History of ARM Linux
- Status of the Ubuntu port to the AC100/Dynabook Tegra based netbook
- Collection of miscellaneous information about Lemote and the Yeeloong
- ACID 3 test site
- CompuLab Trim-Slice desktop running Ubuntu 11.04 Linux 2.6.38 kernel compared to the Arch Linux Trim-Slice build.
- Wikipedia on Loongson
- Wikipedia on Tegra 2 Series
Feature image courtesy: Chris Birchill. Reused under the terms of CC-BY 2.0 License.