Jon McCain
  - software - articles - about - contact  

Linux On A HP ZE4560us Laptop - Woody

The Goal
Install Debain GNU/Linux 3.0 (aka Woody) on my laptop without destroying the current installation of Windows XP.  Allow to boot into either operating system.

The Laptop
It is a Hewlett-Packard notebook HP Pavilion ZE4560us. Some technical details of this notebook:
  • mobile AMD Athlon 4 (XP) 2400+ ("Barton")
  • 512 MB DDR-SDRAM
  • 40 GB HDD 
  • CD-R/W-(24x/10x), DVD(4x)-Combo drive
  • integrated ATI Radeon Mobility IGP 320M VGA adapter with shared memory (16-128 MB)
  • SXGA+ TFT display with a resolution of 1024x768
  • ALi chipset with integrated audio controller
  • integrated V92 modem
  • 1x PCMCIA CardBus slot
  • integrated 10/100 MBit ethernet controller National Semiconductor
  • integrated 11 MBit IEEE 802.11b WLAN (wireless LAN) controller
  • other connectors: 2x USB 1.1, 1x IEEE 1394 Firewire, 1x SVideo-out, 1x VGA, 1x parallel, 1x serial, 1x p/s 2
That's right, no floppy disk drive.  But they have a coupon in the box that lets you get $50 back on an external usb one.  Since HP sells one on-line for $50 then it's basically free except for the shipping cost.

See the complete output of "lspci" here.
See the complete output of "lspci -vv" here.



Problem #1: Making Room For Linux
The hard drive came formatted as one big NTFS partition.  I did not want to mess up the current Windows XP so reformatting the drive into 2 partitions has not an option.  FIPS won't resize NTFS.  I found a windows/dos disk partition utility called bootitng that works with NTFS.  It has a 30 day free trial you can download.  Use it to make an iso cd image. Using the cd image to create a CD results in a bootable cd.  No need to install it, just go into maintence mode.   Then resize your partiition to get some free space.  I choose to have 3Gig free.



Installing Debian
Boot from the first Woody cd.  I chose to use the kernel 2.4 install.  So at the boot prompt I entered rescuebf24.  Hit F3 to see your options.  You can install with the normal 2.2.x kernel but you will have to switch to 2.4 kernel in the end to get the network adapter and usb storage to work.

When you partition the disk for the linux partitions remember not to touch the /dev/hda1 partition.  I used 2.9 Gig for ext2 and 32MB for swap space.   I did both as logical partitions.  This gave me /dev/hda5 and /dev/hda6.

Don't choose any modules, especially the ethernet card.  If you do, it will lock up at bootup because the ethernet card will get irq 11 and then pcmcia wants irq 11 to and locks up waiting for it. It seems to be okay to load both after the boot, just not as part of the boot itself.

Linux PCMCIA Card Services 3.1.33
  kernel build: 2.4.18 #4 Fri Nov 7 11:19:27 EST 2003
  options:  [pci] [cardbus] [apm]
Intel ISA/PCI/CardBus PCIC probe:
PCI: Found IRQ 11 for device 00:0a.0
IRQ routing conflict for 00:0a.0, have irq 5, want irq 11
  O2Micro OZ6912 rev 00 PCI-to-CardBus at slot 00:0a, mem 0x80000000
    host opts [0]: [pci/way] [pci irq 5] [lat 32/32] [bus 2/5]
    PCI irq 5 test failed
    ISA irqs (default) = 4,7,12 polling interval = 1000 ms


Note: This IRQ problem goes away once you have a kernel with acpi working. See below.

Make linux bootable but install LILO in the linux partition (/dev/hda5) NOT the MBR.

You need to turn off "USB legacy support" in the BIOS the next time you reboot, otherwise your machine will crash when trying to load a USB kernel module.



Duel Booting
At this point you can still only boot into windows.  We are going to let the NT boot loader let us choose the linux partition which will in turn call LILO.  This way we don't upset Windows.  But there is a trick.  Windows only lets you multiboot into other windows operating systems.  It can't just call a boot sector directly like LILO can. But we can copy the linux boot sector into a dos file that windows can call.

Get this command tool called bootpart.

C:\temp>bootpart
Boot Partition 2.50 for WinNT/2K/XP (c)1995-2002 G. Vollant (info@winimage.com)
WEB : http://www.winimage.com and http://www.winimage.com/bootpart.htm
Add partition in the Windows NT/2000/XP Multi-boot loader
Run "bootpart /?" for more information

