Index page | Table of Advent laptops | Mailing list | TuxMobil - Linux on Laptops,
				Notebooks, PDAs and Mobile Phones  Linux On Laptops
How to get Linux onto an Advent 5480
 

Part 1: What is an Advent 5480 anyway?
Part 2: Okay already! Does Linux work on it?
Part 3: Where do I start?
Part 4: basic install
Part 5: Getting kernel 2.2.16 to work
Part 6: Things you can do to make it work even better, for people who like experiments.
    6.1. The sound. Are they kidding? That system beep is stupidly loud and annoying
    6.2. That darn flipping annoying bloomin' X Windows bug. I LIKE virtual terminals. Gah.
    6.3. The DVD. Regional encoding indeed. Pah. And only watchable under Windows.
    6.4. Trying to make the www key do something cute
    6.5. Trying to make the other windows keys do neat stuff, too
    6.6. APMD- the Advanced Power Management daemon
    6.7. Problem with plugging in an external PS/2 mouse
    6.8. Using a USB Logitech wheel mouse
    6.9. Playing Mpeg and DivX ;-) movies
    6.10 The perfect(ish) kernel recompile
    6.11 IrDA, or How To Use Infrared on your Linux
    6.12 Customise your Bash prompt for your laptop (requires APMD enabled)
Part 7: Conclusion & how to get more help

Coming soon: extended support for other Advent machines. Some have slightly different hardware and I'd like to collect the hardware & software configurations together to make a more general Advent page. Also coming soon: information about other distributions, off-the-shelf support (or lack of), and anything else that seems like a good idea at the time.

New: A mailing list. Yet another one of those innovations that seems like a good idea so far ;-)

Really actually dead important NOTE: if you have an Advent laptop that isn't the 5480 DVD, please please send me your /proc/pci and your machine's model number along with the details of how you managed to configure it, which bits you got to configure right, and so on, so I can add it to the Big List and make other future Advent Linux laptop users happy ;-)
 

Part 1: What is an Advent 5480 anyway?
 

Right. Well, you can buy these machines at PC World in England. Granted this is in the worst possible taste given the cost of most machines you can buy there, but believe me when I say that the Advent is an unusually nice machine for the price. I should clarify this- they aren't great. But they cost a good thousand pounds less than the big names, so... This one cost me about 1400 pounds including some rather nice additions, and sounds like this:

Pentium III at 800 MHz
DVD drive (more on this later)
128 Megabytes RAM
14.1 inch screen
Touchpad, reasonably nice clicky keyboard

The video card is a little odd as it allows you to choose for yourself how much of the RAM you want your video card to use. This sounds bizarre but think about it, how many laptops do you know that allow you to have 32 megs video memory? ;-)

Sound card is internal to the motherboard, as is the network card. There's 1 PCMCIA slot, which is compatible with card types 1 (reversible, totally obselete),  2 (standard), and 3 (double width PCMCIA cards).

By the way, the various machines in the Advent product range often have very different hardware, so just because this one more or less worked out, don't just believe that all of them will. Read the comparison page, ask the other Advent owners, get feedback on the hardware before you buy.


Part 2: Okay already! Does Linux work on it?
 

Oh boy. You ask the hardest questions. Hmm... the answer is, basically, yes. But don't expect it to be an easy ride.
Before you say something like, "See? I SHOULD have bought a Dell", remember that virtually no laptop in existence, other than the really, really old ones, are easy to configure under Linux. There are complicated reasons for this, but basically it boils down to new, weird hardware that doesn't necessarily enjoy support under our favourite Red Hat distribution or whatever.
The good news is that the Advent is capable of running Linux. It doesn't kernel panic on install, and all the devices enjoy some measure of support.


Part 3: Where do I start?
 

