Dual-booting Linux and Windows on a Compaq Evo N1015v laptop

Published: February 25th, 2004
Time to read: 8 min

Introduction

Hardware: Compaq Evo N1015v with 15" TFT, 256MB RAM, 40GB hard drive (in "hard drive manufacturers' bytes", in "real" bytes about 37GB) and a Teac combo CD-RW/DVD-ROM.

Objective: To produce a dual-boot system using Windows XP Professional and Debian GNU/Linux.

Background

The laptop comes pre-installed with Windows XP Professional, on a NTFS partition, that it occupies the entire hard drive. This is clearly not desirable for a dual-boot system. Additionally, Linux can only read NTFS without problems, and enabling write support is not recommended at the time of writing; thus FAT32 would make a more sensible choice, as Linux safely can both read and write to FAT32 partitions.

I asked my retailer if I could get the laptop without the pre-installed Windows, but I couldn't. Seems like I was forced to buy the bundled Windows, even though I didn't really want it. Unfortunately, this seems to be the case world-wide. In any case, I decided to re-install the bundled Windows XP on a small FAT32 partition. so that I could boot into Windows in case I needed to do some testing, and so that I could read and write to the FAT32 partition from Linux.

Finding out what hardware the laptop contains

Once you get Linux installed and running, it's trivial to use the 'lspci' utility to find our what hardware the laptop contains, so that you'd know what to compile into your custom kernel. The compilation of a custom kernel is pretty much inevitable if you wish to take full advantage of the Linux system.

On my laptop, the output of 'lspci' is as following:

00:00.0 Host bridge: ATI Technologies Inc: Unknown device cab0 (rev 13)
00:01.0 PCI bridge: ATI Technologies Inc U1/A3 AGP Bridge [IGP 320M] (rev 01)
00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03)
00:07.0 ISA bridge: ALi Corporation M1533 PCI to ISA Bridge [Aladdin IV]
00:08.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-Link Controller Audio Device (rev 02)
00:0a.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 02)
00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 20)
00:0c.0 Communication controller: Conexant HSF 56k HSFi Modem (rev 01)
00:0f.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03)
00:10.0 IDE interface: ALi Corporation M5229 IDE (rev c4)
00:11.0 Bridge: ALi Corporation M7101 PMU
01:05.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility U1

Re-installing Windows XP

When the laptop comes out of the factory, Windows XP is installed so. In the following steps, I will remove Windows, re-partition and re-install Windows on a smaller partition. These steps could probably have been avoided by using some sort of partitioning software, like Partition Magic.

First, I booted using an old Windows 98 SE boot disk I had lying around. I have copied a small DOS program called 'hardcure' to the floppy. Hardcure is an utility that wipes the 0-track of the hard drive, thus effectively removing the partition table.

Next, I used DOS' fdisk utility (also found on my boot floppy) to create a new 5GB FAT32 partition for Windows.

After that, I put in the Windows XP OEM CD that came with my laptop, rebooted and re-installed Windows on the newly created 5GB FAT32 partition.

After Windows finished it's installation, I put in my Debian GNU/Linux 3.0r1 CD and started the Linux installation. I noticed, that the "bf24" kernel flavor won't boot. It halts with "Kernel panic". However, the standard 2.2.x kernel boots fine.

Using a 2.4.x kernel

Booting the Debian installation using 2.4.x

After some more hacking, I discovered, that if you run "bf24 nomce", the 2.4 kernel will boot, but once you get to the "Choose The Language" menu, the menu has not fully loaded, and the keyboard will not respond. Your only option is to power off and then power back on. I finally managed to get the Debian with the 2.4 kernel installation on it's way, by booting using the "bf24 nomce noapic pci=off" boot options. Using "pci=biosirq" seems to work also. I really wanted to boot using the 2.4.x kernel, as it gives you the possibility to use the ext3 file system.

IRQ woes

When I had Linux running, I sometimes got a cryptic "spurious 8259A interrupt: IRQ7" [1] message in the console, usually at boot time. The error is apparently harmless, but annoying. I solved the issue by disabling APIC completely in my kernel configuration. Eventually, I ended up compiling 2.4.22, as it has a bunch of APIC fixes compared to 2.4.20, and does not produce this error, even when APIC is compiled in the kernel. Feel free to download my 2.4.22 .config file.

Mouse madness

Getting the touchpad to work in XFree is a bit tricky. The approach I chose was, to install and run GPM. Feel free to download my XF86Config-4 configuration file. This configuration file allows the use of the Synaptics touchpad and a USB mouse at the same time. I prefer a USB mouse to the touchpad, which is why I always have a USB mouse plugged in when using the laptop at home. However, I seldom carry a USB mouse with me while on the road, hence the configuration.

While you could also use the Synaptics touchpad driver for a 2.4.x kernel, it is not wise, if you wish to use GPM for mouse control in the virtual consoles (the Synaptics driver and GPM will conflict in X). I did, and that's why I chose this method.

DMA for the hard drive