Physical number of disk 0 : ae32ae32
 0 : C:* type=7  (HPFS/NTFS), size= 35985568 KB, Lba Pos=63
 1 : C:  type=5  (Extended), size= 3084480 KB, Lba Pos=71971200
 2 : C:  type=83   (Linux native), size= 3052318 KB, Lba Pos=71971263
 3 : C:  type=5   (Extended), size= 32130 KB, Lba Pos=78075900
 4 : C:  type=82    (Linux swap), size= 32098 KB, Lba Pos=78075963

This shows me my linux partition is on #2

C:\temp>bootpart 2 c:\bootlinx.bin Linux

This will create a file on the c: drive and add a line to boot.ini



Console Screen
Here is some interesting information I ran across. I have not tried it yet but it may fix the annoyance of having a big screen with the linux console just a small square in the middle of it. To set the console to a resolution of 1024x768, add this line to lilo.conf: vga=791
VESA resolutions in Pixel on the Linux standard console

colour depth | 640x480 800x600 1024x768 1280x1024
256 (8bit)| 769 771 773 775
32000 (15bit)| 784 787 790 793
65000 (16bit)| 785 788 791 794
16.7 Mill.(24bit)| 786 789 792 795

e.g. to get a resolution of 1024x768 with 16 Bit colour depth
you have to add the following option to lilo.conf:

vga=791

Don't forget to run "lilo" as root on command-line !!



Kernel 2.4
Don't bother using dselect to get the kernel 2.4.18 source from the debian package.  We need a more recent one so we can apply the acpi patch.  So go to kernel.org and get kernel 2.4.22. Then get the acpi patch and apply it. Here are some general instructions but you should go to the acpi project page and follow thier directions in case they have changed them.  They may even have a newer version.   This also assumes you already know how to configure,compile and install a linux kernel.

I put acpi-20031002.diff.bz2 in /usr/src

# cd <path to unpacked linux sources> (e.g. /usr/src/linux)
#
bunzip2 -c /usr/src/acpi-20031002.diff.bz2 | patch -p1

Now do a make menuconfig and choose your options. Here are the vital things you need for this laptop.  Using the modules for the hardware will be explained in the invidual sections below.

smp=N
pcmcia cardbus = N                            #We will compile pcmcia from the source code later, because wlan-ng needs the source
APIC=N                                             #Important! APIC causes ACPI to lock up at bootup so it must not be enabled
ACPI=Y
ACPI->AC Adapter=Y
ACPI->Battery=Y
ACPI->Button=Y
APM=N                                             #You cant have ACPI and APM at same time. ACPI technology replaced APM
SCSI=Y
SCSI disk=Y
SCSI generic=M
National Semiconductor DP8381x=M    #under network devices
wireless lan=N
dos fat=M
msdos=M
vfat=M
ISO9660=Y
Juliet ext=Y
ntfs=M (read only)
usb=Y
Prelimenary USB Filesystem=Y
usb-ohci=M
usb-storage=M



APCI
Why do I need it?
1. Fixes the laptop not powering-off problem when you do a shutdown -h now command
2. Fixes the irq conflict problem with pcmcia.
3. When you the hit power button the computer will immeadiately power off.  It does not go through the linux shutdown procedures. This corrupts the hard drive partitions since they are not cleanly unmounted. Acpi resolves this by allowing you to run acpid and capture the power button pressed event.

Use dselect to install acpid.

 A powerbtn event file (located in /proc/acpi/event) contains the lines
    event=button[ /]power
    action=/etc/acpi/powerbtn.sh
where the powerbtn.sh script simply calls
    shutdown -h now
to do an orderly shutdown whenever the power button is pressed.

You can also do some action on the lid button.

You may want to check into the software suspend project. It lets you make the computer hibernate instead of shutting totally down. I have read about but not done this yet.



PCMCIA
Get the pcmcia source and compile it.
# make config
trusting=N
cardbus=Y
PNP support=N
# make all
# make install

Note: You may be able to use the kernel version and avoid compiling it yourself but I needed it anyway to compile the wlan-ng driver for my wireless card.



Network Adapter

edit /etc/network/interfaces

