famousfive.org

  • Increase font size
  • Default font size
  • Decrease font size
Home Fish and Chips Geekdom iPad Mega: the next Big Thing

iPad Mega: the next Big Thing

E-mail Print
User Rating: / 0
PoorBest 

Big is the new Small

Apple have had a very successful run with their iPod? family of music players. The iPod classic has been followed by mini and nano devices where thousands of tunes can be packed into ever smaller devices. For those of us now entering the prime of life, these tiny devices pose a real problem: never mind how to read the microscopic displays: actually finding the next generation iPod pico in the first place may be too much of a challenge. Now where did I put my glasses? And what was it I came upstairs to get?!

So here at famousfive we have been working on a solution to what is clearly a gap in the market. Enter the iPad Mega. Music on the go for the visually challenged.
Groovy iPad

The inspiration was one of the lovely leaving presents given by my ex-Team (thanks chaps!). They rescued from the skip of redundancy an ancient relic from the period now known as "the good old days" when only the French and the Americans wanted to buy our company. It was an IBM ThinkPad 560X of 1999 vintage. In some post-ironic pre-lunchtime hypoglycemic state Graham decided to decorate it in the style of an iPod.

Graham had done the tough part - coming up with a striking new look for this piece of WEEE - so all that was left for me to do was the simple task of making the device play MP3s. Naturally without the help of software from Uncle Bill, which would in any case have had to have been erased during the ISO17799 asset scrapping process. It was as simple as 1-2-3, as you will see from the following easy-to-follow guide.
iPad

Oh yes, and to cross another summer of inactivity task off the list, I have made a short promotional video for the iPad and posted it on something called YouTube. It'll never catch on. Anyway - here it is:

 

Eleven easy steps to build your own iPad

The natural place to start breathing life into such an ancient artefact was DSL. DSL (Damn Small Linux) is a linux distro based on Knoppix with a bit of vintage Debian thrown in, designed with a small o/s footprint in mind and suitable for booting from live CD or USB pen-drives. While space wasn't a primary constraint with the iPad - over the years it had been pimped up to a massive 98Mb of RAM with a 2Gb hard drive - small code means fast code, providing reasonable performance on the puny 200 MHz Pentium processor. I had played around with DSL on some other elderly laptops a while back and so thought I'd give the latest release - 4.2.5 based on linux kernel 2.4.31 - a try. There were just a few minor challenges along the way related to the primitive BIOS and the lack of support for video and audio hardware - but all resolved satisfactorily in the end.

Things you will need to make your iPad Mega:
1 x IBM ThinkPad 560X or similar
1 x PCMCIA Ethernet card - 3Com 3C589 strongly recommended
1 x external floppy drive for IBM ThinkPad
1 x computer with Internet access capable of downloading files to USB and floppy
A supply of sticky-back plastic (for decorations)
More time than sense

Please note that all the software used in this project is free to use under various open source licenses.
images/stories/dsl.png

 

1 - Acquire the softwareThe main site for DSL is http://www.damnsmalllinux.org/, which will refer you to a set of mirror sites from which the software can be downloaded. I used my Windows PC to download mine from here. DSL comes packaged in a number of ways, but as the ThinkPad BIOS only seems to allow booting from floppy or hard drive we need to assemble configuration to support this.

