Practical Linux topics

last updated 06 January, 2004

Table of contents

0. Soft Modem
1. PLIP and Parport
2. Multiboot on a laptop

Linux runs on most commodity PCs and laptops, but there are small hardware details that can cause problems. A common hardware problem occurs with cheap soft modems (which implement the PHY-layer in hardware with the LLC-layer in software); and real-time problems occasionally emerge using generic kernels, such as with devices connected to the parallel port; and small bioses in laptops require careful bootloader configuration.

0. Soft modem

The Dell Dimension 8300 is a well-equipped PC in the E1500 price range, delivered with a P4 2.4GHz, 512MB RAM, NVIDIA GeForce4 MX 420 (analog) graphics and 1702 Digital flat panel monitor; but the modem is a cheap Broadcom 4212 softmodem. A driver for this softmodem is provided by BCM and an RPM is found at dell support. This is a proprietary driver and not released under a free software license. However, I believe a software modem is certified for connection to the public telephone system _only_ with a combination of the electronics with the software together. And I believe writing free software (specially the LLC layer to run on the PHY-layer electronics) and then connecting to the public telephone network would be un-certified (with all the implications). So, in this case, I have no problem using the proprietary Broadcom driver software, provided as is.

The BCM driver is written for RedHat, although it built with some small changes with SuSE Personal 8.2. First the Linux kernel sources have to be downloaded (not distributed with Personal 8.2) since the driver requires certain header files. The kernel-source-2.4.20 RPM package is available from http://www.mirror.ac.uk/sites/ftp.suse.com/pub/suse/i386/8.2/suse/i586/. Both these driver and kernel RPMs install fine.

After extracting the RPM files, the README instructions to build the BCMSM driver for RedHat 5.x/6.x can basically be followed to build for SuSE Linux. First the Makefile should be modified to set KERNEL_SRC to /lib/modules/`uname -R`/linux instead of /usr/src/linux. On running the Makefile, I also found it necessary to make a small change to /usr/src/linux/include/linux/kernel.h; the dbg_print definition (line 200 or so) confuses the gcc parser resulting in a binary operator error, so this line can be commented out while building the driver (un-commenting back in afterwards!). Otherwise the BCMSM module files build straightforwardly and are saved in /lib/modules/`uname -R`/misc and the /dev/ttySM family of files are created; a link should be made from /dev/modem to /dev/ttySM0.

The Makefile also copies a BCMSM init script to /etc/rc.d/init.d, which can subsequently be moved or linked to from /etc/rc.d in order to be consistent with other SuSE Linux startup files. Entries need to be added into /etc/rc.d/rc5 (S18 and K02 or so) to start and stop the modem as Linux comes up/down in the usual way. On re-booting (select F2 to see the verbose system initialisation), the modem driver script (and var/log/messages) should show the modem coming up okay and on entering KDE the telecom-connection icon should appear (or run KInternet).

The only remaining setup needed is /etc/ppp/options and a /etc/ppp/startup script to connect to your service provider (see the PPP howto for details). The modem should now work fine and you should be able to successfully connect to the Internet using SuSE Linux Personal 8.2 and a softmodem on your Dell PC.

1. PLIP and parport

A PC-to-PC ECP parallel cable and PLIP (the parallel-cable link interface protocol) provide a cheap and reasonably fast IP connection between 2 PCs. Connect the cable and run: ifconfig plip0 HOSTNAME1 pointopoint HOSTNAME2 [HOSTNAME1/2 being the names respectively in /etc/HOSTNAME with entries for IP addresses in /etc/hosts]; followed by route add HOSTNAME2 netmask 255.255.255.0 plip0. (You may need to run both these commands as root, and the route command may be un-necessary if running route alone shows a network entry over plip0.)