iface eth0 inet static
  address 192.168.0.2
  netmask 255.255.255.0

# modprobe natsemi
# ifup eth0

Note: If you put "auto eth0" in the interfaces and let system do it at boot up it may look up due to IRQ conflict with pcmcia.
Note: I think this may work now since enabling acpi fixes the irq conflict with the pcmcia services.



Wireless Adapter
Forget about the Broadcom built-in wireless adapter.  There are no linux drivers for it at this time. Some previous pavillion models had a different wireless chip which did work with the wlan-ng prism2_pci module.  If you've got the one made by Broadcom you are out of luck.

But I have a pcmcia linksys dwl-650 wireless adapter I could use. You need the prism2_cs driver from linux-wlan-ng.
Download the linux-wlan-ng source. I used version 0.2.1-pre9.
You also need the pcmcia source that matches what you are running.
# make config
Prism2.x PCMCIA=Y
Prism2 PLX9052=N
Prism2.5 native PCI=N
Prism2.5 USB=N
debug=N
# make all
# make install

Then edit /etc/wlan/wlancfg-default with your settings (WEP key,SSID,etc)
Then edit /etc/wlan/wlan.conf  with your SSID name
Then edit /etc/pcmcia/network.opts with your IP address,mask,etc

Insert the DWL-650 card. You should hear 2 high beeps. If you did not turn off "wireless lan" in the kernel it won't initialize right!
# ifconfig
to see the wlan0 device with your IP



USB
# modprobe usb-ohci




USB Flash Drive
# modprobe usb-storage
# modprobe vfat

Insert the usb flash drive.

Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: USB new device connect on bus1/2, assigned device number 2
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: CREATIVE  Model: NOMAD_MUVO        Rev: 0001
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 126977 512-byte hdwr sectors (65 MB)
sda: Write Protect is off
 sda: sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2

# mount -t vfat /dev/sda1 /mnt

Don't forget to umount /mnt before removing it.

Note: Kernel 2.2.x looks like it has usb-storage but it doesn't really work due to changes in the scsi subsystem. You MUST have a 2.4.x or higher kernel.



USB Floppy Disk
# modprobe usb-storage
# modprobe vfat

Plug in the usb floppy drive.  Insert a floppy disk.

# mount -t  vfat /dev/sda /mnt

Don't forget to umount /mnt before removing the disk.



Sound
# modprobe trident



Firewire
I don't have any firewire devices so I can't test this



Modem
I didn't bother with the modem.  I don't need it for internet since I have DSL.



XFree86
Forget about messing with patches or direct video support.  Just use VESA.  This will get you going. Once you have Xf86Config-4 that works then you can try patches.  It works fine with a 1024x768 resolution.

A more current version 4.3.x of XFree with patches may support the ATI Radeon Mobility graphics chip.  I just did not want to mess with downloading and compiling XFree.  I would rather stick with the stable one in Woody for now.

See my /etc/X11/XFConfig-4 here.



Reading Windows NTFS files
# modprobe ntfs
# mount /dev/hda1 /mnt

This is read-only.  You can not copy files from linux onto the ntfs partition.


Remaining Problems
 
1. I get this mesage every once in a while

spurious 8259A interrupt: IRQ7.


2. Possible performance issue? Bus speed is 33MHz and DMA is may be disabled. lspci -vv reports 66Mhz bus speeds.

#dmesg
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ALI15X3: IDE controller on PCI bus 00 dev 80
PCI: No IRQ known for interrupt pin A of device 00:10.0. Please try using pci=biosirq.
ALI15X3: chipset revision 196
ALI15X3: not 100% native mode: will probe irqs later
ALI15X3: simplex device:  DMA disabled
ide0: ALI15X3 Bus-Master DMA disabled (BIOS)
ALI15X3: simplex device:  DMA disabled
ide1: ALI15X3 Bus-Master DMA disabled (BIOS)
hda: TOSHIBA MK4021GAS, ATA DISK drive
hdc: HL-DT-STCD-RW/DVD DRIVE GCC-4241N, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 78140160 sectors (40008 MB), CHS=4864/255/63
hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache
Uniform CD-ROM driver Revision: 3.12
Partition check:
 hda: hda1 hda2 < hda5 hda6 >
FDC 0 is a post-1991 82077


Note: You may be able to get around this by putting "idebus=66" in your boot parameters.


Date: 11/19/2003