Friday, February 22, 2008

Asus EEE Arrives and Samba Goes

I've finally got hold of an Asus EEE PC 4G. Initial impressions are very good, it feels robust and of good quality. There has been some mention of poorly aligned keyboards in recent models, but this one is fine. Despite being a little cramped the keys have a decent feel and I was touch-typing on it without too many errors by the end of an evening.

Before allowing it onto the InterTube I first disabled Samba. Samba allows the EEE to interoperate with Windows File and Print services, but unfortunately the version installed has a security flaw. There are various options for fixing this, including removal of Samba altogether or updating to the latest version. However I decided to just stop it running automatically at boot-up. This takes a little command line tweaking but is pretty easy. Here's what I did:

Hit Ctrl-Alt-T to pop up a command line prompt and type:

ps -e | grep smbd

The ps -e command lists all the processes running on the machine; about 60-odd on the EEE at rest, making the Samba processes hard to spot. The pipe symbol ( Fn-Shift-Z on the UK keyboard) 'pipes' the output of one command into another, in this case grep smbd. The grep command is an incredibly powerful search facility, but in this incantation it just returns any line containing 'smbd', the name of the Samba process. Running that command line gives something like:

1840 ?   00:00:00 smbd
1841 ?   00:00:00 smbd

confirming that a couple of Samba processes are running. Incidentally man followed by the name of a command displays the 'manual' for that Xandros command.

Now at boot-up the EEE runs a script called /usr/sbin/services.sh which starts various services including Samba. Near the end of the file the following lines start up Samba:

mkdir -p /tmp/.samba
/usr/sbin/invoke-rc.d samba start

We can comment them out by placing a hash ("#") at the start of each line. The EEE has various editors available from the command line, but I used Vi - it is something of an acquired taste and can be intimidating to new users because of its initially steep learning curve, but it has the advantage that it is available anywhere, under virtually any OS. There are also circumstances when Vi is likely to be the only editor that will work on a partially booted Xandros.

Vi is a modal editor and most keystrokes you type will be interpreted as commands rather than being inserted into the text. You have to switch into Insert mode to enter text. It is essential to spend some time practicing on scratch files and going through the tutorials on the Vi Home Page before going near anything essential with Vi. The most important Vi command to know is [Esc] to get out of Insert mode and then :q!. Colon opens the command line and 'q!' forces a quit without saving.

Editing the script with:

vi /usr/sbin/services.sh

works fine until you try and save the file, when Xandros will complain:

E45: 'readonly' option is set (add ! to override)

Trying :w! as suggested will also fail with:

"sbin/services.sh" E212: Can't open file for writing

This is because you are logged into Xandros as a user who doesn't have the authority to change this system file. You need to be logged in as the super-user 'root' instead. Fortunately you can use the sudo command to give yourself limited, audited, access to super-user permissions. So typing:

sudo vi /usr/sbin/services.sh

gives full editing access to the file. It can then be changed with the following commands:

  • G - moves the cursor to the bottom of the file

  • Cursor up - to the start of the first line that needs commenting out

  • i - Go into insert mode, then type '#' and then [Esc]. Don't try and cursor down in Insert mode - it will end in tears

  • Cursor down - to start of second line that needs commenting out

  • i - Go into insert mode, then type '#' and then [Esc]

  • ZZ - Save and Exit


The relevant part of the file should now read:

# Store samba run state in /tmp, as it gets written to frequently
# mkdir -p /tmp/.samba
# /usr/sbin/invoke-rc.d samba start

Restart the EEE and run ps -e | grep smbd again. This time no lines should be listed showing that Samba is no longer running.

Details of this fix, along with discussion of alternative solutions are given in the this thread on EeeUser.com.

Saturday, February 16, 2008

Asus EEE 4G Supply in the UK

There's some interesting discussion about experiences obtaining EEE 4G's in the UK on mediaprices.co.uk's forum.

Another useful resource is the Asus EEE PC UK Stock checker, though it's not always entirely accurate. I was excited to see white 4Gs listed as being available from Amazon for £270. A bit steep, but rather tempting. Following the 'Buy' link, however, revealed that the Amazon Marketplace supplier was actually asking for £398.95 + £4.50 P&P...

(D)esirable (H)ardware (L)ost

Having had an Asus EEE PC 4G placed into the tender care of DHL for next day delivery on the 24th January I'm still without a machine to play with. The box disappeared at Gatwick and hasn't been seen since. DHL insisted on a five day investigation before admitting they hadn't a clue where it was. Of course they didn't tell me that - they left it to the supplier to apologise on their behalf.

The replacement was supposed to have shipped today, so when the delivery estimate went up to 15 days overnight I thought I'd try a trip to Tottenham Court Road, the closest you'll get to Akihabara in the UK. In each shop questions about the availability of EEE 4Gs were met with a shaken head and a wry smile. As I approached the very last shop I was amazed to see a "We have Asus EEE 4Gs in Stock Now!" sign in the window. Rushing in, my fevered question was answered with "Well they are not actually here, but they will be arriving today."

The salesman kindly rang their supplier to find out when the EEEs would arrive. The call went something like:

"Can you confirm they will be arriving this afternoon?"
...
"Well, were they put on the lorry?"
...
"So do you have any in the warehouse?"
...
"Oh, so the ship will arrive when?"

Saturday, February 2, 2008

Emulating the PDP-8

Mentioning the PDP-8 yesterday set me thinking about building a PDP-8 replica using modern day TTL. The PDP-8 had a particularly simple architecture with only a few registers and eight basic op-codes. The early machines in the family, like the ancient one I used at University, was build from individual transistors and core memory. Later on DEC switched to TTL chips and RAM, so to build a replica would certainly be possible.

There was also a PDP-8 on a chip - the Intersil 6100. We used to have some prototyping boards for this low-power chip. The memory was backed by a single AA battery - at the end of the day you could just pull the memory board out. Next morning you could plug it back in and carry on working. It was used for ultra-low power application like satellite on-board systems.

A wander around the Web turned up Henk Gooijen's great looking 6809-based hardware emulation, and links to a number of software emulations, most of which ended in an HTTP 404 page. However there were some gems - for example Tim Gorton's Java Applet PDP-8 emulator that interactively runs a PDP-8 Lisp.

There was also Brian Shelburne's MS-DOS PDP-8 emulator which comes with a built in assembler and a lot of fascinating documentation. Apparently it used as part of a course on computer architectures - which is a little surprising because, although its a simple, elegant architecture, it doesn't use a stack which is a little unusual these days...

After spending an evening reading those sites and playing with some of the emulators I had a very restless night - I kept waking up with bits of Java code for emulating PDP-8 instructions running through my head. I had been looking for a little Java programming project to try out Swing (its all Web development at work) and this seems to have chosen itself.

So my next few commutes are going to be with the PDP-8 Programmer's Reference and a big pad of paper.