LINUX GAZETTE

[ Prev ][ Table of Contents ][ Front Page ][ Talkback ][ FAQ ][ Next ]

"Linux Gazette...making Linux just a little more fun!"


Installing USB, PCMCIA and Kernel 2.2.18 On My Laptop

By Mark Nielsen


[Editor's note: Linux users are currently migrating from kernel series 2.2 to 2.4. Linux 2.4 includes vastly improved USB support. Most distributions and users have not yet made the switch, but will during the next several months. The steps below were written for kernel 2.2.8. See the links in the References section below (especially the Linux-USB Guide), for the latest information on getting USB to work with Linux.

Also, the 2.4 kernel includes PCMCIA support, so try that first. Those drivers don't work for everyone; if you're one of the unlucky few, get the pcmcia-cs package.

Contents

  1. Introduction
  2. Installing 2.2.18
  3. Configuring Lilo to use the old and new kernels
  4. Setting up USB
  5. Changing the Ricochet modem from serial to USB.
  6. Some problems with laptop and resources.
  7. Conclusion
  8. References

Introduction

I wanted to use my Ricochet modem on my laptop using the USB port. I had successfully downloaded kernel 2.2.18 and used USB with my other computers. I didn't feel like getting kernel 2.4 at the time.

The problem with my laptop was the fact it was using pcmcia devices. I found out later that I had to download pcmcia-cs and install it after I installed the new kernel 2.2.18.

Getting USB to work on my laptop meant I had to do several things,

  1. Install the new kernel 2.2.18.
  2. Install the pcmcia drivers.
  3. Configure Lilo to use the old kernel and the new kernel.
  4. Make sure the usb modules are loaded at boot time.
  5. Create a node under /dev/usb for the Ricochet modem.
  6. Reconfigure my ppp settings.
  7. When I was confident the new kernel was working good, make it the default when the computer boots.
  8. Unfortunately, because of the stupidity of the BIOS on my laptop and because of this stupid plug-and-pray garbage, I can only have my USB port working when neither of the pcmcia slots are in use. This means I can't hook up my laptop to the my local network using my pcmcia ethernet card. This isn't the Linux kernels fault, but the dumb computer.

Installing 2.2.18

Here are the steps I used to install the kernel and the pcmcia drivers.
  1. Configure and install the new kernel with console drivers, usb support, and pcmcia. I also selected a bunch of other options.
  2. Download pcmcia-cs and install using the src directory from the new kernel.
Here are the commands I used to install the new kernel
   ## change to the src directory for the linux kernel
   ## for xconfig, I selected the usb options and VESA VGA graphics console
   ## under console drivers for my laptop
make xconfig
make clean
make dep
make bzImage
make install
make modules
make modules_install
Here are the steps I used to install pcmcia-cs.
tar -zxvf pcmcia-cs-3.1.23.tar.gz
  ### Make sure you specify the root directory for the new kernel
  ### mine was /usr/src/linux-2.2.18/linux
  ### I didn't change the other default options.
make config
make all
  ### This puts the modules under /lib/modules/2.2.18
make install

Configuring lilo to use the old and new kernel.

Here is the old and new configuration I had for /etc/lilo.conf. I highly recommend that you do not use this for yourself, as I customized lilo.conf for my own needs. After I edited /etc/lilo.conf to the new configuration, I just typed "lilo" at the command prompt. Then, when I rebooted my computer, I had a choice of "linux_new" or "linux". After I was confident the new kernel was working, I changed it to be the default.

Old configuration.

### Configuration for GNUJobs.com test laptop
vga=791 
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux

image=/boot/vmlinuz-2.2.12-32
	label=linux
	initrd=/boot/initrd-2.2.12-32.img
	read-only
	append="hdc=ide-scsi"
#        ramdisk_size=40000
	root=/dev/hda5

New lilo.conf configuration.
### Configuration for GNUJobs.com test laptop 
### New kernel installed. Remember to install console drivers
### into new kernels otherwise vga=791 doesn't work.

vga=791 
#vga=ask
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux_new

image=/boot/vmlinuz-2.2.18
        label=linux_new
        read-only
        append="hdc=ide-scsi"
              ### /dev/hda5 is root for GNUJobs.com laptop
        root=/dev/hda5

image=/boot/vmlinuz-2.2.12-32
	label=linux
	initrd=/boot/initrd-2.2.12-32.img
	read-only
	append="hdc=ide-scsi"
              ### /dev/hda5 is root for GNUJobs.com laptop
	root=/dev/hda5

Setting up USB

In order to setup USB, I had to put these commands into my /etc/rc.d/rc.local file.
   ### This command mounts the filesystem for usb to /proc/bus/usb. 
mount -t usbdevfs none /proc/bus/usb
   ### Load a generic usb module -- choose one of these three depending on your
   ### motherboard or USB card.  I have been able to use
   ### uhci or usb-uhci on all my motherboards so far.  If you aren't sure 
   ### which module to use, see "Basic USB Configuration" in the Linux-USB Guide
   ### at http://www.linux-usb.org/USB-guide/c122.html#AEN124
insmod /lib/modules/2.2.18/usb/uhci.o
# insmod /lib/modules/2.2.18/usb/usb-uhci.o
# insmod /lib/modules/2.2.18/usb/usb-ohci.o
   ### Load the module for modems, like Ricochet
insmod /lib/modules/2.2.18/usb/acm.o

Changing the Ricochet modem from serial to USB

In order to change my Ricochet modem to use the new usb, I had to load the modules described in the previous section, and then create a new node and make my ppp configuration use the new node.
mkdir /dev/usb
mknod /dev/usb/ttyACM0 c 166 0 

Again, I changed my modem from using /dev/ttyS0 to /dev/usb/ttyACM0. Now my Ricochet modem is working, and it seems like it is going faster than the serial modem, like it should be, but it could be my imagination. Note that these two commands are permanent: you only need to run them once. Also, this is /dev/usb, not /proc/bus/usb (explained in the Linux-USB Guide). Kernel files magically appear and disappear in /proc/bus/usb as devices are plugged in and unplugged, but that's not what this file is. USB Ricochet modems require a /dev entry; some other USB devices don't. The usbdevfs manages /proc/bus/usb, not /dev/usb.

Some problems with laptop and resources

I installed the new kernel on my laptop from DELL. I did have some problems. It seems like my stupid laptop doesn't have enough irqs to handle using the USB port. Thus, I now have to buy a USB mouse (and maybe keyboard) to free up some irqs. I also had this problem when I tried to use my pcmcia modem and pcmcia ethernet card at the same time. I haven't been able to solve this problem. Now when I use the USB port, I can't use either pcmcia card. It is extremely annoying that I can't get anything to use irq 10, and that I can't disable the parallel port, serial port, and internal ps/2 mouse. The DELL computer was by far the best Linux laptop I had seen, but now it will become outdated soon. I imagine with kernel 2.4, there will be a lot more commercial support for Linux. Why on earth the software evil empire and the hardware evil empire came together to create the user-friendly plug-and-pray nonsense is beyond me. I know my laptop has free resources but I cannot force it to use those resources. Very annoying. I am extremely unimpressed with the BIOS of the particular DELL laptop I got.

I bought another laptop for one of my employees at GNUJobs.com from Emperor Linux, and it was properly configured, and I grilled the salesperson to make sure I got everything working without any problems. I am much happier with the laptop I got from Emperor Linux.

Another goofy thing I did was I forgot to install the iso9660 format into the kernel (or as a module). Now I can't read cdroms. I will have to compile the kernel one more time and specify to include the iso9660 filesystem format as a module.

Conclusion

I am extremely impressed with the USB support in the Linux kernel 2.2.18. After Kernel 2.4.1 comes out, I will most likely upgrade my kernel to 2.4. I have read all the new features about kernel 2.4, and it looks exciting!

Overall, I am impressed with the fact that is was pretty painless to install the new kernel. Installing one kernel didn't blow away earlier kernels, which made it so I could test out the new kernel without getting rid of the old one. This is helpful if I want to revert back to the old kernel. For example, before I installed pcmcia-cs for the new kernel, my laptop's ethernet card didn't work, and hence, it was helpful that I could boot to the old kernel where the ethernet card would still work. Had this happened in a lame operating system which just forces upgrades and wouldn't let you choose how to control your system, I might have been screwed.

Even though the installation was fairly easy for me, it might be easier for other people to just use rpms and to rely on their favorite Linux distribution to help them out. This is the easiest installation of the kernel and pcmcia drivers for a laptop that I have ever experienced. It is nice to see the installation getting easier and easier. After years of having to fight with the kernel for one reason or another, it is nice to see all these technologies come together.

I don't see how the evil empire will be able to resist its downfall considering the fact that GNU/Linux (and OpenBSD and FreeBSD) are technologically superior and are providing user friendliness with GNOME and KDE. The evil empire has never cared about technology, but marketing and user-friendliness. Some of the evil commercial UNIX vendors only cared about technology and did not care about making their environment pleasant to use or user-friendly. Since GNU/Linux is merging technology with user-friendliness, which is the way people want it, we get the best of both worlds, instead of having evil empires dictate to us what they think is best (or how to control us so that they can milk us).

References

  1. Taken directly from linux/Documentation/usb/usb-help.txt
    
    2000-July-12
    
    For USB help other than the readme files that are located in
    linux/Documentation/usb/*, see the following:
    
    Linux-USB project:  http://www.linux-usb.org
      mirrors at        http://www.suse.cz/development/linux-usb/
             and        http://usb.in.tum.de/linux-usb/
    
    Linux USB Guide:    http://www.linux-usb.org/USB-guide/book1.html
       READ THIS!          (or other Linux-USB mirrors)
    
    Linux-USB device overview (working devices and drivers):
                        http://www.qbik.ch/usb/devices/
        
    The Linux-USB mailing lists are:
      linux-usb-users@lists.sourceforge.net   for general user help
      linux-usb-devel@lists.sourceforge.net   for developer discussions
    
    
    
  2. Linux Kernel 2.2.18
  3. PCMCIA-CS source
  4. Using the wireless modem Ricochet
  5. Original site for this article - http://www.gnujobs.com/Articles/15/USB.html. (any updates will be here)


Copyright © 2001, Mark Nielsen.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 63 of Linux Gazette, Mid-February (EXTRA) 2001

[ Prev ][ Table of Contents ][ Front Page ][ Talkback ][ FAQ ][ Next ]