Curriculum vitae (PDF)
   Publication list
   TeX & LaTeX
   MultiMedia SPL
   My alumni ITS page
   Swiss Train Schedules
Created by XEmacs
Valid HTML 4.0!

Linux on the OB HP 4150

Note that I have not been able to maintain this page since March 2004, so its content might be outdated.

I have been running RedHat Linux on my laptop with great results. However, setting Linux to run smoothly on a laptop is not as easy as on a Desktop, so here is a recollection of my experiences hoping that it will be useful to someone. If you have any suggestions please do not hesitate to contact me, they are always welcome!

If you have an Omnibook and you use Linux, you should check the Omnibook page and the omnibook mailing list for any additional information or help.

The laptop

The laptop is an HP Omnibook 4150 (F1629N), with the following characteristics:

  • Intel Pentium II 300 MHz processor, 512 Kb L2 cache
  • 256 MB SDRAM
  • 18 GB IBM-DARA-218000 Hard disk
  • Neomagic MagicMedia 256 AV (NM2200) video card with 2.5 Mb RAM
  • Neomagic MagicMedia 256 AV (NM2200) audio (emulating Microsoft Sound System)
  • 1024x768 color TFT display
  • Phoenix BIOS 4.0 R6.0 (HP version 2.28)
  • Xircom CreditCard Ethernet 10/100+ Modem 56 PCMCIA card (CEM56-100)

In addition I have the port replicator (i.e., small base station) and a 21" external monitor that I use in my office.

For this laptop HP produces two different BIOS: version 2.x which is APM based and version 7.x which is ACPI based. The APM based one is targeted to Win9x, WinME and WinNT, while the ACPI one is for Win2000. For Linux it is best to use the APM based one. The ACPI based BIOS does not behave well for suspending (it often locked up my machine) and does not have the suspend to disk feature.

The Linux setup