I'm using Slackware Linux 7.1 as my install base, but we'll be installing and recompiling new kernels and things later.  I'd suggest keeping to more or less the same distribution as me, since I don't intend to give descriptions for setting  this stuff up on every popular distribution (actually, I've changed my mind on this. I'll add a section on the subject). If of course you feel much more comfortable with Red Hat or whatever, and  you're capable of translating these instructions to fit, do as you wish; it probably doesn't make any material difference. Let me know what your problems were, and what fixes you found, and I'll put them up on here.

I used Slackware because it really doesn't have a complex install system at all. So you have to do it all by hand, but on the other hand you don't risk having problems like your (actually compatible) hardware being unrecognised by the nice pretty graphical install program, or your system trying to boot into a graphical mode that doesn't work.


Part 4: basic install
 

Make sure that the Bios is set up to boot off a CDrom, then put in Slackware and complete the installation process.

To free up space in the drive (since the PCWorld basic Windows install actually uses maybe 700 megabytes, but the whole  hard disk is formatted up as the C: drive), use a utility like FIPS or PartitionMagic. The Mandrake install CD comes with a disk resize utility that works quite well in a sense, but- another word of warning- don't go creating partitions with it. Do it with another fdisk later on. Mandrake beta installs (and a lot of Mandrake disks are Beta, whether they claim to be or not) have the nasty habit of messing up which partitions are set bootable and so on. This tends to mean that disks will appear under Windows as 'Drive D: local disk' and then be unreadable (as they're EXT2, this makes sense).

If you get this problem anyway, use TWEAKUI under Windows to stop it talking about Drive D: in Explorer and Save menus.  Or just delete Windows entirely. It's full of bad surprises, and as evil an operating system as I have ever seen.

Here's how I organised my disk:

Disk /dev/hda: 255 heads, 63 sectors, 1467 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 262 2104483+ c Win95 FAT32 (LBA)
/dev/hda2 263 268 48195 83 Linux native
/dev/hda3 269 301 265072+ 82 Linux swap
/dev/hda4 302 1467 9365895 5 Extended
/dev/hda5 302 620 2562336 83 Linux native
/dev/hda6 621 684 514048+ 83 Linux native
/dev/hda7 685 1076 3148708+ 83 Linux native
/dev/hda8 1077 1467 3140676 b Win95 FAT32

Note: you're allowed four primary partitions. I've set up my first three primary partitions as
/dev/hda1 Windows ME disk
/dev/hda2 /boot Has to be somewhere near the beginning of the disk
/dev/hda3 Linux swap 256 Mb of swap space - twice the amount of memory

My fourth primary partition is /dev/hda4
I've set this up as Extended, and made it the full length of the rest of the disk

Within the extended partition, several logical partitions live. These are, for me,
/dev/hda5 /
/dev/hda6 /home
/dev/hda7 /mnt/share/linux A Linux ext2 format share drive
/dev/hda8 /mnt/share/dos A DOS format share drive, visible from Windows and Linux

Of course, you can do this more or less as you like.

Given that you have 12 gigabytes to work from, you might as well install more or less everything. For our purposes, however, it doesn't much matter.
 

Part 5: Getting kernel 2.2.16 to work
 
This is quite simple, really.

Without even recompiling, you can just 'modprobe' the necessary modules. These are

---------------------------------
#Put this in /etc/rc.d/rc.modules

# This is the sound support for my Advent ;-)
/sbin/modprobe trident
# This is my Network Card ;-)
/sbin/modprobe sis900

--------------------------------

Now for getting XWindows to work. This is rather nastier and will, I am afraid, require a lot of effort.

You can start on kernel 2.2.16 with XFree86 3.3.6 or whatever comes on Slackware. It won't work, it'll freak out at you, it'll give you stupidly small and nasty resolutions and insist that every single horizontal and vertical frequencies you give it are completely wrong, until you do one simple and totally daft thing: reboot having typed this line:

vga=791

in the file /etc/lilo.conf

and then typing 'lilo'.

