projects: route66: 1030n set top box
experiences with embedded linux on the gct-allwell 1030n set top box. ( no moving parts! )
[ home ]
[ anders ]
[ resume ]
[ choppers ]
[ projects ]
  [ netatalk ]
  [ route66 ]
    [ updates ]
    [ download ]
    [ pictures ]
    [ movies ]
    [ cvs ]
    [ list ]
    [ 1030n ]
  [ javascript ]
  [ webgallery ]
  [ mockMarket ]
  [ merits ]
  [ dailyBulletin ]
[ words ]
[ pictures ]
[ movies ]
[ contact ]

Save Anders' Savings!

i decided to write about my experiences with the gct-allwell 1030n set top box because it is probably of intrest to more than just myself. i purchased the 1030n with a 266 mhz celeron, 32 megs of ram, 32 megs of disk-on-chip, an ir keyboard and an ir remote. honestly i really didn't know what i wanted, i just bought. the total bill was $514 including shipping. i worked with theresa ho at 1-626-968-1116

if you don't add an optional 2.5" hard drive, the 1030n has no moving parts. there isn't a fan on the power supply or the chip, making this a very silent and therefore desierable part of a component stereo system or a/v setup. i, of course, intend to use this box to play mp3s in my home. and of course, having tv output is a handy side effect.

so how do you boot the thing if there isn't a hard drive? well, there are actually 2 options here. you could boot over the network, but this requires some sort of external dependancy that i didn't want to have, or you could boot from the solid state disk ( disk-on-chip ) which is what i decided to do. this requires a few tricks with drivers and a special lilo, but it all works out in the end.

another option would have been to get a compact flash to ide converter and boot with that, but i hadn't thought about this when i purchased my system.

when i got the system, i had no idea how i was going to get the disk-on-chip to be the primary boot device. did the bios have to support disk-on-chip? would it show up like a scsi drive or an ide?

i got the system up and running by attaching an old windows 95 hard drive i had pilfered from another machine to the onboard ide chain. to my amazement, it booted right up and ran windows. looking through the documentation, i had found that all the m-systems ( company that makes the disk-on-chip ) utilities run in dos, so i had to get dos running at some point. the utilities stepped me through initializing the disk-on-chip and getting it to show up under windows. right off the bat, really simple.