Update 8-Oct-2002: I upgraded to RedHat 8.0 (without Ximian's Desktop) but I'm running the 7.3 kernel 2.4.18-10 due to an incompatibility with some proprietary modules (OSS and Cisco's VPN). However, the setup remains pretty much the same.

I'm currently running RedHat Linux 7.2 with Ximian Desktop on top, but I previously had 6.2 and 7.1 with very similar setups. I did a custom install where I installed pretty much everything. The particular settings I have are:

  • All my partitions are ext3 based. This has saved me a lot of time when for some reason the computer crashes (unfortunately this happens from time to time).
  • The kernel is RedHat's 2.4.9-13. Kernels 2.4.7-10 and previous have a terrible virtual memory management and I ended swapping a lot. 2.4.9-13 memory management is not perfect but it is getting there. Also ext3 on the latest kernel is improved, under 2.4.7-10 ext3 sometimes used a lot of memory causing swap (in particular when running updatedb).


RedHat 7.2 comes with XFree 4.1, which I use. Since I use an external monitor at work and the internal LCD elsewhere I have a special XFree configuration that allows me to switch between external and internal displays.

Update 13-Jun-2002: Now I'm using XFree86-4.2.0-6.62 from RedHat's 7.3 beta (Skipjack) distribution with a patch from the XFree86 CVS that allows for Xvideo support on the Neomagic graphics chip. See my main Linux page to obtain this RPM, driver and/or patch. This patch has been accepted into RedHat's XFree86-4.2.0-50.11 in rawhide.

While the Fn+F5 key combo on the laptop can switch between the internal and external displays, XFree is not able to reset the refresh rate. So if I start XFree on the internal LCD (which it does by default), when I switch to the external monitor I get a 60Hz refresh rate, which I just don't stand long. In order to overcome this limitation I have configured 4 different screens in my XFree86 config:

  • auto: don't force anything, just use what the BIOS tells when starting the X server. If it starts when the computer has the external monitor attached it's fine, otherwise the refresh rate will be limited to 60 Hz, as explained above.
  • lcd: forces X to start on the internal LCD display by using the internDisp option. This limits the possible refresh rate of the external display to 60Hz.
  • monitor: forces X to start on the external display by using the externDisp option. This makes the X server to always start on the external display, but one can always switch using the Fn+F5 key combo.
  • both: forces X to start on both displays. This also limits the possible refresh rate to 60Hz.

The screen to use can be chosen at X startup with the -screen option, passed as a server option to startx. For example "startx -- -screen monitor". I have a script x11-ask-opts that asks the user which screen to use on startup and passes the options to startx. My XFree config file is here.

I usually start in the monitor config. In this way I don't need to restart X when I get to work and plug the suspended computer into the port replicator. When the external monitor is not attached I simple use the Fn+F5 key combo to get the image on the LCD.


Although the chipset (440BX - 82443BX) is AGP capable and the video card is advertised as such, I've not been able to get AGP working. When I try to load the agpgart module the machine freezes. After delving into the module's source code and the chipset data sheets I realized that the BIOS does not set the base of the aperture table (that can be seen by reading the APBASE register of the PCI AGP controller or by doing "lspci -v" and seeing that the memory is unassigned). This renders any attempt to use AGP nearly impossible. If anyone has an idea of how to work around this please let me know.


Sound on this laptop has been quite tricky to set up. I currently use the OSS drivers instead of Linux kernel ones.

While I finally managed to get the Linux kernel drivers working, they don't resume correctly after a suspend. I get "Sound: DMA (output) timed out - IRQ/DRQ config error?" repeatedly once I resume from suspend and the sound is completely garbled (each segment is repeated several times). Removing the drivers before suspend and reinserting them after resume does not solve the problem. The settings in /etc/modules.conf for the Linux kernel drivers are (the IO, IRQ and DMA settings should match your BIOS settings):

alias sound-slot-0 ad1848
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :
options sound dmabuf=1
alias synth0 opl3
options opl3 io=0x388
options ad1848 io=0x530 irq=5 dma=1 dma2=0

Since the kernel drivers don't resume correctly after a suspend, I have resorted to using the OSS drivers, although I would prefer using the kernel ones. If you have an idea how to get the kernel drivers resuming properly I would really like to know!

Update 13-Jun-2002: Note that depending on the exact model of the Omnibook 4150 that you have the settings above might or might not work. Jacek Pliszka has reported that it did not work for him and that he resorted to buying USB audio, which works like a charm for him.

Suspend and Hibernation

With the apmd daemon installed Linux can suspend (to RAM) and resume without trouble, by hitting the suspend button on the keyboard (normally the power switch). However a network/modem PCMCIA card does not work after resume, it is necessary to shut it off prior to suspend. That can be done by setting the following options in the /etc/sysconfig/apmd file:


Since I also have the CARDMGR_OPTS=-f option set in the /etc/sysconfig/pcmcia file the suspend will not complete until the PCMCIA system has been shut down, thus the suspend does take a bit of time to complete (around 30 secs.).

Update 13-Jun-2002: I occasionally experienced some lockups while resuming. After some time I realized that the culprits where the OSS sound drivers that are not APM aware. Adding the following lines to /etc/sysconfig/apmd solves the problem by removing them prior to suspend and reinserting them on resume:


Hibernation also works like a charm. Just hit the Fn+F12 key combo and the computer suspends to disk. To Linux everything is as if a suspend to RAM occurred. However a hibernation partition is required for this to work. If you don't have one (I didn't) you can create it using the lphdisk utility. The procedure is as follows:

  1. Run lphdisk -p to get the required size of the hibernation partition. It should be the amount of installed RAM plus video RAM plus a 2Mb margin.
  2. Make a primary partition of at least the recommended size. The primary partition must be entirely below cylinder 1024 and must be partition 4 (e.g., hda4). Otherwise the BIOS will not recognize it.
  3. Set the type of the partition to 0xA0 ("IBM Thinkpad hibernation" in fdisk).
  4. Run lphdisk to format the new partition. In some cases you might need to use the -f flag since some extended partition formats can confuse lphdisk in believing that something's wrong with the partition table. But be careful, if something's wrong lphdisk could scribble some of your important data!

After a reboot the BIOS should recognize the hibernation partition and enable the suspend to disk feature.

If you don't have free space on your partition table you will need to make some. The easiest is to delete some partition and make another one. However this is not always possible. I resorted to reducing the size of some partitions using resize2fs (part of the e2fsprogs package) and fdisk. The procedure is as follows:

  1. Unmount the filesystem residing on the partition to be resized.
  2. Use resize2fs to reduce the size of the filesystem.
  3. With fdisk delete the corresponding partition and create a new one with the same start and the desired length. It is important for the start of the partition to be the same.

This will not work if you need to resize your root partition, since you cannot unmount it. In that case you should boot with another partition as the root one. I did that by copying /bin, /sbin, /dev, /lib, /etc, /var and /tmp to some other partition and booting in single user mode with that as the root partition and did the fdisk stuff.

One word of warning. Blocks in fdisk and resize2fs are typically not the same size, and you need to take that into account when calculating the new sizes. As far as I know blocks in fdisk are always 1k. However blocks in resize2fs depend on the formating options and filesystem size. The number of blocks of an ext2 or ext3 filesystem can be known by doing "dumpe2fs -h partition" (e.g., partition is /dev/hda1). The "Block count" field gives the number of blocks and the "Block size" field the size of blocks (in bytes).

Another utility for repartitioning is parted (included in RedHat), which is more user friendly, although I have never used it.

Update 13-Jun-2002: Jacek Pliszka has pointed that it is much easier to do this using parted, which is included in the RedHat installation CD. Just boot in rescue mode and you can resize the partitions much more easily. You can probably even resize the root partition without all the complicated stuff above, since that partition will not be mounted in rescue mode.


Docking onto the port replicator can be done at any time, with the machine on, suspended or off. I have no particular remarks here. With a full-blown docking station the situation could be different.

Hotswapping the CD-ROM module

The Omnibook 4150 has a bay where one can plug a CD-ROM, DVD-ROM, or floppy drive or an additional battery. In the "old times" of kernels 2.2.x I could plug and unplug the DVD-ROM drive as much as I wanted, as long as no CD-ROM was mounted. I guess the same applies to the CD-ROM. To do that I had to compile the kernel cdrom and ide-cd drivers as modules, put "alias block-major-22 ide-cd" in the /etc/modules.conf file and pass the parameters "hdc=noprobe hdc=cdrom ide1=0x170,0x376,15" to the kernel at boot. That way I could plug the DVD-ROM drive even after booting up.

Unfortunately the above procedure does not work under 2.4.x kernels (an OOPS occurs). What I have managed to do is to be able to plug the DVD-ROM drive after boot, but only once. That is, if I boot without the DVD-ROM drive I can plug it and unplug it, but then I can not repeat the process until the next boot. If I boot with the DVD-ROM, I can just unplug it once. In order to do this I use the register and unregister options of hdparm. Beware that those options are marked as dangerous. Don't blame me if you loose data or fry your hardware! That being said I wrote a script (cdromctl) that controls that and makes sure I do it just once. The script was inspired by a similar one in the contrib part of the hdparm distribution.

If you have a better way of plugging/unplugging the DVD-ROM or CD-ROM drive module under Linux 2.4.x please let me know! I'm not very satisfied with the restriction of doing it just once!


PCMCIA works basically out of the box (I even did the RedHat install over the network with the PCMCIA card). However, there are a couple of things to watch out. Normally IRQ5 is used for sound, but PCMCIA does not know that if the sound modules are not loaded when PCMCIA starts (which happens at least with the OSS sound drivers). In order to prevent any conflicts I added the following line to /etc/pcmcia/config.opts:

exclude irq 5

You might also need to do that for some other devices, if you have them enabled (IRQ3 for IrDA, and IRQ7 for the parallel port).

The other problem I had is that most of the time my PCMCIA ethernet card would get corrupted data. I don't know if this is specific to my card (Xircom CEM56-100) or not. The workaround I have found is to unconfigure and reconfigure the eth0 interface just after it comes up. That settles the problem. The side effect of doing that is that the routing information is lost, so I have to put it in again. All this is done by my /sbin/ifup-local script, which is called by the network initialization scripts once the interface is up. This script also checks that the network cable is actually plugged (if not it brings down the interface to avoid things blocking) and sends all queued e-mail.

Update 13-Jun-2002: I have a new /sbin/ifup-local script that uses a more robust way to reinsert the routes after reconfiguring the device. It also uses the iflinkmon daemon that monitors the interface connection status, instead of using arping. It also restarts nscd after bringing up ppp connections so that the new DNS servers are noticed by all running applications. You can find the iflinkmon daemon on my main Linux page.

Update 8-Oct-2002: Now I do the device reconfiguration trick in /sbin/ifup-pre-local instead of /sbin/ifup-local. The advantage is that at that point the device is not yet up, so there is no need to play tricks with routes or any other things. Check my new /sbin/ifup-pre-local and /sbin/ifup-local scripts. The latter also restarts sendmail if the DNS servers have changed (/etc/resolv.conf).


At the office I use NFS to connect to the some fileservers. In general it works without problem. However I got one particularly annoying problem with a Sun file server. The NFS packets were too large and simply disappeared in the network, so my NFS mount would just hang there getting just very little data and it would be horribly slow. I solved this by limiting the NFS packet size with the wsize and rsize options to mount (e.g., "wsize=8192,rsize=8192"). This does not occur with kernels 2.2.x since they limit the NFS packet size. However kernels 2.4.x will use what the server tells is appropriate and in this case it is too large.

Other than that I use autofs for automounting the known NFS shares and amd for /net support. I also use options "intr" so that I can interrupt a process that is accessing a NFS share (for example if I disconnect the network and something was accessing a file), and "retry=1" so that if a NFS server is not connected or that I'm not on the office network the system will not try to mount it for more than one minute (by default it will try for one week before giving up which unnecessarily blocks the mount in my case). As example you can get my autofs /etc/auto.master file.

Update 13-Jun-2002: I'm currently using autofs-4, instead of autofs-3 that comes with RedHat 7.2. The advantage is that it has /net support built-in so I don't need amd anymore. You can find an autofs-4 RPM on my main Linux page. I don't know why RedHat does not include autofs v4 in their distribution (it's working very well for many people). I filed an entry in RedHat's bugzilla, bug #57022, add your comments into it and maybe they will include it in next release.


I'm pretty happy with this laptop, although a lack of documentation on many things has made me loose a lot of time trying to get things working properly. The laptop is quite sturdy, mine even survived a fall from 1m high, although some things got loose in the inside and needed opening. However, one thing that is really bad about this laptop is that the hinges that support the LCD display get very hard after some time, and this ends up breaking the metal frame of the LCD panel.

Last Modified: Wednesday, 06-Apr-2005 21:32:33 W. Europe Daylight Time

Diego Santa Cruz