The parallel network can be tested using ping and I found it almost works with SuSE Personal 8.2: somewhere between 0 and 30/40 64-byte packet transfers are exchanged and then ping freezes! Interestingly, I noted my old PC (RedHat 4.0 and patches/hacks) reported a round trip of about 4.5mS whereas the new SuSE Personal 8.2 reported about 11.5mS. You may also note /proc/net/, /proc/int, /var/log/messages show plip0 connected with interrupt 255 (or none) with some comment about this being inefficient. If so, try changing /etc/modules.conf to add a line for parport_pc with int,7 based on the template line given (interrupt 7 is used by my old RedHat machine, 4 and 13 were also free on my PC). After a reboot, ping should work fine and you should successfully be able to use scp to transfer files between the PCs.

While SuSE choose not to pre-assign interrupts (since PC hardware varies), you might want to assign an interrupt to parport. If not, use of the parallel port replies on parport polling fast enough which it fails to do for PLIP. Maybe polling works okay for a printer, but in my experience this is not the case for a parallel port (c.w. firewire) network.

2. Multiboot on a laptop

The Dell Inspiron 8600 is a well-equipped laptop in the E1500 price range, delivered with a Celeron 1.4GHz, 512MB RAM, NVIDIA GeForce4 4200 Go graphics, and a media bay into which either a CD-RW or a second hard disk can be inserted. (It also has a BCM V.92 56k soft modem and a parallel port to be configured.) To install Linux on the second hard disk (and leave MS-windows on the primary), requires the HDD in the media bay and an external USB CD-R device. Insert the SuSE CD into the external CD-R, and from the bios startup press F12 to boot from the external USB CD-R. Install Linux onto ide1 /dev/hdc using Yast2, paying close attention to the disk partitioning and bootloader configuration as follows.

The Dell 8600 bios will only successfully boot from the MBR (hd0) or the first partition (hd0,0) of either hard disk. The Linux /boot (ext2fs) mountpoint must be created at the first partition, i.e. /dev/hdc1, in order to boot from it. [The swap partition (swapfs) works well enough from /dev/hdc2; with root / (reiserfs) at /dev/hdc3 and /home (reiserfs) at /dev/hdc4, for example.]

When booting, the Dell bios re-orders the hard disk sequence depending upon the (F12) boot menu selection, placing the chosen device first. So, the GNU grub bootloader device map configuration requires only (hd0) and /dev/hdc disk order (instead of the SuSE (hd0),(hd1) /dev/hda, /dev/hdc default). [The windows and floppy options (unless you bought the floppy disk option for the laptop) should also be removed from grub boot menu list.] Check the bootloader is installed either to (hd0,0) on /boot or to (hd0) on disk 2 MBR. [Do not overwrite disk 1 MBR; or you will always require the second hard disk installed in the media bay in order to boot windows!]

If the bootloader configuration or disk partitioning is wrong, the bios will be unable to boot from the second HDD. [You can always reboot from the external CD-R and re-run the Linux installation to make corrections.] bios failure: You may see the second hard disk LED flash and then no further activity, when the bios cannot vector to the stage1 bootloader. Check the disk partitioning as above, or re-install grub to the 2nd disk MBR. stage1 failure: You may see stage1 print GRUB and then no further activity, when the configured disk geometry is incorrect. Probably the configuration points to /dev/hda instead of /dev/hdc. You can confirm which disk grub expects to find the second stage image; from Yast2 boot loader configuration, manually edit the grub configuration files to remove the 'd' option in /etc/grub.conf, the line beginning "install --stage2" (see below), and continue with a minimal re-installation. Without the 'd' option, grub should boot interactively without looking for the stage2 boot image on disk. After Yast2 reboots and from the grub> prompt, use the root (hd0,0) command [see info grub] to print the disk partition format; it should be 0x83 linux ext2fs (or similar), but for /dev/hda it will be unknown windows.

The correct /etc/grub.conf for the Dell 8600 will be similar to:
  root (hd0,0)
  install --stage2=/boot/grub/stage2 /grub/stage1 d (hd0) /grub/stage2 0x8000
  (hd0,0)/grub/menu.lst
  quit

and the correct /boot/grub/device.map for the Dell 8600 is:
  (hd0)   /dev/hdc



Copyright (C) 2003-2004, Julian Rose, Sussex U.K. smtp.user=jhrose smtp.domain=dial.pipex.com