# Gentoo on Acer Ferrari 4005

## Michele Spinolo

Hi guys,

I just ordered an Acer Ferrari 4005 laptop, which I would like to fill with a Gentoo (2005.1 stage 1) distro.

I never installed Gentoo, but reading installation manual it seems not impossible to do even for a newbye.

Anyway I was wondering if is someone using Gentoo on this laptop, and has some tips to share for installation and HW settings (video card, soundcard, wi-fi, bluetooth, acpi, screen, etc...)

Thank you very much to everyone in advance! :Wink: 

----------

## sreekar

(EDIT: the following notes are now rather dated, especially regarding the more recent versions of the kernel and the ati-drivers.  Although the information below may still be useful, I recommend instead the excellent and comprehensive entry on the gentoo wiki at http://gentoo-wiki.com/HARDWARE_Gentoo_Acer_Ferrari_4005WLMi_Manual  There is also the site http://www.omgwtfbbq.com.au/ferrari/ which has info for this laptop across many Linux distributions.  I am still sitting on the versions of the kernel and ati-drivers listed below, since they work perfectly for me.)

These are some notes I wrote up on installing Gentoo on the Acer Ferrari 4000 (to be precise it's the 4005WLMi, model LX.FR406.035---the same one that's on Newegg and ZipZoomFly). Hopefully others will find them of use.  This is my first Linux install since 1993 when I put Slackware 1.0 on a 486.  Most of the time from then till now was spent with Solaris running on Other People's Computers, but I always knew I'd go back to Linux when I got a machine of my own.  The time finally came and I decided to go with imho the best notebook out there.

I used the 2005.0 amd64 CD to do the install---I tried the 2005.1 CD but had some problems with it.  See here. It hardly matters, of course; one just downloads the 2005.1 stage tarballs by means of the 2005.0 CD. 

At the time of purchase, there was an annoying issue: ATI's proprietary drivers only worked with kernel 2.6.11 but one needed a special option with kernel 2.6.12 to prevent the Ferrari's clock from going double fast (i.e. counts 20 seconds for every 10 seconds of real time).  Fortunately, this issue dissolved.

Before even trying to install Gentoo, I updated the BIOS from windows. See posts 80 and 85 here. I did this in the hopes that it would solve a lot of ACPI problems that other Linux users reported, without having to use a new dsdt.dsl. See below for the results of this approach.

(EDIT: the links in the above forum are broken.  Instead you can get the BIOS update directly from Acer's support website.  Flashing the BIOS seems to have made little difference in the end, so it may not be worth the effort.)

I pretty much followed the Gentoo AMD64 Handbook.

'emerge gentoo-sources' pulled in 2.6.12-r9.  I used genkernel (and afterwards coldplug), but some options still had to be set by hand, and I want to emphasize some points, even if genkernel takes care of it.  After the kernel compile stage I'll say what further steps had to be taken to get the devices in question working.

Compiling the Kernel

```
genkernel --menuconfig all
```

 brings up the "GUI"

(i) ACPI

Followed here the Power Management Guide; I did enable sleep state.

(ii) DMA

Should have been automatically enabled by genkernel. To double check, lspci shows that we need

```
Device Drivers --> ATA/ATAPI/MFM/RLL Support --> <M> ATI IXP chipset IDE support
```

(iii) Graphics

Followed here the Gentoo ATI FAQ and the Wedge Unofficial ATI Radeon FAQ. Make sure that 

```
Device Drivers --> Character Devices --> < > Direct rendering manager
```

is disabled in the kernel (it will be taken care of by the ATI driver) and that we have 

```
Bus Options --> [*] PCI Express Support.
```

 Ignore everything in the above FAQ's about AGP; it is impossible to enable AGP with this kernel if PCI-e is enabled.

(iv) Processor

I made sure to choose AMD Opteron/Athlon64 instead of the generic x86_64, since, after all, that's what the Turion is.

(v) Bluetooth

I just put in the kernel what the Gentoo Bluetooth Guide said to.

(vi) Sound

Followed the ALSA guide.  lspci shows: Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller (rev 02) and chose 

```
Device Drivers --> Sound --> ALSA --> PCI devices --> <M> ATI IXP AC97 Controller
```

(vii) Touchpad

```
Device Drivers --> Input Device Support --> <M> Mouse Interface

Device Drivers --> Input Device Support --> [*] Mouse

                                            --> <M> PS/2 Mouse
```

(viii) Wired Networking

```
Device Drivers

  --> Networking Support

    -->  <M> Universal TUN/TAP device driver support

       Ethernet (1000 Mbit)

         --->  <M> Broadcom Tigon3 support
```

Pass the option no_timer_check to your kernel in /boot/grub/grub.conf. Then your clock should run normally.  Afterwards I set up ntp so I can brag to people about how accurate the clock on my computer is  :Smile: .

Post Kernel Compile

0. USE flags

In addition to whatever USE flags one would ordinarily enable, I put in opengl (in light of 4.36 of the unofficial radeon faq).  I did neglect to put in 3dnow and mmx which are two optimizations that the Turion supports.  For example, xorg-x11 is aware of 3dnow and the gimp is aware of mmx.  I'll have to try that out at some point. See this nice article on Newsforge.

1. ACPI

I followed the rest of the Power Management Guide. Even with the Acer BIOS update, it turned out that the battery state was unreadable, as well as the status of the fan.  However, ac status and cpu temperature worked fine.  To make the battery state usable, you could use a new dsdt.dsl. References:

http://pages.cpsc.ucalgary.ca/~weckerl/ferrari_ubuntu_64.html

http://www.triplenet.dk/~xerne/linux/Ferrari.htm

post 102 on http://www.notebookforums.com/showthread.php?t=91771&page=7&pp=15&highlight=ferrari+linux

(EDIT: there is also a precompiled DSDT.aml in the repository of http://acpi.sourceforge.net)

Also, it is possible to suspend to ram, but not possible to come back from that suspended state...I had to power off and then reboot.  One gets the impression from the Power Management Guide that this has as much to do with the state of development of that part of the Linux kernel as with anything else; who knows, maybe 'emerge gentoo-sources' after a few months and it will work fine!

(EDIT: there may be a way to get suspend to ram working.  See here and here.  I haven't yet been able to get it working, unfortunately.)

2. DMA

To double check that it is on do 

```
hdparm /dev/hda
```

3. Graphics

```
emerge ati-drivers  (note this has to be done *after* each kernel compile)
```

pulls in the stable ATI drivers.  To be precise these are 8.14.13-r2.  I breathed a sigh of relief when these were marked stable---which (I assumed) meant that they worked with the latest stable gentoo sources, which were 2.6.12; I didn't want to go down to ati-driver hell like so many others before me.

Now you can use fglrxconfig to get an xorg.conf file.  Note that you have to choose Laptop Monitor as first display and CRT as second display due to the TV-out on the Ferrari 4000.  You'll have to tweak the resulting file a bit.  Alternatively you could just use the xorg.conf on this site, which is what I did.  It works perfectly for me.

The first time I ran X, I noticed that direct rendering was disabled. Looking again at the Unofficial ATI FAQ, I dropped out of X, ran 

```
opengl-update xorg-x11

opengl-update ati
```

 and direct rendering has worked since then.

4. ok.

5. Bluetooth

Partially followed the rest of the Bluetooth Guide: I left /etc/bluetooth/pin empty.  hcitool scan and hcitool inq didn't detect

the remote address, however hcitool dev did give the local address.  I put the latter address in /etc/bluetooth/rfcomm.conf.  Next, I put 

```
HIDD_ENABLE=true
```

 in /etc/conf.d/bluetooth.

It should work fine after that (in particular, you don't have to put anything in your xorg.conf for Linux to recognize the bluetooth mouse).  Perhaps it's better to use the Gnome or KDE bluetooth tools to find out the remote address. What I did was just guesswork, which happened to work.

6. Sound.

Followed the rest of the ALSA guide.  Remember to run alsamixer to unmute the speakers!

7. Touchpad

```
emerge synaptics
```

 Then the touchpad should work fine, provided xorg.conf is correctly set up.  Even the four way scroll buttons work perfectly.

8. Wired networking should work with the tg3 driver.

```
# /etc/modules.autoload.d/kernel-2.6, assuming you use coldplug

# these seven are for acpi

video     # not tried

processor # not tried

thermal   # works

fan       # doesn't work

button    # not tried

battery   # doesn't work

ac        # works

mousedev  # these two are for the touchpad

psmouse

fglrx     # the dreaded ATI driver
```

I didn't try the wireless or the fixed dsdt.dsl files since the only places this notebook goes, home and the office, have wired networking and electricity emerging from the walls (sorry, bad pun).  Setting up the wireless is pretty well explained here.

Special thanks to all the experts out there who got it working with other distros and took the time to write up their findings, as well as to all the people whose hard work got the ATI drivers working with the 2.6.12 kernel.  I know ATI released new drivers, but it looks like it'll be a while before they're ready for a general audience (includes me).

(EDIT: I finally got a chance to try the wireless.  After emerging ndiswrapper and installing the 64bit windoze driver, play with the wifi button on front of the Ferrari: if 

```
dmesg | tail
```

 shows e055 then wifi is on, and if it shows e056, wifi is off.  Then I just did 

```
modprobe ndiswrapper

dhcpcd -HYDRN wlan0
```

 and it worked.  The options on dhcpcd are just to make it as agnostic as possible.  I didn't have a chance to try wpa_supplicant yet.  I also managed to get the battery state readable by using a new DSDT:  I went to http://gaugusch.at downloaded the patch and followed the instructions.  It worked on the first try, but dmesg has been giving some interesting output since I started using the custom DSDT

```
ACPI: Looking for DSDT in initrd... found (at offset 0x00).

...

Uhhuh. NMI received for unknown reason 21.

Dazed and confused, but trying to continue

Do you have a strange power saving mode enabled?

 works.
```

  It hasn't given any trouble though, apart from having a dazed and confused kernel   :Shocked: .)

(EDIT: In case anyone is looking for a nice LiveCD which works with this laptop, I have recently tried Kanotix 2005-03 for amd64.  It worked amazingly well.  The other LiveCDs I tried got confused by the TV-out and gave me a black screen, but Kanotix loaded the vesa drivers and gave me a nice KDE desktop without any trouble.  It even comes with an ndiswrapper configurator which can be accessed from the KDE menu.  Great work, Kano!)

----------

## MrDarthMaul

I just installed Gentoo on my Ferrari 4005 laptop. I installed 2005.1-r1 and used genkernel 2.6.15-gentoo-r1. I followed all the directions. There were some differences:

1. I had to load agpgart kernel module to get direct rendering to work.

2. After I did that, the machine started to freeze when I attempted to exit an X11 session.

I looked in /var/log/messages and this is what I found right after I startx:

```

Jan 30 13:00:39 ferrari allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.

Jan 30 13:00:39 ferrari Bad page state at free_hot_cold_page (in process 'X', page c17ac07c)

Jan 30 13:00:39 ferrari flags:0x80000414 mapping:00000000 mapcount:0 count:0

Jan 30 13:00:39 ferrari Backtrace:

Jan 30 13:00:39 ferrari [<c0134128>]

Jan 30 13:00:39 ferrari [<c0134824>]

Jan 30 13:00:39 ferrari [<c013d2df>]

Jan 30 13:00:39 ferrari [<c013d43d>]

Jan 30 13:00:39 ferrari [<c013d559>]

Jan 30 13:00:39 ferrari [<c0140c1b>]

Jan 30 13:00:39 ferrari [<c0140eb8>]

Jan 30 13:00:39 ferrari [<c0140f00>]

Jan 30 13:00:39 ferrari [<c0102945>]

Jan 30 13:00:39 ferrari Trying to fix it up, but a reboot is needed

Jan 30 13:00:39 ferrari [fglrx] free  PCIe = 51118080

Jan 30 13:00:39 ferrari [fglrx] max   PCIe = 51118080

Jan 30 13:00:39 ferrari [fglrx] free  LFB = 110153728

Jan 30 13:00:39 ferrari [fglrx] max   LFB = 110153728

Jan 30 13:00:39 ferrari [fglrx] free  Inv = 0

Jan 30 13:00:39 ferrari [fglrx] max   Inv = 0

Jan 30 13:00:39 ferrari [fglrx] total Inv = 0

Jan 30 13:00:39 ferrari [fglrx] total TIM = 0

Jan 30 13:00:39 ferrari [fglrx] total FB  = 0

Jan 30 13:00:39 ferrari [fglrx] total PCIe = 16384

```

And this is what is printed when I try to exit the X11 session:

```

------------[ cut here ]------------

kernel BUG at <bad filename>:33776!

invalid operand: 0000 [#1]

PREEMPT SMP

Modules linked in: snd_pcm_oss snd_mixer_oss ipv6 pcmcia parport_pc parport pcspkr rtc tg3 snd_atiixp snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd snd_page_alloc fglrx agpgart firmware_class yenta_socket rsrc_nonstatic pcmcia_core dm_mirror dm_mod ata_piix ahci sata_qstor sata_vsc sata_uli sata_sis sata_sx4 sata_nv sata_via sata_svw sata_sil sata_promise libata sbp2 ohci1394 ieee1394 sl811_hcd ohci_hcd uhci_hcd usb_storage usbhid ehci_hcd usbcore

CPU:    0

EIP:    0060:[<c01393f6>]    Tainted: P    B VLI

EFLAGS: 00213256   (2.6.15-gentoo-r1)

eax: 00000000   ebx: c177da8c   ecx: c177da8c   edx: c177da8c

esi: c177da8c   edi: f79733c4   ebp: b7cf1000   esp: f4500e94

ds: 007b   es: 007b   ss: 0068

Process X (pid: 11143, threadinfo=f4500000 task=f799d0b0)

Stack: c013d2df c177da8c c17d1438 00000000 ffffffff f40aaac0 b7cf2000 f40a6b7c

       00000000 f40a6b7c c013d43d c1905880 f44e3b74 f40a6b7c b7cf1000 b7cf2000

       f4500f1c 00000000 b7cf2000 f40a6b7c 00000001 f40aaac0 f44e3b74 b7cf1000

Call Trace:

 [<c013d2df>]

 [<c013d43d>]

 [<c013d559>]

 [<c0140c1b>]

 [<c0140eb8>]

 [<c0140f00>]

 [<c0102945>]

Code: 41 04 40 75 02 0f 0b f0 83 42 04 ff 0f 98 c0 84 c0 74 2d 52 ff 52 38 58 c3 8b 02 89 d1 f6 c4 40 74 03 8b 4a 0c 8b 41 04 40 75 02 <0f> 0b f0 83 42 04 ff 0f 98 c0 84 c0 74 07 89 d0 e9 9f 02 00 00

 <6>note: X[11143] exited with preempt_count 2

scheduling while atomic: X/0x00000002/11143

 [<c0348277>]

 [<c034a0a7>]

 [<c01185a4>]

 [<c011847a>]

 [<c011847a>]

 [<c011847a>]

 [<c03498f5>]

 [<c011b021>]

 [<c011a143>]

 [<c0103c98>]

 [<c0103a37>]

 [<c0103d12>]

 [<c01393f6>]

 [<c0349d4e>]

 [<c0167b55>]

 [<c034a03e>]

 [<f8b6a5e7>]

 [<c0128ee6>]

 [<c0103447>]

 [<c01393f6>]

 [<c013d2df>]

 [<c013d43d>]

 [<c013d559>]

 [<c0140c1b>]

 [<c0140eb8>]

 [<c0140f00>]

 [<c0102945>]
```

I submitted the bug here ---> http://bugzilla.kernel.org/show_bug.cgi?id=5983

Note: I am running 32bit OS.

----------

## MrDarthMaul

Ok, I resolved the problem.

I noticed that there's a mask on ati-drivers. I don't know why that would be... since the recommended version is buggy (atleast for me).

I just did the following:

```

ACCEPT_KEYWORDS="~x86" emerge ati-drivers

```

This resulted in ati-drivers-8.21.7 being installed. I rebooted with the same kernel (see post above) and no more problems with X11. Everything is working pretty well now.

----------

## toliman

many thanks for all the work in getting this ferrari guide, i know it's also helped other acer users.

i'm thinking of trying out suspend/suspend2 later, just as soon as i get that annoying clock/DSDT issue fixed up. i'm not entirely sure what to do with the .aml file i got from acpi, ill get around to putting it somewhere...

to save time & portage's sanity, i just added the following to /etc/portage/package.keywords

```
net-wireless/ndiswrapper ~amd64

x11-drivers/synaptics ~amd64

x11-drivers/ati-drivers ~amd64
```

emerge world handles better, module-rebuild still builds about 3 versions of ati-drivers, but it seems to work ok.

----------

## ahrain

I`m having big problems with the ATI drivers working properly with Cedega. 3D accelration works fine in games made for Linux, but when i try to play games trough cedega, 3D accelration does not work. Does anyone here experience the same problem?

----------

## Xithix

Ok, kernel 2.6.17 is out.  I have native bcm43xx working perfectly:

```
Networking -->

     <M>   Generic IEEE 802.11 Networking Stack

     [*]     Enable full debugging output

     <M>     IEEE 802.11 WEP encryption (802.1x)

     <M>     IEEE 802.11i CCMP support

     <M>     IEEE 802.11i TKIP encryption

     <M>     Software MAC add-on to the IEEE 802.11 networking stack

     [*]       Enable full debugging output

Device Drivers --> Network device support --> Wireless LAN drivers (non-hamradio) & Wireless Extensions

     <M>   Broadcom BCM43xx wireless support

     [*]     Broadcom BCM43xx debugging (RECOMMENDED)
```

It feels a lot faster than before.

I am currently trying to get SDHCI - Secure Digital Host Controller Interface - to work.  I have compiled it as a module.  Ran the "magic" bash script in the wiki, but my PCIxx21 interface isn't power cycling (Cannot power it off) to add the SDHCI in place of FlashMedia, so no go on sd cards.  Can anyone revise that script?

----------

## JonathanCasey

I'm trying to get the wirelss working with 2.6.21-r1 but i'm affraid all Broadcom options has completly dissapeared from:

Device Drivers --> Network device support --> Wireless LAN drivers (non-hamradio) & Wireless Extensions

Anyone have the same problem? better yet, anyone have a soltuion?  :Smile: 

----------