Download dsl-4.2.5-embedded.zip and bootfloppy.img onto your Windows PC hard drive. Format the USB drive as FAT32 - I used the oldest crummiest 64Mb USB drive I could find - and copy the zip file contents (not the zip file!) onto the USB drive. There is no need to copy the QEMU directory although it doesn't do any harm. As DSL's version of X (that's the GUI subsystem) doesn't work with the ThinkPad's NeoMagic video hardware we also need to grab a version that does. You could do this later from the command prompt on the ThinkPad, but it's altogether easier to collect it while we're here. After much experimentation and headbanging, the only X system I could get to work reliably was a version of XFree86 that was built for Knoppix back in the olden days when the dinosaurs walked the earth and the 560X was new. It took some finding, so I've taken a copy and posted it here for easy download. Download the zip file and copy the directory /knoppix_svga to the root of your USB drive.

Next create the boot floppy. To do this on a Windows machine you need the disk image program rawwritewin, which you can get from here. There's no need to format the floppy as the image program does that as it goes.
2 - Boot the ThinkPad from floppy and USBPlug in the external floppy (with boot floppy inserted), the USB drive, and the PCMCIA network card and switch on. After a short time the DSL logo will appear along with a boot prompt. At the prompt type:
dsl 2 vga=771 fromusb
The 2 asks DSL to start at runlevel 2, which is command prompt rather than GUI. Without this the GUI starts up but is entirely unintelligible. VGA=771 specifies the correct screen mode to fit the command prompt to the screen. fromusb tells DSL to scan the USB device for the kernel image. If all is well there will be lots of startup messages and eventually you will land at a DSL command prompt as the omnipotent user root. If you are attempting a re-install having already partly installed DSL, add the command norestore to the end of the line.
3 - Prepare the hard driveAt the command prompt type
cfdisk
This is a nice friendly disk partition program. It is going to destroy anything previously on the hard drive. Delete any existing partitions, then create the following:
New partition - primary. Set the size to around drive capacity less 2xRAM, i.e. in my case 1913 MB = drive capacity 2013 - 2 x 100. Put it at the beginning of the table, mark it bootable. The default partition type is Linux which is fine. This partition is assigned the name hda1.
New partition - primary - size is remaining drive capacity (in my case ~200Mb) - change type to Linux swap (82). This is assigned the name hda2 and will be used as our swap / paging area.
Write the changes and exit the program.
Prepare the swap partition for use by typing:
mkswap /dev/hda2
swapon /dev/hda2
You may see a "device or resource is busy" message, but don't worry about that. The swap partition will be mounted cleanly when we next reboot.
4 - Install DSL to the hard diskAt the command prompt type the command
dsl-hdinstall
The target device is hda1. Select 'n' to the 'multiuser install' prompt - multiuser only makes life more complicated later - and 'y' to the prompt about using a journalised file system. This directs DSL to build and ext3 journalised filesystem rather than the simpler ext2 system and while ext3 requires more resources it is far more resilient if the machine crashes without being shut down properly. Choose to add a bootloader and select Grub.
5 Reboot from the hard driveCtrl-Alt-Del to shut down DSL. Once the DSL Halted message appears it is safe to power off, unplugging the floppy drive before powering on again. Leave the USB drive in place.
When the GRUB boot menu appears press 'e' to edit the default menu choice. We haven't installed the new X system yet, so booting will still result in scrambled eggs on screen. Press 'e' again to edit the boot instructions: you can now scroll left and right along the command with the arrow keys and modify the commands. Change vga=normal to vga=771 and insert a new option 2 before the vga=771 option as we had in step 2 to prevent the X system starting. The complete line should look like this when your done:
kernel /boot/linux24 root=/dev/hda1 2 vga=771 noacpi noapm nodma noscsi frugal
When you're done editing, press Enter and then press 'b' to boot using the modified boot commands. Once again there will be some friendly linux startup messages. DSL will then prompt for passwords for two key users: root - the omnipotent one - and dsl - the user that you will normally be signed on as. Provide suitable passwords (you can ignore warnings about passwords being too weak) and you should eventually land at a command prompt, still as root.
6 - Install the modified X systemWe now need those extra files you put on the USB drive during step 1. To get at the USB drive we first have to mount it. As it was detected during the install DSL has already done most of the hard work. Type:
mount /dev/sda1
which mounts the usb drive as /mnt/sda1 and copy the XFree86 files from the USB to the hard drive:
cp /mnt/sda1/knoppix_svga/XF86_SVGA usr/bin/X11/XF86_SVGA
Don't forget that everything in linux land is case sensitive.
cp /mnt/sda1/knoppix_svga/XF86Config /etc/X11/XF86Config
Later when we are not logging in as root we still want the X system to be run as root, so we'll change the mode of the driver file to request setuid on execution
chmod +s /usr/bin/X11/XF86_SVGA
While we're here, we ought to straighten out the grub boot options to add our VGA=771 option and give us a command prompt only boot option for sorting out any future X problems.
Edit the grub menu file:
vi /boot/grub/menu.lst
Sorry but vi tutorials are beyond today's scope! There are plenty out there. The syntax of the boot file is pretty obvious. Edit the first option to set vga=771. Change the title of the second to "Command prompt only" and insert the option 2 into the options list as well as vga=771. If you want to be tidy delete the other boot options as they don't have any use with our new X system.
7 - Configure DSL to use XF86_SVGANext we need to tell DSL to use the new X system rather than either of the the systems that come as standard. There are various ways to do this, but I found that DSL had an irritating tendency to re-configure itself to use the default (scrambled egg) system from time to time. So the best way to make the change stick is to hack the script that writes the configuration file. The script responsible is xsetup.sh, so:
vi /usr/sbin/xsetup.sh
and change the line (line 59 in my script) that reads
XCOMMAND="exec /usr/bin/X11/Xvesa -mouse ...
to read:
XCOMMAND="exec /usr/bin/X11/XF86_SVGA -bpp 16 -nolisten tcp &> /dev/null"
if you're feeling tidy you might also like to amend the echo command two lines above to reflect what the script is actually going to do. This script gets called the first time DSL tries to start X, so it will write the correct information into the configuration file for X at that stage.
8 - Add the startup commands needed for audioSadly DSL does not auto-configure the ThinkPad's audio hardware, so we need to tell it which modules to use to make it work. This is a process known technically as linux voodoo, which works best in conjunction with animal sacrifice. We don't want to have to retype these memorable commands every time we reboot, so we'll put them in a startup file. There are lots of ways of doing this - a nice and simple one is to add them to the bootlocal script. So:
vi /opt/bootlocal.sh
add the following lines:
modprobe sound
modprobe ad1848
insmod uart401
insmod cs4232 io=0x530 irq=5 dma=1 dma2=0 mpuio=0x330 mpuirq=5
loadkeys uk
The first four lines add and configure the kernel modules needed to run the CS4237B sound chip in the IBM, and the last line loads the UK keyboard map to save us doing that later.
To get the delete key working properly with a UK keyboard it is necessary to modify one of the key codes in the X system.
vi /home/dsl/.xinitrc
and add the line
xmodmap -e "keycode 22 = BackSpace"
and finally an error in the network installation script means that one further edit is required, adding the ethernet interface for the network card:
vi /etc/network/interfaces
and append a line to the end of the file as follows:
iface eth0 inet dhcp
9 - Reboot and experience the joys of XYou can unmount (umount /dev/sda1) and remove the USB drive at this point if you want. Ctrl-Alt-Del to shutdown DSL, and then power cycle.
Look in wonderment at the new GRUB menu you have created and select the first option. After booting DSL runs the xsetup script (in character mode, naturally). Press Escape to leave the program. This will write the X config file .xinitrc and startup the X system.
Look! a GUI!

Look! A real gui at last!
10 - Now get some music to playYou could transfer files by USB drive, but that seems a bit easy. So next we get DSL to talk to the Windows PC where all your MP3s are located. Core DSL has some primitive commands that could achieve this, but by adding the Samba package you can make life easier for yourself. On the DSL menu (where the "Start" button would be in Windowsland) select MyDSL and MyDSL Browser. When the MyDSL Extension Tool opens, Click on Net and scroll down to find samba.dsl. Click on this to download and install the package. Once the install is complete open a bash shell (you'll find it in the menu or via the quick launch buttons) and create the directories and mountpoints needed. On my Windows machine \\BILL (not his real name) I have shared the directory containing my MP3s and called the share mp3lib.
mkdir /home/dsl/music
sudo mkdir /mnt/net
sudo smbmount //bill/mp3lib /mnt/net
Just press 'Enter' when prompted for a password by the smbmount command. This assumed that the mp3lib share is open to all. Note that because in GUI land we are now logged on as user DSL, we need to prefix any commands requiring root privilege with 'sudo'

Now you can use cp commands in a bash shell or the GUI file manager program Emelfm (DSL, Apps, Tools, Emelfm File Manager) to move your favourite MP3s from /mnt/net to /home/dsl/music. Obvioiusly you haven't been so foolish as to rip all your CDs to evil Apple AAC format now, have you?
11 - Ready for lift-offFire up the media player xmms from a command prompt, or straight out of Emelfm by double-clicking an MP3 file. Click on the player and select Options, Double Size, put your bifocals away, plug in those white headphones and off you go. You can even build play lists in xmms!
It's just like a good old fashioned cassette player.

images/stories/xmms.png

It's really that simple!

Advanced topics for the seriously deranged.


Yearning for that iTunes feel?
If you are yearning after all that great track info to help you decide what to listen to, load up DSL GTK package (DSL, myDSL browser, Gtk2 and install base packages gtk2-0705.dsl and gtkpod-gtk2-0.9.3.dsl. After installing, gtkpod will appear on your DSL, MyDSL menu This is how it looks:

images/stories/gtkpod.png

Notwitstanding the risk of recursing yourself into a balck hole, you can also use this application to synchonise with your iPod.


Don't like to be tied down?
DSL's support for wireless communications has come on in leaps and bounds since my earlier experiments. You don't have to recompile the kernel now or anything! Even for a decently secured WPA-PSK network all you need is already installed. I found a Linksys WPC54G v5 card that came free with an access point I bought and gave it a try. Unlike the trustly 3Com 3C589 ethernet card used earlier, you won't find limux drivers for these cards, but a great utility called ndiswrapper lets you use Windows driver under limux. Here are the steps involved:
Using your wired connection, download the Windows driver for your wireless card (in my case from Linksys.com). Linksys packages a bunch of drivers for different cards in one zip file, so inspect the autorun.inf file to find the inf file corresponding to your specific card - mine was LSMVNDS.inf
From the directory where you've put the inf file Install the drivers:
sudo ndiswrapper -i LSMVNDS.inf
Reboot with the wireless card in place
At a bash prompt add the ndiswrapper module
sudo modprobe ndiswrapper
At this point the card should become active (i.e. lights will flash!) and the command iwconfig should show the current config of the interface wlan0
If you have any sense your wireless network will be configured with WPA, so you will need a wpa supppicant to allow you to connect. Forutnately DSL has one already built - you just need a config file
sudo vi etc/wpa_supplicant.conf
add the following (adjusted to your own config, naturally)
network={
ssid="whateveryourWAPiscalled"
scan_ssid=1
key_mgmt=WPA-PSK
psk="
very secret passphrase"
}
Invoke the wpa_supplicant:
sudo wpa_supplicant -iwlan0 -Dndiswrapper -B
and assuming you get your IP address from DHCP, fire up dhcp client pump
sudo pump -i wlan0
If you are lucky and have performed the required animal sacrifice (roasting tofu is a suitable alternative for veggies) you should now have an active wireless connection - check its status via iwconfig and ifconfig
To operationalise this you could add the modprobe wpa_supplicant and pump commands to a suitable startup file like bootlocal.sh.
Now all I need is a wireless power supply. Anyone have a spare microwave oven?

 

GeoOnline

Recent visitors:
5 Sep
GoogleBot 5 Sep
Moscow 5 Sep
YahooBot 5 Sep
Paris 5 Sep
Guildford 5 Sep
MSNBot 5 Sep
San Diego 5 Sep
Sunnyvale 5 Sep
London 4 Sep
Östersund 4 Sep
Sutton In Ashfield 4 Sep
Las Vegas 4 Sep
Singapore 4 Sep
Saint Petersburg 4 Sep
Seattle 4 Sep
Milton Keynes 3 Sep
Maasdijk 3 Sep
Chicago 3 Sep
Buhler 2 Sep