You need to set the transfer mode for the primary master to a DMA mode in the laptop's BIOS in order for this to work. Also, you'll need to set the following kernel options:

CONFIG_BLK_DEV_ALI15X3=y
CONFIG_BLK_DEV_IDEDMA=y

Without the proper chipset (what lspci reports as '00:07.0 ISA bridge: ALi Corporation M1533 PCI to ISA Bridge [Aladdin IV]') driver (ALI15X3), hdparm will simply spit out a 'HDIO_SET_DMA: Operation not permitted' error message if you try to do a 'hdparm -d 1 /dev/hda'. I also prefer to have the following option, so that DMA is automatically turned on at boot time:

CONFIG_IDEDMA_PCI_AUTO=y

Now I can simply use 'hdparm -c 1 -k 1 /dev/hda' in my startup scripts.

Network

The correct module is '8139cp'.

Sound

The soundcard and internal speakers work flawlessly under OSS. The correct OSS sound module is called 'trident'.

Using a 2.6.x kernel

Now that the 2.6 kernel series has been marked as stable, I tried to compile it. First, I downloaded the kernel sources from from http://www.kernel.org/ and extracted them to /usr/src. I also needed to do a 'apt-get install module-init-tools', as otherwise the new kernel's modules will not load.

Using CPUFreq and sysfs

There is one particularly interesting feature in this new kernel, namely 'cpufreq', which can be used to lower the CPU's frequency, thus saving battery power. You will need to activate the following kernel options for cpufreq:

CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=Y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_X86_POWERNOW_K7=y

These options can be found under 'Power management options (ACPI, APM) -> CPU Frequency scaling' in the kernel configuration. You will also need to enable the new sys-type filesystem if you wish to use cpufreq. This is trivial; first, mkdir /sys. Then, edit your /etc/fstab and add a line such as this:

none	/sys	sysfs	defaults	0	0

After that, issue a 'mount -a' in order to mount the new file system. Finally, 'apt-get install cpufreqd'. The daemon will automatically throttle the CPU frequency as needed. You can do a 'grep MHz /proc/cpuinfo' to see at what frequency the processor is currently running on.

Mouse madness

In order to get the Synaptics touchpad working under 2.6.x, you need to enable the following kernel options:

CONFIG_INPUT_EVDEV=y
CONFIG_MOUSE_PS2=y

These settings are found under 'Device Drivers -> Input device support' in the kernel configuration. Modules are just fine too, just remember to load them before starting the X server (they're called 'evdev' and 'psmouse'). After you've compiled the kernel, download and compile the Synaptics touchpad driver for XFree86 from http://w1.894.telia.com/~u89404340/touchpad/. You will also need to 'apt-get install xlibs-dev' in order for the compilation to succeed. Copy the generated synaptics_drv.o to /usr/X11R6/lib/modules/input/. Now you'll have to edit /etc/X11/XF86Config-4 to reflect the changes.

Feel free to take a look at my XF86Config-4. This configuration file allows the use of the Synaptics touchpad and a USB mouse at the same time. I prefer a USB mouse to the touchpad, which is why I always have a USB mouse plugged in when using the laptop at home. However, I seldom carry a USB mouse with me while on the road, hence the configuration.

You can still run GPM if you wish to use the touchpad or a USB mouse in the console, there is no conflict when running a 2.6.x kernel.

DMA for the hard drive

This is done exactly the same way as for a 2.4-series kernel. Please see the previous section.

Network

The correct module is '8139cp'.

Sound

I decided to upgrade from OSS to ALSA, as OSS is deprecated nowadays. The ALI M5451 sound chip has it's own ALSA driver (CONFIG_SND_ALI5451); it can be found under 'Device Drivers -> Sound -> Advanced Linux Sound Architecture -> PCI devices' in the kernel configuration. I also did a 'apt-get install alsa-utils', so that I could easily adjust the volume from the console using 'alsamixer'. Note that the master and PCM channels are muted by default!

ACPI

Note: this is not to be confused with APIC, which we discussed in the previous section regarding Debian's 2.4.x installation kernel. ACPI is related to power management. There is a good how-to on what ACPI actually is, how to get it working (with focus on Debian!), over at The Linux Documentation Project's website.

In order to use ACPI with a 2.6.x kernel, you need to enable the following kernel options:

CONFIG_PM=y
CONFIG_ACPI=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y

These options can be found under 'Power management options (ACPI, APM)' in the kernel configuration. Next, do a 'apt-get install acpid acpi' in order to get the proper daemon and client softwares.

CD-RW/DVD-ROM drive

You can burn CDs without SCSI emulation under a 2.6.x kernel! I've used k3b for all my burning needs without any problems. However, I needed to apt-get cdrdao from unstable.

References/Links


About the author
I'm a millennial digital nomad and a seasoned IT professional with over 20 years of cross-industry experience, ready to supercharge your business. Drop me a note or read more about what I can do for you!

This blog contains affiliate links to third parties. By using this site you agree to the Terms.