Next time you 'startx' it'll work fine, apart from one rather annoying bug. This version of XFree doesn't seem to know when to let go of the screen. So when you shut down X, it suddenly does /something/- and it's anybody's guess as to what, I swear I have no idea- that makes sure that all you see on the screen is your rather nice background image, permanently frozen. It hasn't actually frozen the system- you can type 'shutdown -r now' into it when this happens, and it will reboot - it's just taken permanent control of the graphics for no reason that I can possibly image. Probably it's somewhere between XFree and the framebuffer device that you've enabled by typing 'vga=791'.

However, apart from this, it's basically usable. Just don't try to switch terminals using 'ctrl-alt-F[1-6]' because it'll do just the same thing at you and you will again find yourself staring at that pretty background image.

Just before I get into the XF86Config, I ought to say that I have tried many drivers and wandered through the SIS.com.tw website, and discovered that whilst they offer Linux support, actually trying any of the SIS drivers tended to be a recipe for something I've often read about but virtually never seen, the snow crash. This is where your screen goes white, a few pixels at a time, in a thoroughly terrifying sort of, "Forget it, I'm dead" way. You'll get the same thing if you try compiling experimental SIS framebuffer support into the kernel 2.4.3. This is why I have decided on using the framebuffer solution (least painful).

Here's the XF86Config file for XFree 3.3.6


Part 6: Things you can do to make it work even better, for people who like experiments.
 

Okay, so we have one working system.

But not yet a perfect one. Here are some things that need changing (because they annoyed me), or need doing (because they're fun).

1. The sound. Are they kidding? That system beep is stupidly loud and annoying
2. That darn flipping annoying bloomin' X Windows bug. I LIKE virtual terminals. Gah.
3. The DVD. Regional encoding indeed. Pah. And only watchable under Windows.
4. Trying to make the www key do something cute
5. Trying to make the other windows keys do neat stuff, too
6. APMD- the Advanced Power Management daemon
7. Problem with plugging in an external PS/2 mouse
8. Using a USB Logitech wheel mouse
9. Playing Mpeg and DivX ;-) movies
10. The perfect(ish) kernel recompile
11. IrDA -using infrared under Linux
12. Customising your Bash prompt for a laptop...

6.1: That annoyingly loud system beep

Put this line into your /etc/profile

echo -e "\33[10;50]\33[11;10]"

It'll make your nasty loud beeeeeeeeeeeping noise sound like a quiet little low-pitched 'bip'.
Or, if that's not good enough and you eventually become annoyed with my attempt at designing
pretty-sounding system beeps, try:

echo -e "\33[10;20]\33[11;5]"

which has the effect of making the system bell completely silent, probably because it can't cope with such a short bell.
 

6.2: The *@&*&~!! X-Windows bug

I'm currently trying a new version of XWindows - 4.0.2 - along with the new kernel - 2.4.3.
This is something that requires a lot of recompilation and stuff, so be patient. I'll let you know if it works.

UPDATE: it worked! You definitely need the 2.4.3 kernel, or at least 2.2.18 or above, to do this.

Here's the XWindows 4.0.2 XF86Config file: it's not clean, but it works.
 

6.3. The DVD RPC-2 Regional Encoding

...and how to watch DVDs under Linux.

I'm working on the regional encoding problem. It's patently ridiculous having an RPC-2 hardware regional encoding device on a laptop. In the meantime, if you care and if you have reason to be using international DVDs (like, you work in New York) call PC World. Shout at them. Complain. Tell them you spent lots of money and don't see why you should be stuck with a locked-up DVD.  Make their lives as painful as possible. Why? Because if you annoy PC World or whoever, they'll annoy  their bosses, who'll annoy their bosses, who'll annoy the manufacturers, who'll annoy the people who wrote the spec, and eventually DVD regional encoding will die in a blaze of manure (if only). And good riddance.

The DVD on this system (QSI SDR-081) hasn't been cracked yet, unless you know better (in which case, let me know). It is on DVD RPC-2, which means that it's crippled by hardware encoding.

UPDATE: A flash for the QSI SDR-081 is now available from the DVD firmware site. (Thanks to Kris for pointing this out). It hasn't been hacked for RPC-1 yet but re-flashing your firmware will probably reset the region counter. It's probably only a matter of weeks before some kind soul hacks it, anyway.

