Dell Inspiron 8500 and FreeBSD 6

We have discussed Dell Inspiron 8500’s in previous posts (one of our clients needed some help with one, and this prompted us to start using an Inspiron we had lying around), and it seems configuring these laptops with GNU/Linux and FreeBSD are popular search terms for hitting this blog. As a result, we have been asked about wireless with WPA support by FreeBSD 6 on an Inspiron 8500 with a miniPCI wireless card. In this post, we discuss some of the configuration tweaks we made to get FreeBSD 6 working properly on our Inspiron. We start with X, then sound, then wireless. Beforehand, our previous post will help with getting the basic system setup and up to date.

  1. The general method for getting X-windows (with a Gnome desktop) working on our system is similar to the one we used for our Debian installation: install X and then configure it. To do this, we will essentially rehash the instructions from the FreeBSD handbook section on X found here.

    First off, since this was a question, if you are experiencing “/dev/io” write errors, this could be due to your securelevel. Any securelevel greater than 0 disables write access to “/dev/io”. If you want, you can change this be setting “kern_securelevel_enable=”NO”" or “kern_securelevel=”0″” (the inner quotes are needed) in “/etc/rc.conf”.

    Ok, so, make sure that X11 is installed and, of course, Gnome. If they are not, they can be installed from the ports branch, which we updated in a previous post (by following the update instructions there, you will, as of the writing of this post, be sync’d to FreeBSD6-RC1), or using “sysinstall”, although this will be a pre-packaged version and not include the latest patches, which was part of the point of going through the previous post.

    • cd /usr/ports/xorg
    • make install clean
    • cd /usr/ports/x11/gnome2
    • make install clean

    This is a base, but there are other Gnome packages that you might want. After that, generate a configuration for X11 by running the following.

    • Xorg -configure

    This creates a configuration in “/root/xorg.conf.new”. We briefly edit this file (“vi /root/xorg.conf.new”) to include the proper modes and refreshes for the monitor, and screen that we saw from the Debian post. These settings can be extracted from the example for X on Debian, which works fine for us as we only needed to tweak the monitor and screen sections to insert the modes and refreshes (the video card configuration already looks to be correct for our needs).

    Once that is done, we test the configuration by running X.

    • Xorg -config /root/xorg.conf.new

    This looks good, so we copy the configuration file to etc/X11.

    • cp /root/xorg.conf.new /etc/X11/xorg.conf

    With that all set, we add Gnome to “/etc/rc.conf” by appending “gdm_enable=”YES”" (the inner quotes are needed), which causes Gnome to be automatically invoked at startup.

  2. In order to determine the sound driver we need to load, we run the command “kldload snd_driver”, which loads all the sound drivers available, and then “cat /dev/sndstat”, which lists the sound driver that has now been selected for use by the system. With the results we gather from those commands , we find that the selected driver was for the Intel ICH4. In order to have this driver loaded automatically during boot, we edit “/boot/loader.conf” and add “snd_ich_load=”YES”" (the inner quotes are needed) to it.
  3. As we did for Debian, we extract the Dell TruMobile 1300 MiniPCI drivers, and the drivers can be found here on the Dell suport site. Of these, all we need is the “bcmwl5.inf” and “bcm5wl.sys”, and we transfer these files to the laptop using “sftp”. Note: The “bcmwl5.inf” has to be converted to ASCII.

    Since we are running FreeBSD 6, we no longer have to use the “ndiscvt” tool directly nor do we build “if_ndis” with “ndis_driver_data.h” built into it. The wireless driver is now compiled into a separate kernel module by running the following command and walking through the prompts for driver conversion (no firmware necessary).

    • ndisgen

    “ndisgen” prompts for the .inf and .sys, and eventually generates a .ko. We copy the output of this conversion (“bcmwl5_sys.ko”) to “/boot/kernel”.

    • cp bcmwl5_sys.ko /boot/kernel

    Finally, we add the following entries to “/boot/loader.conf” to include the ndis drivers at boot. Note: This ordering of the entries is necessary.

      ndis_load=”YES”
      if_ndis_load=”YES”
      bcmwl5_sys_load=”YES”

    To load the modules we needed without rebooting, we ran “kldload”.

    • kldload ndis.ko
    • kldload if_ndis.ko
    • kldload bcmwl5_sys.ko

    Now, we could add an entry to rc.conf for the wireless network interface, and, if “D_dash_KRIPTIK_dot_COM” is an unprotected network, we would have been all set by adding the following to “/etc/rc.conf”.

      ifconfig_ndis0=”ssid D_dash_KRIPTIK_dot_COM DHCP”

    However, we want to use WPA, so we have to perform additional configuration. First, we need kernel support for the WPA mechanisms. This can be accomplished by linking these mechanisms into the kernel, as we did in a previous post, or by building these as kernel modules and manually configuring them to load by adding the following to “/boot/modules.conf”. (We threw in WEP as well.)

      wlan_ccmp_load=”YES”
      wlan_tkip_load=”YES”
      wlan_wep_load=”YES”

    If these modules have just been manually configured, then they are not currently loaded. To load the modules without rebooting, we can run “kldload”.

    • kldload wlan_ccmp.ko
    • kldload wlan_tkip.ko
    • kldload wlan_wep.ko

    Ok, with the necessary kernel components in place, we add the following line to “/etc/rc.conf”.

      ifconfig_ndis0=”WPA DHCP”

    We then copy over the example “wpa_supplicant.conf” from “/usr/src/contrib/wpa_supplicant” to “/etc”, and edit it as we did for Debian. Essentially, we leave the defaults in the example alone until the “# network block” section and then comment out the example entries.

    • cp /usr/src/contrib/wpa_supplicant/wpa_supplicant.conf /etc
    • vi /etc/wpa_supplicant.conf

    In the place of the example entries, we put the following in “wpa_supplicant.conf”.

      network={

      	ssid="D_dash_KRIPTIK_dot_COM"
      	proto=WPA
      	key_mgmt=WPA-PSK
      	pairwise=CCMP
      	group=CCMP
      	psk="*****************************************"
      	priority=1
      

      }

    We then disable networking (“/etc/rc.d/netif stop”), cross our fingers, and enable networking (“/etc/rc.d/netif start”).

    (Uh oh, we fail to negotiate a secure link and associate with the Access Point (AP). We try rebooting. Boom! Kernel panic when “wpa_supplicant” starts during boot. We reboot again. Boom! So, we play around with configurations for a few minutes and stop the system from crashing immediately during boot, but it is still not able to negotiate a secure link and associate with the AP. The issue appears to be with wpa_supplicant on FreeBSD using an NDIS driver that supports WPA, and we shelve it for a few days until we have some time to toy with it a bit more… Over those few days, the FreeBSD team make code changes that fixed the problem. When we next update our version of FreeBSD6 RC1 and try the setup as described above, it works perfectly.)

    We are all set.

While this post is not directly related to any of our current projects, we hope it helps.

Update: This Bejtlich post goes through similar paces.

Leave a Reply

Input 1329292883 here (required)

Note: Comments by those that have not written an approved comment will be moderated.