| |||||||||||||||||||||
|
Recent updates and notes RealTek and Broadcom NIC adapters
|
Linux on the Compaq Presario R3120US
A list of the most recent additions can be found near the end of the page. Recent changes to the overall page are highlighted for easier identification. --> IntroductionI was looking for a reasonably low-cost laptop with a nice LCD display, fast processor, large hard drive, built-in Ethernet, and hardware supported by Linux. This is the fifth laptop I've owned, and while the state of things have improved for Linux on laptops, it's still not plug-and-play. I had read nothing about this computer on the Internet, but I decided to take a chance with it and blaze trails for others to follow.My first decision was to try booting Linux on the laptop before I bought it, just to avoid any large pitfalls. I burned a copy of the Knoppix 3.3 Live CD and trotted down to my local Circuit City which, according to their web page, had the R3120US in stock. In stock, yes; on display, no. The salesperson was very accommodating, except to the point where he's open a box to let me try the CD out; Circuit City has recently implemented a 15% restocking fee for opened computers. (He did search the storeroom for an opened box for me, though; I don't blame him for the store's policies). There was a Presario 3140US there, however, which he let me try out. It has an Athlon 64 processor instead of the Athlon XP-M, and a rewritable DVD drive, but other than that looked identical (so please interpret that as they are identical; I didn't check that closely). Anyway, Knoppix booted up and seemed to function perfectly; the only things it didn't do was utilize the 1280x800 video mode for X11. So, since it looked safe, I bought it. The system setup is pretty complete at this time. I have used Slackware 9.1 without problems from May 2004 to March 2005 and since March 2005 have used Gentoo. Setting up XFree86 4.3.0, the hardware NIC, USB, and sound were pretty standard. Getting 1280x800 mode working in X took a little more time; the WiFi setup required installing NdisWrapper and searching around for working drivers; CPU frequency control works fine; the PCMCIA works for 16-bit cards but only for CardBus cards if the setpci command is used or the kernel is patched; From here on the standard disclaimers apply. I make no guarantees that everything on these pages is correct. It works for me, but I'm taking no responsibility if it doesn't work for you. I'll be more than happy to answer questions via e-mail (no HTML text, please). --> Specifications
--> Similar Compaq/HP ModelsI'm guessing these laptops are pretty similar, based on the specs printed on the web.
--> Hardware detailsThe motherboard uses (I think) the AMD K8 chipset for the "north bridge" and the nVidia nForce3 chipset for the "south bridge". The CardBus/PCMCIA controller is a Texas Instruments PCI1620.A nice feature I want to mention is the built-in pointer device. It's a touchpad with two mouse buttons, and it emulates a PS/2 mouse. What's nice is there's a little button right above it which lets you turn it on and off. My last laptop had a Synoptics USB Touchpad which you couldn't disable like this, and I don't know how many times I was typing when I'd accidentally touch it and woom the mouse is in the middle of some other paragraph or woom it just deleted all my text. Grrrr. --> WinXP SP1I have only run XP on the laptop briefly, to compare how the PCMCIA and WiFi operated. The drive is a 60GB UDMA133 drive. After initially installing Slackware on a spare 10GB drive, I use the Knoppix 3.3 CD to boot, ran ntfsresize to shrink the NTFS partition to around 20GB, booted into WinXP to run chkdsk, then reloaded the basic Slackware configuration onto the remaining 40GB with my changes. I haven't tried setting up the WinXP partition for dual-boot; for now it's just there in case I ever need it again.--> Slackware 9.1Many Linux user cringe when someone mentions Slackware, but I've been using it since the mid-90's and know how they do things pretty well. I have a CD-R with Slackware 9.1 burned on it and went through with a full install. I've been using the ReiserFS. I don't recall it it autodetected the RealTek Ethernet adapter or not; I've been doing networking setup by hand so long that I may have ignored it.After getting the network adapter set up, I downloaded and installed SWareT and then used it to update with the latest Slackware 9.1 patches.
--> Linux kernelsSlackware 9.1 comes with the 2.4.22 kernel. You can use one of the standard kernels which comes with the distribution. If that's OK with you, can skip to the next section. It shouldn't be, though, unless you don't plan to run this on a network; there have been some security problems in these kernels which might leave you vulnerable.For those who already know how to config a kernel, here's the final 2.6.5 .config file for my current kernel. I found that IO-APIC support has to be turned off. I'm currently running 2.6.6, since I needed this for suspend-to-disk. I've installed versions 2.4.25 and 2.6.5 of the kernel (more on this later). You can find these at The Linux Kernel Archives. For the 2.4.x kernels, you can just download patches; you're not comfortable patching a kernel, you can also download a complete tar file for the latest kernel (from here out I'll assume you're doing a 2.6.x tarball). To install the new kernel, do this (assuming you put the tarball in /tmp:
You can download the kernel config file I used and replace the file /usr/src/linux-2.6.5/.config with it, or you can make your own kernel config by typing:
--> PCMCIA/CardBus supportThis has been the biggest headache so far. PCMCIA driver support has been included in the recent 2.4.x kernels and all 2.6.x kernels. The PCMCIA tools are included in a separate package (pcmcia-cs). The preferred method these days seems to be to use the kernel support. But this is actually neither here nor there, as I discovered. The R3120US has only one PCMCIA slot, located on the left rear side of the machine. It's controlled by a Texas Instruments PCI1620 controller. However, if you use the default set-up for the Linux PCMCIA system, nothing works. I've been able to get complete functionality for all my PCMCIA devices, and have "a hack" for the CardBus devices (keep reading).The CardBus controller is correctly identified by the yenta_socket driver of the PCMCIA controller (and also, under the 2.4.x kernels without built-in PCMCIA support, by the i82365 module). Depending on the version of your kernel and how up-to-date the PCI applications are (actually, the pci_ids.h file) it may not appear to be identified, but it is. However, after two days of Googling and reading mailing lists and forums, I determined the problem was in /etc/pcmcia/config.opts. This file specifies how the cardmgr application should map I/o memory, ports and interrupts for PCMCIA cards (which are, in essence, removable ISA bus cards). Since the CardBus chip lies not on the main PCI bus but on a bridge of the PCI bus, you have to tell cardmgr the I/O space of the bridge device. So, using lspci to examine the bus, the CardBus controllers are located on PCI bus 2, which routed thru a bridge with I/O ports from 0x3000-0x7fff and memory from 0xe8100000-0xe97fffff. You have to add these lines to your config.opts file:
An alternative for 2.6.x kernels is to apply the pci-subordinate-busnr-fix patch (although the patch is quite old, it still seems to apply for kernels up through 2.6.11). It changes the detection scheme for subordinate buses. --> RealTek and Broadcom NIC adaptersThe RealTek RTL-8139 is a 10/100MB adapter. The version 2.6.x kernel driver 8139too works beautifully with it. I've also written a Python script that uses a patched version of mii-tool to detect changes in the link's status and start/kill dhdpcd as needed: now the Ethernet port is "hot-pluggable". (The patch is necessary, on Slackware at least, since the version of mii-tool in the net-tools-1.60 package uses deprecated values for the SIOCGMIIPHY ioctl; you basically just need to add #include <linux/sockios.h> prior to including mii.h in mii-tool.c)The Broadcom BCM94306 802.11b/g WiFi controller also works. Broadcom doesn't support this device under Linux and doesn't provide developer info. I've used NdisWrapper to access my 11Mb WAP; I had a problem with the bcmwl5.sys driver I downloaded from HP/Compaq, but found this one from Dell does work. Once I loaded it with ndiswrapper, the interface worked. The size of the new driver is 286,848 bytes. There is an LED which lights under WinXP when the device is activated, and a Wireless On/Off button on the laptop itself. After writing a few scripts to handle the wireless set-up, I have settled on a modified version of ndiswrapper and a root-level script which starts/stops then interface when the on/off button is pressed. If you're interested, grab a copy of the scripts and patches and try them yourself. They're not perfect but seem to do the job. With the latest NDIS drivers, the LED flickers when a connection is active. Linuxant also claims to support some of the Broadcom adapters; I've downloaded a 30-day evaluation version of their driver but haven't tested it with the new bcmwl5.sys. --> Sound and ALSAI used ALSA on my last laptop, and since it's now included in both the Slackware 9.1 distro and the version 2.6.x kernels I installed it here. You need to use the Intel 8x0 driver driver, and need to put the following to your /etc/asound.conf file:
--> nVidia nForce3 winmodemThis is a winmodem, and the nVidia nForce page claims no winmodem support. However, Leandro Figueira managed to get the modem working (and others have also reported success) using a patched version of a SmartLink modem. I don't have a dial-up connection so I haven't tried this myself.--> ACPI setting and cpufreqACPI works about as well here as it did on my last laptop, which is to say the battery and temperature work, but suspend to RAM doesn't (I haven't tried suspend to disk). Doing "cat /proc/acpi/sleep" reports that the BIOS has S3 and S4, but doing "echo 3 >/proc/acpi/sleep" puts the laptop into a sleep mode which it doesn't wake from correctly. I've installed the latest patches for suspend-to-disk and they work pretty well.I spoke too soon about the battery; if you use any software like GKrellM to monitor the remaining battery time, the BIOS doesn't correctly report the rate of charge/discharge. If this info is available, it's somewhere in the embedded controller. Anyone have a clue which controller the R3000z series uses? The laptop also has two cooling fans on the bottom. I've never seen more than one running; the highest temp I think I've seen so far is about 105F. Anyway, the ACPI interface doesn't detect them. I disassembled the DSDT and there is reference to the fans there (in relation to the embedded controller) but I'm not very motivated to learn ACPI programming to go farther.
Getting processor speed support is possible, but at this time not
out-of-the-box. The 3000+ XP-M is based on the AMD64/Opteron core, but is
actually a 32-bit CPU. The kernel CPUFreq processor driver needed for it
is therefore powernow-k8. But after consulting users on the
ACPI-devel and cpufreq mailing lists, there appears to be a "bug"
(or at least a disagreement in interpreting the specifications) in the
ACPI tables. One high-frequency and two (identical) low-frequency processor
states are listed, and according to AMD there can only be one low-speed
state. A patch has been submitted for the 2.6.7 kernel and someone
at HP/Compaq is checking with their BIOS group on a fix.
When a little more is known about what's happening here, I'll post
more details.
--> XFree86 4.3.0/Xorg 6.8Slackware comes with XFree84 4.3.0. XFree86 4.4 is out now, but due to changes in their license a lot of Linux distros aren't including it. In my case it doesn't matter, since the stock vesa and nv drivers will work OK.The only two things I've added to the stock /etc/X11/XF86Config file is use of /dev/input/mice (so that the PS/2 touchpad and my external USB mouse both work) and the following Monitor section:
nVidia also has binary drivers you can download and install from their website. I did this at one point, and the above Modeline also works with that driver. Running glxgears at 24bpp gave about 1200 fps; not blistering but not slow either. And since I don't plan to play games on this machine, I don't really care. I've been using gdm for my start screen; I had a nice Slackware GDM theme but I lost it.... if you Google around you can find some nice ones. I've also installed bootsplash with one of the Slackware bootsplash themes (a decent article on how to get bootsplash running on Slackware 9.1 can be found here; you'll probably need to get different patches for your kernel. There doesn't seem to be a single coherent set of updated patches for each kernel; again, Google is your friend. For the 2.6 kernel, you will need to install the patch and then enable the following kernel options:
--> Easy Access KeysIf you're running GNOME, you can use acme to activate many of the special function keys (the FN-F? keys) and the volume control buttons. The upside is it's pretty easy to configure; the downsides are (1) it's apparently not in GNOME 6.2, instead being merged into the Keyboard Shortcuts control panel, and (2) it doesn't let you associate your own actions with the keys. This isn't a big deal for the volume keys (they work nicely), but for things like the Sleep key it is (acme hard codes this to execute either apm or xset dpms force off). Since I'm using ACPI this doesn't do much. My solution was to add my own apm program, which is simply a script which runs the hibernate script for suspend-to-disk. It's a kludge, but it works.If you want to be able to program your own actions, there is a package called LinEAK which adds support for Internet keyboards and other cute buttons. It mentions running xev to catch events from special keys. Just to see what it did, I installed it and its default plug-ins, then added keycode definitions for the various hotkeys. The default plug-ins have three macros (EAK_MUTE, EAK_VOLDOWN and EAK_VOLUP) which control /dev/sound/mixer. Like acme, LinEAK uses X11 events so it will only work when you're running X11 (i.e., you can't start the daemon until the X11 server is already running). --> Athlon-64 machinesI've been talking with other users who are installing Linux on the R3000z/zv5000z machines. They've asked me to pass along the following experiences:May 29, 2004:
June 2, 2004:
--> Other SoftwareThese are links to various software that I've installed which doesn't come as part of Slackware 9.1 (or, at least not that I'm aware of). Many are mentioned somewhere else on this page.
--> Recent updates and notesMarch 28, 2005: It's been 8 months since I made any major updates to this page, but the laptop has been running very stabily. In the last week I've started switching to Gentoo Linux since some of the apps I wanted to use with Slackware were just too painful to compile/install/integrate. I am happy to report that the switch has been fairly painless (I had already built an Athlon-XP install on another machine, and just copied the file system intact from it to the Presario).I added some general updates, which give links to the kernel patch for the CardBus and drivers for the modem. Seems that people still look at this page, so thought I should at least try to keep it up-to-date. July 28, 2004: I haven't updated this page in over a month, pretty much because there have been no big changes to things. It does look like the CardBus problem will be fixed in the next kernel releases (2.6.8, and I assume in 2.4.27) by a PCI patch. On the downside, I've had stability problems with ndiswrapper 0.8 and my WiFi scripts (causing BIG kernel oops) and with swsusp, and I haven't pursued them since I actually wanted to stop working on and start working with the laptop. So somewhere after my 2-month anniversary with it, I'm pretty happy with how it performs. June 25, 2004: With cautious optimism, I want to report a fix for the CardBus problem. Someone on the kernel PCMCIA list discovered a problem in the PCI bus configuration/initialization which doesn't allow the CardBus to be detected by the PCI system. The fix -- for now -- is given above, but use at your own risk. June 23, 2004: Quite a few users Linux R3000z users have contacted me since the page went up last month, and we've been keeping each other informed of our progress via e-mail. One of them decided to set up a mailing list and archive (Thanks, Greg!) so not only can everyone contribute, everyone can also keep up-to-date (or browse archive if they missed something). Find the LinuxR3000 mailing list link below. A related note: seems the Linux kernel maintainers don't believe that there's a bug with the PCI1620 support. Looks like it might be up to us owners to find the problem. June 18, 2004: A frequently asked question is "have you been able to get the Alps touchpad to work?" I'm honestly not sure if my R3120 has an Alps touchpad. The AMD64 users certainly seem to have it. So to make life easier, I'm including someone else's steps under a new section to try to address this. June 16, 2004: Someone who was having problems with an Orinoco WiFi PCMCIA card reported that a bug was fixed and the card now works under the 64-bit Linux kernel. June 15, 2004: Still no progress on the CardBus front, and discovered that the BIOS doesn't correctly report the rate of battery charge/discharge (actually, not true: if the battery is fully charged or discharged, then 0 would be correct). June 4, 2004: Looks like the cpufreq issue will be fixed soon. Today I spent looking in what's happening with the CardBus. It still doesn't work, but at least I've verified that cards are being detected. June 3, 2004: I've spend more time pursuing the cpufreq issue; it should be easy to fix this soon. June 2, 2004: I've uploaded the second set of Python WiFi scripts for anyone who's interested. These scripts let you turn the WiFi on and off using the button on the laptop's front. You will need to patch ndiswrapper for this; I added an entry to /proc/net/ndiswrapper which tracks the number of interrupts generated by the card; when it's turned off it sends no interrupts. The downside of this patch is I get a kernel oops if I try unloading the ndiswrapper driver while the script is running. This is a nasty thing to do, but I was trying to be thorough and handle pathological cases like this. I can't verify whether the bug is really in the kernel or in my patches, but unfortunately I can't spend any more time searching for the problem. If you find this set of scripts useful, maybe you can track the problem down and either send me a fix or the kernel developers a bug report. On a related note, I started looking into the cpufreq kernel modules. Even though the CPU is a 32-bit Athlon and not the 64-bit Athlon 64, it is based on the K8 core. Hence, when setting up the cpufreq modules in the kernel you need to use powernow-k8. So far, however, I haven't had any success with getting these modules to work. I've check on both the ACPI and cpufreq mailing lists and as of yet haven't been able to determine where the problem lies. The powernow-k8 module gives this error:
and the acpi module this error:
Looking at the DSDT I can't see anything similar to what the ACPI mailing list describes for the CPU. Also got another update today about the Athlon-64 systems. May 29, 2004: I've uploaded the Python WiFi scripts for anyone who's interested. I also tried yesterday to get suspend-to-disk working using the bleeding edge swsusp patches for the 2.6.6 kernel and met with some success. Not for the faint-of-heart. You have to download the test patches (as of this writing, it is software-suspend-2.0.0.81-for-2.6.6.tar.bz2), untar the list of patches, then do something like:
From there, follow their how-to to make the kernel and set up lilo or grub. The hibernate script is not friendly to Slackware, but if you set SWSUSP_DOWNIFS="" and handle the network interfaces yourself (or edit StopInterfaces() and RestartInterfaces() in /usr/local/sbin/hibernate to just use Slackware's /etc/rc.d/rc.inet1 script with "start" and "stop" as options) things work. For now, I also have it forcibly remove and reload the ndiswrapper module. The only thing which doesn't work right with suspend-to-disk is nVidia's X11 driver. I switched back to the XFree86 nv driver and X resumes correcly from suspend. Seems that latest versions of nVidia's driver doesn't play well with suspend at all, and the last "stable" one which did (version 1.0-4496) doesn't compile with the 2.6 kernels. However, according to this thread on the swsusp-devel mailing list, looks like work is proceeding on adding support. A Linux user who has a Presario R3140 sent me an e-mail with his experiences, and asked me to pass them along for others. May 28, 2004: I found out why ndiswrapper always reports a near-100% link quality: according to their FAQ, there is no general method for determining the link quality or noise level in Windows drivers. It something that is device-specific. Oh well. May 25, 2004: Tried seeing what ndiswrapper thought about the Wireless On/Off button... I modified the kernel driver to print a message whenever an interrupt was received. What I found is that the button itself doesn't cause an interrupt, but when the switch is "off", absolutely no interrupts get through. So maybe it is literally a hardware switch. May 24, 2004: The site is now listed under Google; hopefully those of you who found it this way find it useful. May 23, 2004: I discovered that LinEAK isn't happy about running when X11 isn't up (go figure), and since it needed to run as root for my WiFi script, that was a problem. So since I had to run it in user-mode, I added it to the startup programs ("Applications -> Desktop Preferences -> Advanced -> Sessions") and reassigned the WWW key to run a Python user-mode script. This script uses sockets to talk to the original Python WiFi script, which runs as a server with root permissions. All the client does is send a message to the server, which then "toggles" the state of the WiFi (i.e., brings the interface up or down). I also discovered about the same time that GNOME 2.4 has a built-in applet called "acme" which lets you activate your hotkeys. Its one problem is that there's no simple way to associate your own actions with keys. It does work nicely with the volume controls, so I removed those from the LinEAK configuration and set acme to also start when GNOME starts. I preferred having something on the GNOME desktop which I could click on to start/stop the WiFi, and also something which would show the current status (I realize this is redundant, since gkrellm shows the status of configured interfaces, but what the heck.) Since I also like Python, I found this page very helpful in explaining how to write a GNOME applet in Python. I threw a first pass together for one which shows "WiFi On" or "WiFi Off" and changes the status (using the root-level Python server script). I realized I hadn't mentioned anything on this page about ACPI, so I added something to at least rectify that.
--> Credits and linksIt's hasn't been a painless experience to set up my laptop, but it's been made easier thanks to the folks who contributed their knowledge and experiences to the Web community:
|