To watch DVDs under Linux, in the event that you haven't changed your mind already and decided to boycott DVDs in favour of watching paint dry, you need to download LiViD, and serve yourself out a generous dollop of patience on the way, because this isn't the easiest of programs to compile and it probably doesn't come in binary form yet. I'll put out a compiled version here in later life (as soon as my headache goes away).

UPDATE: You can also watch DVDs using mplayer, or so I am informed. I haven't tried it myself yet.

A controversy exists about the legality of decoding DVDs (which are encoded in order to ensure that the MPAA have total hold over what we watch, how, and when [oops. I mean, in order that the MPAA, poor as they are, don't lose their revenue stream to people who want to, uh, watch their movies]).  The DMCA, or Digital Millenium Copyright Act, makes the decoding software illegal in the US, and this legislation is half way to being accepted by the various countries of Europe. So the short answer is not to buy DVDs, to restrict yourself to the official software (why??? this is a monopoly situation if I ever saw one!) or to disagre with some very rich people.

6.4. Making the www key do cute stuff

The www key is actually equivalent to typing 'CONTROL-F12'.

Unfortunately, my windowing system of choice (WindowMaker) doesn't let you do fun things with random sequences of control characters directly. As soon as I figure out how to do something with it, you'll be the first to know. Most window managers will allow you to bind key sequences to events.

UPDATE: Oh. Actually, WindowMaker does let you do this ;-)
Here's how: open the WindowMaker control panel. Go into the section titled 'Applications Menu Definition'. In the menu on the right, click on the Netscape (or Mozilla, depending on which browser you like) entry, wherever it appears... in mine it's under the 'Applications' submenu. Now when you click on it, the control panel shows this:

Configuration of shortcuts under WindowMaker

Now you'll find the keyboard shortcut capture doesn't actually work right, necessarily. It tends to see the 'www' key as 'Control+Shift+F12' or similar. So just type Control+F12 in where it says 'Keyboard Shortcut' as I have done here in the image shown above. Press Save (I know you know ;-) And hopefully, all else being well, you'll find that next time you press the www key, the web browser comes up. We've actually beaten Windows here- since on my Advent, the www key does absolutely nothing at all in Windows!

6.5. Making the Windows keys do cute stuff

It turns out that these two keys are:

for the one with the Windows logo: keycode 125
for the one with the clicky menu logo: keycode 127

As above, I'll eventually figure out something to do with this, but I haven't done so yet. The problem here is that WindowMaker appears not to see the Windows keys at all... but we'll work it out ;-)

In case you ever want to fiddle with weird keys on any laptop, you will find that Linux comes with a little utility called getkeycode, which is extremely helpful when you want to work out what an odd key actually does. Try it in a console: type any key once getkeycode is invoked and it will tell you what key code it translates to (useful when remapping your keyboard, too).  When you've finished with getkeycode, just don't type anything for a few seconds and the program will terminate.
 

6.6. APMD

You want to monitor the battery power? No problem... just recompile your kernel with APMD enabled. I'll go through the optimum recompilation of your kernel as soon as I get time to add to this document, and include the APMD settings.

This does sound daunting, but don't worry; kernel recompilation isn't nearly as horrible as it sounds.Following this, there's a utility called 'xapm' which gives a read-out of the power remaining in the battery in a nice compact little bar-chart format. However, I'd recommend using it sparingly as it does tend to crash my laptop after a certain period of time (not apmd, just xapm, but there's probably something going on there in the kernel).

In case you're wondering, the battery life usually turns out to be around 2 1/2 hours, which is fairly good for an 800MHz processor laptop. It certainly surprised me. If you treat it carefully, you can get longer; if you thrash it to death (for example, by using it to view a DVD- the CD/DVDRom access is very costly in terms of battery life) you can expect an hour and a half to two hours. This isn't bad, though. You can just about get through a movie in that amount of time. I need to work more on the problem of conserving battery under Linux, though, since Windows appears to power save in a way Linux doesn't.

6.7. Problem with plugging in an external PS/2 mouse

When I tried to plug in any PS/2 mouse externally it worked fine under X but not well under gpm - but do not try to use both the touch pad and the external PS/2 mouse since they appear to conflict with each other. This is not surprising, although some systems cope better with this - what it means, I believe, is that the two mice are considered by Linux to be on the same PS/2 port. So I decided to cheat and use a USB mouse instead... see 6.8.

6.8. Using a USB Logitech optical wheel mouse

I'm amazed I got this to work. But it did. It's worth doing because of the following reasons:

a) The problem with external PS/2 mice as described in 6.7
b) It saves a PS/2 port
c) Many people claim Linux has no USB support- next time they say this, just point to your mouse.
d) Optical mice are accurate, and work on almost any surface including your own screen, foot, chair arm, shirt, or your Windows NT system admininistrator's back (see? They had to be good for something).
e) Let's be honest, this laptop cost over a thousand pounds; we want it to look as cool as possible - and there's nothing cooler than a red blinking laser style Logitech optical wheel mouse. That's probably the best of the reasons given here ;-)

