Sunday, October 25, 2009

Wifi on FreeBSD

Compared to adding sound support, adding wifi to FreeBSD was a little bit more difficult. Of course, man wlan helps. Once you know what your wireless chipset is called, you can man that (look it up in the manual). On this Latitude D600, it was iwi. It could have also been ipw. I found this documentation helpful: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html (FreeBSD Handbook, Chapter 31 Advanced Networking). Part of the difficulty is that the wireless router (access point) I wanted to connect to uses WPA security. Another issue is that you need to agree to the Intel license agreement and load the firmware. You need to load the 802.11i security components and use the wpa_supplicant. These lines get added to /boot/loader.conf (again, there is a way to do it in the kernel configuration file, but I don't know the pros/cons of that):
legal.intel_iwi.license_ack=1
if_iwi_load="YES"
wlan_load="YES"
firmware_load="YES"
iwi_bss_load="YES"
iwi_ibss_load="YES"
iwi_monitor_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

In the file /etc/wpa_supplicant.conf I had to add:
network={
ssid="mySSID"
psk="myPSK"
}

I added this line to /etc/rc.conf:
ifconfig_iwi0="WPA DHCP"

When I reboot, I have internet access, and it connects to my network as part of the loader script. Once I figure it out, I need to detail how to load Firefox (not hard) with Adobe Flash support (seems hard).

Sound on FreeBSD

Getting sound on FreeBSD was not difficult. All I had to know was what audio device I was looking for. At first, I thought it was going to be snd_hda. In actuality, I used snd_ich. As usual, you can find out more from the man pages, man snd and man snd_ich.

All I had to do was add the line snd_ich_load="YES" to my /boot/loader.conf file and reboot. Apparently it can also be loaded in the kernel, but I am not sure the pros and cons of doing it that way.

Wednesday, October 21, 2009

Playing with FreeBSD 7.2: Want KDE 4

On a Dell Latitude D600, I partitioned the 60 GB (55.89 GB) drive into two (three) partitions. I installed Windows XP SP3 on a 27.5 GB partition and FreeBSD 7.2 on the remaining 28.25 GB partition (the remaining is the Dell Diagnostic/Utility partition). Windows XP was installed first and FreeBSD 7.2 next. I used the FreeBSD boot manager. I installed X + User in sysinstall, created a user (and password) and set the root password.

Since my previous experiences with FreeBSD was in college and I've used Linux distributions like Red Hat Linux, Fedora Core, SimplyMEPHIS (for A+ training), and gOS, I had some expectations, namely some sort of windows manager to greet me. (I'd also run Sun Solaris.) I got a CLI/TUI (command line interface or text user interface).

After logging in, startx would get me a graphical interface of sorts. Here is what I did to get KDE 4.2.2 to come up. I learned a little about vi (view) in the process, some Xorg stuff, mount, and pkg_add. I used vi /etc/rc.conf and added hald_enable="YES" and dbus_enable="YES". The vi program has two modes, command and text editor. First you move the cursor to where you want to edit. I used i to insert text and started typing. I pressed escape, typed write and pressed enter, then used ":q!" to exit. I had to restart.

The Xorg -configure autoconfigures a file called xorg.conf.new. Then I tried xinit /root/xorg.conf.new -retro to see that the mouse was working. In startx, I could also use the keyboard and mouse (clicked the term and typed exit). I needed the cd/dvd to install KDE, so I used mount_cd9660 /dev/acd0 /cdrom. Then I could use pkg_add /cdrom/packages/kde/kde4-4.2.2.tbz. Time to wait and watch. I learned that I could use ALT+F2 through ALT+F7 to access 7 virtual terminals. I was then able to use echo echo "exec /usr/local/kde4/bin/startkde" > ~/.xinitrc to make startx load into KDE.

Unfortunately two things still don't work: audio and networking. I have to figure out how to get the Intel PRO/Wireless 2200 BG and the SigmaTel C-Major (STAC 9750 AC97) Audio working.

I noticed that when I come home from work, I mostly browse the internet and listen to music. I don't tend to play games or use Windows-specific applications. Plus, I have a desktop with Vista (soon to be Windows 7) installed, so I can use that if needed. I'd like to learn Unix or Linux to round out my computer knowledge a little.