another question i had was how was this thing going to put a picture on the television? did i have to flip somthing to get the video out to the tv? would it run in text mode? or just certain graphics modes? as it turns out, both the svga outputs and ntsc outputs are running all the time. ( although if you don't boot with a monitor, i think it may turn off the monitor output ) this happens to be a really nice thing because i don't have to worry about setting these things while in linux.

now the trick was to try and get linux going on this thing. i pilfered a linux drive and booted the box with that. again, it worked with no special modifications. i had downloaded a pdf file and some drivers from the m-systems website and put them on that hard drive so i would have somthing to fool with. when the system came up, i took a look at what i had gotten from m-systems. there were a few kernel patches to get disk-on-chip ( doc ) drivers into the kernel. i created the doc devices in /dev/msys, patched up a 2.2.18 kernel, got the kernel compiled, installed it on the hard drive and rebooted. the system came up with doc support. i was ready to go.

the only problem was that i had an ms-dos filesystem on the doc and that just wouldn't do for linux, so i did a fdisk /dev/msys/fla and created a linux filesystem. the chip took all of 1 second to format with a mke2fs and it mounted just as any other hard drive would with a mount /dev/msys/fla1 /mnt/doc.

the next step was to try and get this thing to be the primary boot device of the machine, so i started setting up a basic linux filestructure on the doc. i didn't have any hope for a successfull boot without a fleshed out filesystem, but i wanted to see how the disk on chip would be the primary boot deivice. there is an alternate to lilo called doc-lilo which is used to write the boot loader to the doc. doc-lilo, like lilo, does 2 things. it installs the boot loader and points to the raw block on the filesystem that contains the kernel so that during boot, the loader can pass off to the apropriate kernel. the problem is, the kernel exists on the flash device and i wanted to point to the lilo.conf there instead of the hard drive that was the root filesystem just now. it turns out that doc-lilo supports the -r flag so you can specify root somewhere else. so i did a doc-lilo -v -r /mnt/doc and all was well.

i rebooted, and ... ( drum roll please ) ... it didn't work. i got boot failure messages all over the place, no matter what i set in the bios as the boot device. so i figured it was probably time to start looking at the instructions. after some reading i found that what i should be doing is booting in dos again, and installing some code called doc42.exb which will "enable the doc to boot". sounds easy enough, but for the life of me, i couldn't find the file doc42.exb. it wasn't on the cd-rom i got, nor was it on the website. i was stumped.

after some time, i became a bit desperate. i had tried searching the net for this file, but to no avail. i again went back to the files i had downloaded from m-systems and searched for everything ending in exb. whala. there was doc123.exb. a far cry from doc42.exb, but i was crazed by this point. i ran the little dos app that installs this questionable piece of code, and rebooted. to my utter amazement, the doc was found as the primary boot device and it started to boot the kernel! after i had shown everyone within earshot, ( whose comments ranged from "that's cool!" to "yeah, and? ..." ) i started on the task of building a working linux filesystem for my new kernel.

it must have taken over 100 reboots swapping back and forth between the hard drive and the doc, but with the use of ldd and strace, i finally got a working tree with all the essentials. now when i reboot the system, i get a useable linux machine within 5 seconds! what a feeling!

the next task was to get networking going on this box. on the cdrom was an ethernet driver for linux, so i compared that file with the one that came with the kernel. there weren't any major differiences. it seemed to be basically the same file. i compiled it up, but nothing i tried ever worked. i flipped debugging on and sat there trying the driver with every known optional parameter, but to no avail. i had already wized up and taken a look at the docs for the ethernet, but nothing helped. the driver that was distributed was a realtek 8139 fast ethernet driver and there was even the pdf file for the realtek chip on the cd. so i ripped the case open and looked for the chip. try as i may, i never found it. however, i did find an intel chip, so i decided to try the intel drivers just for good measure. the first one i tried hard-locked the machine while trying to probe. when i rebooted, i tried the ether express pro 100 driver and whala! it worked! sure enough, i had been banging my head against the wall for 4 hours trying to install a driver for hardware i didn't even have! then i took a look at the sales receipt and packing list. sure enough, it said "realtek fast ethernet lan". the only thing that mentioned somthing differient was the 1030n pdf of the users guide which was very un-technical, but listed the correct hardware. go figure...

the last, and critically important frontier was sound support. of course the box uses some wierd, never before seen chipset for audio. so i chose the brute-force approach and compiled all the sound drivers that came with the kernel. surprise, surprise, the soundblaster compatible driver worked almost right out of the box. initially the audio was choppy, but a switch from irq5 to irq10 in the bios and a recompile fixed that. as it turns out, sound comes out the rca jacks and the line out at the same time. it's nice because it tends to behave more like a component system device this way. i was never a fan of useing a stereo mini-din to rca patch cord.

as soon as i had a working system with network access, i was able to take the system home and continue to build the filesystem. it was critical to have nfs support so i could mount my mp3s, so i set out to start building my final implimentation. i have a computer at the office with all my music on it which i intended to mount at home. ( i have a cable broadband connection at home which is more than fast enough to play 256kb/sec mp3 files from the net ) i only have one ip address at home, so i run a masquerading firewall on a linux box to distribute the internet connection. i plugged my set-top box in above my tv and got things up and running. but when i tried to mount my mp3 collection from work on my new set-top machine, i was getting "connection refused" errors. looking on the server side, my mp3 server was complaning that an insecure port was requesting a mount, so it was denying the connection. when my set-top machine was making requests, they were going through the masquerading firewall and being mapped to higher ports. there was nothing i could do about making the masquerading happen on secure ports ( < 1024 ) because this was a very early design decision of masquerading. as luck would have it, there is a flag in the linux implimentation of nfsd on the server side that causes the server to ignore the insecure nature of a high port and let the nfs mount go through anyway. ( just needed to add "insecure" to the options for the share in /etc/exports )

all in all, it is a nice system. the keyboard is really nice and incorporates a mouse. there is also another "tv" style remote control for which i intend to build a daemon to do simple tasks like play, pause, stop, next and previous. outside of a music player though, nothing beats the ability to wake up in the middle of the night, turn on the tv and have a shell to ssh anywhere in the world. to commemorate the occasion, i did my email on my television that night.

update: by popular demand, i have posted the dmesg and a tar of the root filesystem. (comes with the basics that you would expect, joe as an editor and mpg123 to play mp3 files) i call my little distribution "itty-linux". get it? get it?! itty... internet tty? no? ok, you had to be there.

and for the record, as John Zulauf correctly pointed out to me, it is not a celeron processor as gct allwell had origionaly advertised. it's actually a geode gmx 233p. i'm not too worried about the misadvertisement as i don't really need mega cpu horsepower to decode mp3s, but there we are. thanks John.

... to be continued as i get perl installed and a database connection going ...