UPDATE:  Firstly, turn on "USB Human Interface device support" in the USB support and Mouse support in the Input core support section of the kernel configuration. Do not turn on USB HIDBP mouse support.

Plug in the USB mouse, see if your mouse has been correctly sensed by the kernel. If there's no kernel messages, look for changes to /proc/bus/usb/devices.

USB supports multiple identical devices, ergo you can have several mice plugged in. You can get each mouse separately, or mixed together. Set a device node entry for the mixed mice (you usually want them mixed together).

Generally, create the entries for this 'mixed mouse' device in the /dev/input directory, like so:
mkdir /dev/input
mknod /dev/input/mice c 13 63

if you cat /dev/input/mice, you should get some odd characters out as you move the mouse or click any of the buttons.

Voila. One correctly set up USB mouse.

Now, you have to add it as a device in your xf86config:

Section "InputDevice"
             Identifier  "USB Mice"
             Driver      "mouse"
             Option      "Protocol"   "IMPS/2"
             Option      "Device"     "/dev/input/mice"
        EndSection

or, if you want to use a wheel mouse (the nice Logitech USB I used, for example), something like:
        Section "InputDevice"
             Identifier  "USB Mice"
             Driver      "mouse"
             Option      "Protocol"   "IMPS/2"
             Option      "Device"     "/dev/input/mice"
             Option      "ZAxisMapping"   "4 5"
             Option      "Buttons"        "5"
        EndSection

Also, add an entry to each ServerLayout section (this is all for xfree 4, by the way)
    InputDevice "USB Mice" "CorePointer"

If you want to use both a USB mouse (or USB mice) and some other kind of pointer device, then add (do not replace) the following line to the applicable ServerLayout sections:
    InputDevice "USB Mice" "SendCoreEvents"

As a side note, there must be one input device on XFree4 set to 'CorePointer', and the others should 'SendCoreEvents'. The CorePointer should always be present, whilst the other one is basically just an extra.

On XFree 3.3 you must use the XInput extensions.

See this page for more information about the whole topic of USB devices. It's the page I used for reference.

6.9. Playing Mpeg and DivX ;-) movies

Warning: Before I discuss this I should add that DivX ;-) is a hack and a darn naughty one too. It's a modified version of some Microsoft libraries allowing Mpeg4 encoding to be used in AVI format (something Microsoft weren't planning on giving to the world any time soon). To make these libraries apparently required reverse engineering of questionable legality. However, it exists- what you choose to use it for is up to you. There are some DivX/mpeg4 encoded AVIs on the Movie Archive online, quite hilarious old American 1950s morality plays and such. That's what I personally tend to use it for- they're hilarious...

The Advent 5480DVD is capable of running DivX ;-) movies in Windows without slowing the movie or significant frame dropping (btw. you can use OpenDivX, which is not reverse engineered and therefore, if I understand correctly, is legal). On Linux, your milage will vary.

Two useful utilities are aviplay and mplayer. Both can be found on freshmeat.net. Both use the Windows binary DLL libraries (their respective web pages will explain the details of installation).

Mplayer:

Note that mplayer tries to use the XFree4 extensions, which accelerate the system's graphics under certain known cards. No such extension exists in my knowledge for the Advent's SIS graphics card, unfortunately. You might try installing SDL (also available on freshmeat.net), or using the framebuffer to view movies. Typical command line "mplayer -vo sdl foo.avi" or "mplayer -vo fbdev foo.avi".

It works fine for small movies but awfully for large movies, ie larger than 300*400 pixels resolution or so - the graphics is perfect, but the sound skips. I did take this up with the mplayer development people, who informed me that you shouldn't TRY to view movies with a larger resolution than this. They also suggested that the sound problem was due to the Trident card's inability to cope with 48khz sound but since aviplay doesn't have a sound problem... well...  I'll keep playing  with it. Be reassured that it isn't the laptop's hardware causing the problem, however.

You will also notice that mplayer causes the XFree86 server's memory and cpu usage to go through the roof. That's because it does something clever with fast video memory - don't panic.

Aviplay:

Sound works well with aviplay. Unfortunately, graphics suffers, since aviplay tends to drop lots of frames.

So I'll let you know once I find one that really works. On the other hand, if you have mpeg video from the old days when they used to sell movies on two CDs *nostalgic sigh* mplayer probably won't have a problem displaying it.

6.10 The perfect(ish) kernel recompilation

Here's my .config file... you can use it by putting it into your /usr/src/linux directory (remember to rename it to .config and replace the old .config with it). Then run the following sequence to get exactly the same kernel as I have... hoping you really do have the same model of Advent as I.
 

make dep
make clean
make bzImage
make modules
make modules_install
then take the resulting bzImage file from arch/i386/boot and put it into, say, your /boot directory, add an entry for it in lilo.conf (/etc/lilo.conf, this won't work if you don't use lilo or use grub - I don't know much about grub), and reboot and try it. Warning: Do Not Replace Your Existing Kernel With This One. Add it; don't overwrite it. Or You Will Regret It, Yea, And Feel Darn Silly Too When You Realise You Forgot To Include Something Important And Your System Doesn't Boot ;-)

Here's how to add the lilo entry:
 

image=/boot/mylovelynewimage
  root = /dev/hda5
  label = MyCuteLinux
  read-only
Just follow the existing entries in the lilo.conf file... Oh, and remember to type 'lilo' before you reboot or it won't update the bootloader. Lilo doesn't dynamically read the config file, just once each time you install it.

6.11 IRdA

6.12 Customising your Bash prompt for use with a laptop

Basically due to a Slashdot discussion on the subject of odd and strange Bash prompts (you know, when you're using the command line, the prompt at the beginning of the line? It usually says something like bob@foo:bar #>) I decided to customise my Bash prompt so that it would give me the status of my laptop battery.

Now in Bash, there's two values of particular interest here. The command prompt itself is stored in the variable $PS1 - you can change it by telling Bash 'PS1=" What can I do for you now, Master? "' and see what happens... and there's another variable, called $PROMPT_COMMAND, which far from actually being the command prompt, is a command which is executed just before each new command prompt is printed on screen.

First, you can try using this line: $PROMPT_COMMAND="echo \`apm\`"

Unfortunately, you might note that (if you have the same APM install as myself) it tends to give a very long line like 'AC off-line, battery charging: 1.45 (n%)'. Well, I didn't like that, so I used sed (a stream text editor) to shorten the result like so:

PROMPT_COMMAND="echo \`apm\` | sed s/AC\ on\-line\:\ /\[AC\]\ /g | sed s/AC\ off\-line\,\ battery\ charging\:\ /\[BATT\]\ /g"

Now, each time you press 'return' you should get a comment like this:
[AC] 99% (1:45)
em@hal :~ #

Good, isn't it?...

As for putting this in your PS1 so you only have one line... let's see...
PROMPT_COMMAND="PS1=\"\`date +%H:%M\` \u@\H:\w \""
so...
PROMPT_COMMAND="PS1=\"\`apm\` # \""
This refreshes correctly (nb. there is a reason why I didn't just put PS1=(all that APM and sed stuff...). It's because if you do that, it doesn't refresh it. Bash doesn't bother reevaluating PS1 every single time...)
Now putting all that sed stuff back in is a bit of a challenge (btw. type 'man sed' if you're interested in how sed actually works), but I'm sure we'll be able to beat it eventually.

Yup, here we go:
PROMPT_COMMAND="PS1=\" \$(echo \$(apm) | sed s/AC\ on\-line\:\ /\[AC\]\ /g | sed s/AC\ off\-line\,\ battery\ charging\:\ /\[BATT\]\ /g) \$(date +%H:%M) \u@\H:\w # \""

What does this command do? Well, each time you get a new command prompt it evaluates this command first, meaning that you get:
under AC current (ie, when the laptop is plugged in)

[AC] 99% (1:15) 01:35 root@hal:~ #

and under DC (ie when the laptop is running off a battery)

[BATT] 99% (1:15) 01:35 root@hal:~ #

Voila: time, battery status, username, hostname and directory name - all in a few characters of (only slightly oversized) command prompt. I wouldn't necessarily use it all the time, but I kind of like it ;-)
Oh, and if you want to delete the AC/battery information entirely, try the below:

PROMPT_COMMAND="PS1=\" \$(echo \$(apm) | sed s/AC\ on\-line\:\ //g | sed s/AC\ off\-line\,\ battery\ charging\:\ //g) \$(date +%H:%M) \u@\H:\w # \""

Or of course, if you want it in bright blue (bold) - do this if you know you have tested it first. For me it looks beautiful on an xterm, but it won't look good on a console that doesn't know how to display it (most do, though, at least it works fine on my framebuffered console). It may or may not show garbage - anyway, here's how:

 PROMPT_COMMAND="PS1=\"\[\033[1;34m\]\$(echo \$(apm) | sed s/AC\ on\-line\:\ /\[AC\]\ /g | sed s/AC\ off\-line\,\ battery\ charging\:\ /\[BATT\]\ /g | sed s/\ \(.*\)//g) \$(date +%H:%M) \u@\H:\w # \[\033[0m\] \""

It looks like this:

[status] battery_remaining_percentage% time username@hostname:directory #

[AC] 99% 01:51 root@hal:~ #
[BATT] 99% 01:51 root@hal:~ #

For other laptops this should still work, provided apmd is enabled. However, it is possible that your apmd won't say quite the same thing as mine (you know, the bits like 'AC offline, battery charging'?). In this case, you just need to replace those bits in the 'sed s/expression/replacement/g expressions with your variant expression, remembering to comment out all the odd characters like spaces and commas.
 

Part 7: Conclusions
 
I hope this has all worked out all right for you and that you're not as depressed with your new hardware as I was,  in the week before I managed to get it to work straight. Bear in mind that it's just a matter of time and effort.

Once it's finished, it works out very nicely. This laptop is really an impressive bit of hardware (for the price- believe me, there are worse laptops out there, and better, but I haven't robbed enough banks to afford better). Sounds good- the sound card is rather nice and the speakers are /really/ nice - looks good (even better with a Linux penguin firmly affixed to the front), though it's a bit flimsy - and generally offers very good value for money for all those people willing to take their laptop with them on their happy journey into Linuxville ;-)

If you want to comment on these pages, or if you have any questions, or if I got something blatantly wrong, and particularly if you got any form of Advent laptop to work straight without using my solutions and have a moment to let me know what you did, please address your mail to Em Tonkin at 'admin@typodemon.com'.

Of course, if you want help there's also the lovely new as yet untested mailing list or the equally lovely, new, and untested big table of Advent laptops to turn to...