Monday, September 25, 2006

Windows on the world

As I continue my attempt to make PC-BSD the default OS on my machine, I'm looking at some Window Managers. X is interesting in that it is more of a graphical API rather than a whole usability idea, like Microsoft Windows. So there are many different "window managers" available for X, each of which have their own take on how windows and buttons and the like should behave. You can get monstrous big "Desktops" like KDE or Gnome, or you can get stripped down, minimal things like FVWM or Fluxbox. I played a bit with Fluxbox and found it interesting. I might try a few more, and here is a good page collecting all the various X window managers:



Window Managers for X




Saturday, September 23, 2006

We've got another live one

RoFreeSBIE is another LiveCD version of FreeBSD, based upon the FreeSBIE release. Looks pretty nice and includes a "Portbrowser", which sounds interesting.



The RoFreeSBIE Project





Friday, September 22, 2006

Lost Highway

I'm baaack! Man, where do I start?



Given the strange problems I was having with Linux distros, both bad and good, I decided to head on back to the promised land, and gave PC-BSD another shot. So I began yet another journey down that lost highway.



I ran into trouble right off the bat. For some reason, the "Use Entire Disk" option wasn't working correctly. I'd get a quick message about FDISK, then an even quicker one about newfs and it would claim to be done. But then when it tried to copy the files off the CD, the filesystem was obviously not created and it would complain about not being able to create the PCBSD folder. And I would reboot and try again. The "Customize Disklabel" option didn't seem to work either, because I wouldn't get anything back in the the list box showing me my partitions on the 3rd hard drive.



So then I did something very very stupid. And I came sooo close to avoiding disaster, yet I plunged headfirst over the abyss. I thought I would just see if the installer would at least see any of my other hard drives, because I figured that it wouldn't actually do anything until I said okay, right? Well, yes and no. Before you even get a chance to customize the layout, the installer puts up a dialog box asking if you're really sure you want to destroy all the data on the hard drive. After only a slight hesitation, I said sure, because it's just a warning and it wouldn't actually do anything until I laid out the slices, right?



Wrong. Terribly terribly wrong. It immediately gets rid of all the partitions on the selected hard drive, even though you haven't told it what, exactly, to do yet. And like an idiot, I didn't back up the MBR or the layout of the drive, despite the fact only earlier this morning I had been using a tool that would do just this, the Active@ Partition Recovery, as found on the The Ultimate Boot CD. And instead of using the hard drive with some not so important files on it, I "tested" on my main Windows boot partition. Zoiks!



So I purchased a copy of Active@ Partition Recovery for US$30 and sort of recovered my partitions. The 2gb DOS partition at the front of the drive was gone, but it was, for the most part, empty anyway. I was able to recover the 3 40gb NTFS partitions, but Windows still wouldn't boot. And I couldn't get the "bootcfg" program from the Recovery Boot to install a new boot.ini file. So now I had to either re-install WinXP or push on in my attempt to wean myself from Redmond.



So I hung my head and pushed forward on my PC-BSD install. Turns out, if I just waited a few more seconds, the installer would set up Customize Disk Label list just fine for my third hard drive. Not sure what caused the delay, but there ya go. I decided follow some earlier advice and set up my partitions thusly:




  • / - 1gb (I figured in this day and age of gigantic hard drives, why mess with just a 512mb partion?)

  • swap - 1gb

  • /var - 4gb

  • /tmp - 1gb

  • /usr - 104gb (the rest)



Although I think PCBSD puts a bunch of stuff in /, like /PCBSD and /Programs, so I'm not sure how well that's going to work either. But I guess it can always be moved to /usr. BTW, the PC-BSD installer goes with the monolithic /, adding only a 512mb swap.



And the install went fine. And I didn't play any funky games with X and it has been pretty stable. cupsd started hanging, so I disabled that. Maybe I'll move my printers to hang off of my other Windows box. I tweak the xorg.conf file just a little to give my 1280x1024 on my main display. Using the ATI driver seemed to be unreliable, but so far the Radeon one has worked pretty well. I'm happy with KdeMail, and I have Emacs, bash and Firefox working. There's a mountain load of tweaking left to be done, but at least I feel like the base platform is stable enough to do it with.



And today I re-installed Windows. It is going to remain a basic installation, pretty much just to play Windows games with. I copied some data off of the 40gb NTFS partitions (PC-BSD does a wonderful job of seeing all my local drives), deleted those partitions and combined them into one big partition with the third one. I installed WinXP and tested it out on some gaming. So far so good.



And now I'm back in PC-BSD. Not sure what I'm going to tweak next. Maybe I'll try the Font tweaking, as some of this stuff looks pretty ugly. Then maybe I'll try to get the dual displays working.



Wednesday, September 20, 2006

What is all this stuff?

Cool little tip I found while reading the fourth edtion of The Complete FreeBSD. Change directory into /bin and get a one line description of what all that stuff is:




$ cd /bin

$ man -f * |grep " - "



You can also use 'whatis' instead of 'man -f'. The grep gets rid of all the lines where there is "nothing appropriate" in the man files.



Tuesday, September 19, 2006

Jumpin' from distro to distro

Given the intermittent hang problems I've been having with FreeBSD and its derivative PC-BSD, I decided to explore the "other" side a bit and try out some Linux distros. Linux would actually be a better fit for me professionally, as we have a few parts of our product that run on Linux (RedHat is the "officially supported" distro), while the closest we get to FreeBSD is our MacOSX client. And I've had pretty good luck in the past with them, so what the heck?



I downloaded a few random distros and tried them out. Not to get into any distro war, but I just grabbed a few popular distros.




  • Xandros : I have pimped this distro in the past, so I figured I'd try it again on this troublesome machine.

  • Freespire : the free version of the highly touted Linspire (formerly Lindows, I think) distro

  • Mandriva : A long time ago in a galaxy far far away, I used this one when it was called "Mandrake". In fact, I think it was the very first alternative OS I ever tried.



But in the end, each had their own peculiar and show-stopping set of errors:




  • Xandros : I remember being wildly impressed with just how smoothly it integrated into my Windows network. And the install went about as easy as you could imagine, although it is a little scary to let these distros use an entire hard drive. It is an empty one, so it is free to go about its business, but what if I pick the wrong drive? All the warnings in the world won't help if I choose hd2 instead of hd5 and don't notice! So I check, and double check and then move on. But it surprised me in that I couldn't find any of my other Windows partitions. Not like PCBSD, where they are automatically part of your system and can easily be mounted. In fact, I couldn't even find the partitions in /dev, which was weird.

  • Freespire : Didn't get very far in this one. I got to the "Choose a hard drive" screen but couldn't find the Next button I was supposed to click on! And it was also a bare-bones display, that didn't list the current partitions on the hard drive, so it was extra scary to use.

  • Mandriva : I used the "Mandrive One" version, which is a "Live" cd, which means you can boot and run from it, rather than just install. So you can sort of take it for a test drive before actually touching your hard drive. And there is a link on the desktop to install it, so it's a nice way to get into it. And the install went pretty smoothly, although it took a long time. But it got confused, or maybe I got confused, at the end of it. It said to click the okay button to reboot, which I did, but I don't think it actually rebooted. And there didn't seem to be anyway in the Live version to reboot, so I just hit the reset button. Which gummed up the Linux partitions so they wouldn't mount or fsck. Sigh...



So I think I'm going to head back to PC-BSD and try to figure out the hang/freeze problem. Oddly enough, it was, I think, nearly the best installation and integration package I used, which is great news. It installed smoothly (once I got a good cd built), and it finds both my Windows network and my local Windows hard drives without any effort on my part. But the hang is a problem obviously, as is the hang when I click on the Home icon. But maybe the two are connected, which would be good, as an easily reproducible problem is almost always solvable, while a random hang is not.



All this wandering about the alternative OS forest has got me thinking about why I find FreeBSD so fascinating. It might be too geeky to admit it, but I get a certain warm feeling inside when I'm dabbling in FreeBSD that I don't get when working with Windows or Linux. There seems to be a coherence and singular vision, combined with a real do-it-yourself, bare metal approach that resonates with me. Windows is too much of a monolithic black box, while Linux feels too haphazard and scatter-shot. So it's back to the drawing board with PC-BSD to see what I can get to work.



Monday, September 18, 2006

Jilting PC-BSD

I have to admit to giving up, for now, on PC-BSD. I finally got X to work correctly for me, but I was getting intermittent hangs, usually after about 10-15 minutes of running. No messages in any of the various /var/log logs to help me out, just a solid freeze of the entire machine, requiring a reboot.



So I am trying a vanilla FreeBSD 6.1 install. That went pretty smoothly, although I really missed PC-BSD's graphical, guided, installation. That old sysinstall text screen looks pretty tired by now. I again went with the The Complete FreeBSD, Fourth edition recommendation for the disk layout:




  • 6 Gb for /

  • 512 Mb for swap

  • the rest (approx. 105 Gb) for /home



Although I'm not sure that's really a good idea, upon further reflection. If you installed KDE from ports, it says to be sure to have 4GB of room and this set up doesn't leave you much room for error on /usr. So maybe I should have set up another partition for /usr and gave it about 20gb. But maybe that's enough anyway. We'll see.


On the Distributions page, I select All, which adds in X Windows and some basic packages. Upon finishing this installation, these are the packages listed that were installed:




# pkg_info

bitstream-vera-1.10_2 Bitstream Vera TrueType font collection

expat-2.0.0_1 XML 1.0 parser written in C

fontconfig-2.3.2_3,1 An XML-based font configuration API for X Windows

freetype2-2.1.10_3 A free and portable TrueType font rendering engine

imake-6.9.0 Imake and other utilities from X.Org

libXft-2.1.7_1 A client-sided font API for X applications

libdrm-2.0_1 Userspace interface to kernel Direct Rendering Module servi

linux_base-8-8.0_14 Base set of packages needed in Linux mode (for i386/amd64)

perl-5.8.8 Practical Extraction and Report Language

pkgconfig-0.20 A utility to retrieve information about installed libraries

png-1.2.8_3 Library for manipulating PNG images

xorg-clients-6.9.0_2 X client programs and related files from X.Org

xorg-documents-6.9.0 Documentation of X11 protocol and libraries from X.Org

xorg-fonts-100dpi-6.9.0_1 X.Org 100dpi bitmap fonts

xorg-fonts-75dpi-6.9.0_1 X.Org 75dpi bitmap fonts

xorg-fonts-cyrillic-6.9.0_1 X.Org Cyrillic bitmap fonts

xorg-fonts-encodings-6.9.0_1 X.Org font encoding files

xorg-fonts-miscbitmaps-6.9.0_1 X.Org miscellaneous bitmap fonts

xorg-fonts-truetype-6.9.0 X.Org TrueType fonts

xorg-fonts-type1-6.9.0 X.Org Type1 fonts

xorg-fontserver-6.9.0_1 X font server from X.Org

xorg-libraries-6.9.0 X11 libraries and headers from X.Org

xorg-manpages-6.9.0 X.Org library manual pages

xorg-nestserver-6.9.0 Nesting X server from X.Org

xorg-printserver-6.9.0 X Print server from X.Org

xorg-server-6.9.0_1 X.Org X server and related programs

xorg-vfbserver-6.9.0 X virtual framebuffer server from X.Org

xterm-206_1 Terminal emulator for the X Window System



So a pretty basic set of packages is installed. The first thing I did after I rebooted was to get an up to date set of ports. I didn't bother to install the ports from the CD, as it'll be out of date anyway:




# portsnap fetch

[.... many minutes later ....]



# portsnap extract

[.... many ports later ....]



In 'portsnap', I'm using the latest port update tool, rather than the old-fashioned cvsup, as per the handbook. I've since added 3 more ports and one more package:




  • editors/emacs : I gotta have my emacs!

  • shells/bash : I'm not wedded to a shell, but bash works for me.

  • net/cvsup-without-gui : no need to have a bunch of UI stuff around for cvsup, as the command line version works just fine for grabing the system source

  • x11/kde : I did this as a package for speed sake. Building it from ports just didn't seem worth the extra effort:


    # pkg_add -r kde

    [... a gazillion extra packages later ...]

    #

    It took long enough as it was.



Here's my new package list:



# pkg_info

ORBit2-2.12.5_2 High-performance CORBA ORB with support for the C language

OpenEXR-1.2.2_1 A high dynamic-range (HDR) image file format

Xaw3d-1.5E_1 A 3-D Athena Widget set that looks like Motif

akode-2.0,1 Default KDE audio backend

akode-plugins-mpc-2.0,1 Musepack decoder plugin for akode

akode-plugins-mpeg-2.0,1 MPEG audio decoder plugin for akode

akode-plugins-oss-2.0,1 OSS output plugin for akode

akode-plugins-resampler-2.0,1 Resampler plugin for akode

akode-plugins-xiph-2.0,1 FLAC/Speex/Vorbis decoder plugin for akode

apr-db4-1.2.2_3 The Apache Group's Portability Library

arts-1.5.1_1,1 Audio system for the KDE integrated X11 desktop

artswrapper-1.2.2 Setuid wrapper for arts

aspell-0.60.4_3 Spelling checker with better suggestion logic than ispell

atk-1.10.3_1 A GNOME accessibility toolkit (ATK)

autoconf-2.13.000227_5 Automatically configure source code on many Un*x platforms

bash-3.1.10_1 The GNU Project's Bourne Again SHell

bitstream-vera-1.10_2 Bitstream Vera TrueType font collection

boost-python-1.33.1 Free peer-reviewed portable C++ source libraries

cairo-1.0.2_2 Vector graphics library with cross-device output support

cdparanoia-3.9.8_8 A CDDA extraction tool (also known as ripper)

cups-base-1.1.23.0_8 The Common UNIX Printing System: headers, libs, & daemons

cyrus-sasl-2.1.21_2 RFC 2222 SASL (Simple Authentication and Security Layer)

db4-4.0.14_1,1 The Berkeley DB package, revision 4

db42-4.2.52_4 The Berkeley DB package, revision 4.2

emacs-21.3_9 GNU editing macros

expat-2.0.0_1 XML 1.0 parser written in C

fftw3-3.0.1_5 Fast C routines to compute the Discrete Fourier Transform

flac-1.1.2_1 Free lossless audio codec

fontconfig-2.3.2_3,1 An XML-based font configuration API for X Windows

freetype2-2.1.10_3 A free and portable TrueType font rendering engine

fribidi-0.10.4_2 A Free Implementation of the Unicode Bidirectional Algorith

gamin-0.1.7_2 A file and directory monitoring system

gconf2-2.12.1_1 A configuration database system for GNOME

gettext-0.14.5_2 GNU gettext package

ghostscript-gnu-7.07_15 GNU Postscript interpreter

glib-2.8.6_1 Some useful routines of C programming (current stable versi

gmake-3.80_2 GNU version of 'make' utility

gnomehier-2.0_7 A utility port that creates the GNOME directory tree

gnu-autoconf-2.59 Automatically configure source code on many Un*x platforms

gnu-automake-1.9.6 GNU Standards-compliant Makefile generator (GNU unmodified)

gnu-libtool-1.5.20 Generic shared library support script (GNU unmodified)

gnupg-1.4.2.2 The GNU Privacy Guard

gnutls-1.2.10_1 GNU Transport Layer Security library

gpgme-1.0.3_1 A library to make access to GnuPG easier

gsfonts-8.11_2 Fonts used by GNU Ghostscript (or X)

gtar-1.15.1_2 GNU version of the traditional tar archiver

gtk-2.8.12_1 Gimp Toolkit for X11 GUI (current stable version)

hicolor-icon-theme-0.5 A high-color icon theme shell from the FreeDesktop project

imake-6.9.0 Imake and other utilities from X.Org

jackit-0.100.0_1 A low-latency audio server

jasper-1.701.0_1 An implementation of the codec specified in the JPEG-2000 s

jpeg-6b_4 IJG's jpeg compression utilities

kde-3.5.1 The "meta-port" for KDE

kdeaccessibility-3.5.1_1 Accessibility applications for KDE

kdeadmin-3.5.1_1 KDE applications related to system administration

kdeartwork-3.5.1_1 Additional themes, sounds, wallpapers and window styles for

kdebase-3.5.1_2 Basic applications for the KDE system

kdebase-kompmgr-3.5.1 Utility needed to enable XComposite support in KDE

kdeedu-3.5.1 Collection of entertaining, educational programs for KDE

kdegames-3.5.1_1 Games for the KDE integrated X11 desktop

kdegraphics-3.5.1_2 Graphics utilities for the KDE3 integrated X11 desktop

kdehier-1.0_8 Utility port which installs a hierarchy of shared KDE direc

kdelibs-3.5.1_1 Base set of libraries needed by KDE programs

kdemultimedia-3.5.1_1 Multimedia utilities for the KDE integrated X11 desktop

kdenetwork-3.5.1 Network-related programs and modules for KDE

kdepim-3.5.1_1 Personal Information Management tools for KDE

kdesdk-3.5.1_1 KDE Software Development Kit

kdetoys-3.5.1_1 Small applications for KDE

kdeutils-3.5.1_1 Utilities for the KDE integrated X11 desktop

kdevelop-3.3.1_1 IDE for a wide variety of programming tasks

kdewebdev-3.5.1_1,2 Comprehensive html/website development environment

koffice-1.4.2_3,1 Office Suite for KDE3

lcms-1.14_1,1 Light Color Management System -- a color management library

libIDL-0.8.6_2 A library for creating trees of CORBA Interface Definition

libXft-2.1.7_1 A client-sided font API for X applications

libart_lgpl2-2.3.17_1 Library for high-performance 2D graphics

libaudiofile-0.2.6 A sound library for SGI audio file

libdrm-2.0_1 Userspace interface to kernel Direct Rendering Module servi

libgcrypt-1.2.2 "General purpose crypto library based on code used in GnuPG

libglut-6.4.1 A graphics library similar to SGI's OpenGL

libgmp-4.1.4_2 A free library for arbitrary precision arithmetic

libgpg-error-1.1 Common error values for all GnuPG components

libgsf-1.13.3_1 An extensible i/o abstraction for dealing with structured f

libiconv-1.9.2_2 A character set conversion library

libidn-0.6.2_1 Internationalized Domain Names command line tool

libltdl-1.5.22 System independent dlopen wrapper

libmad-0.15.1b_2 Libmad library (part of MAD project)

libmal-0.40 A library encapsulating malsync

libmng-1.0.9 Multiple-image Network Graphics (MNG) reference library

libogg-1.1.3,3 Ogg bitstream library

libpaper-1.1.14.3 A library providing routines for paper size management

libsamplerate-0.1.2_1 Secret Rabbit Code: a Sample Rate Converter for audio

libsndfile-1.0.14_1 Reading and writing files containing sampled sound (like WA

libtheora-1.0.a4_1 Theora video codec for the Ogg multimedia streaming system

libungif-4.1.4_1 Tools and library routines for working with GIF images

libusb-0.1.10a_2 Library giving userland programs access to USB devices

libvorbis-1.1.2,3 Audio compression codec library

libwpd-0.8.4_1 Tools for importing and exporting WordPerfect(tm) documents

libxml2-2.6.23_1 XML parser library for GNOME

libxslt-1.1.15_1 The XSLT C library for GNOME

linc-1.0.3_5 A library for writing networked servers & clients

linux_base-8-8.0_14 Base set of packages needed in Linux mode (for i386/amd64)

lua-5.0.2_1 Small, compilable scripting language providing easy access

m4-1.4.4 GNU m4

mDNSResponder-107.1_2 "Apple's mDNSResponder"

mysql-client-4.1.18_1 Multithreaded SQL database (client)

nas-1.7b Network Audio System

neon-0.25.4_1 An HTTP and WebDAV client library for Unix systems

net-snmp-5.2.2_1 An extendable SNMP implementation

open-motif-2.2.3_2 Motif X11 Toolkit (industry standard GUI (IEEE 1295))

openldap-client-2.2.30 Open source LDAP client implementation

openslp-1.2.1_2 Open-source implementation of the Service Location Protocol

pango-1.10.3_1 An open-source framework for the layout and rendering of i1

pcre-6.6_1 Perl Compatible Regular Expressions library

perl-5.8.8 Practical Extraction and Report Language

pilot-link-0.11.8_4,1 PalmPilot communications utilities (backup/restore/install/

pkgconfig-0.20 A utility to retrieve information about installed libraries

png-1.2.8_3 Library for manipulating PNG images

popt-1.7_1 A getopt(3) like library with a number of enhancements, fro

portaudio-18.1_2 Portable cross-platform Audio API

postgresql-client-7.4.12 PostgreSQL database (client)

postgresql-libpqxx-2.5.5 A new C++ interface for PostgreSQL

python-2.4.2 An interpreted object-oriented programming language

qca-tls-1.0_1 SSL/TLS plugin for Qt

qt-3.3.5 Multiplatform C++ application framework

samba-libsmbclient-3.0.21b Shared libs from the samba package

shared-mime-info-0.16_2 A MIME type database from the FreeDesktop project

speex-1.0.5_1,1 An open-source patent-free voice codec

subversion-1.3.0_4 Version control system

t1lib-5.1.0_1,1 A Type 1 Rasterizer Library for UNIX/X11

taglib-1.4_2 Library for manipulating ID3 tags and Ogg comments

tidy-20000804_2 Fixes and tidies up HTML files

tiff-3.8.0_1 Tools and library routines for working with TIFF images

urwfonts-1.0_1 Another font package for X

urwfonts-ttf-1.0.7b18 Unicode TrueType fonts from URW extended by Valek Filippov

wv2-0.2.2_2 A library providing routines to access Microsoft Word files

xorg-clients-6.9.0_2 X client programs and related files from X.Org

xorg-documents-6.9.0 Documentation of X11 protocol and libraries from X.Org

xorg-fonts-100dpi-6.9.0_1 X.Org 100dpi bitmap fonts

xorg-fonts-75dpi-6.9.0_1 X.Org 75dpi bitmap fonts

xorg-fonts-cyrillic-6.9.0_1 X.Org Cyrillic bitmap fonts

xorg-fonts-encodings-6.9.0_1 X.Org font encoding files

xorg-fonts-miscbitmaps-6.9.0_1 X.Org miscellaneous bitmap fonts

xorg-fonts-truetype-6.9.0 X.Org TrueType fonts

xorg-fonts-type1-6.9.0 X.Org Type1 fonts

xorg-fontserver-6.9.0_1 X font server from X.Org

xorg-libraries-6.9.0 X11 libraries and headers from X.Org

xorg-manpages-6.9.0 X.Org library manual pages

xorg-nestserver-6.9.0 Nesting X server from X.Org

xorg-printserver-6.9.0 X Print server from X.Org

xorg-server-6.9.0_1 X.Org X server and related programs

xorg-vfbserver-6.9.0 X virtual framebuffer server from X.Org

xpdf-3.01_2 Display PDF files, and convert them to other formats

xterm-206_1 Terminal emulator for the X Window System


As you can see, just those few ports/packages add a lot of stuff! I also followed the recommendation in the handbook for Using Fonts In X. Wonder if that will make stuff look better?



Luckily, all the hard work on my xorg.conf didn't go to waste. I just pasted the copy from my posting into /etc/X11 and I had my dual monitor set up and ready to go. But I still have a massively annoying problem here as I did with PC-BSD - double clicking the "System" icon on my desktop hangs my machine! I have no idea what that is. But there doesn't seem to be the system lockup after about 10 minutes, at least I haven't noticed it so far. I'm going to have to try and track down that freeze problem though.



(A little later) Actually, I take it back. I'm still seeing the intermittent hang/freeze. I have no idea what that could be. I'm going to try and cut back on the peripherals I have plugged in and see if that helps. I wonder if the "System" icon hang and this one are related? I let memtest86+ from The Ultimate Boot CD run for a couple of hours and it didn't find anything wrong with my memory, so that natural culprit is out.




Thursday, September 7, 2006

Wild Wiki Waxings

As mentioned in the comments section of an earlier posting, there is a FreeBSD wiki out there called FreeBSD Wiki (no kidding!). I love wikis. They make a great way to share knowledge. We should all get on there and add one piece of information. FreeBSDWiki has been pretty quiet lately, so it is due for an influx of new talent.



When I first started playing Oblivion, I was helping out quite a bit on OblivioWiki. It was fun while my Oblivion obsession lasted. But as is often the case with computer games, my interest faded, and so did my efforts with that wiki.



I check in regularly with the EmacsWiki. It is an incredible treasure trove of information for that beast that is Emacs. I'm constantly learning new ways to do things with Emacs, even though it has been my main editor for ten years or more. You can see my EmacsWiki page here.



And a cool add-on for Firefox is the Googlepedia. I often forget to check Wikipedia when I'm looking for information (I know I know, how could I?). With this add on, it splits your Google search window in two, with a usually appropriate Wikipedia page in it. Pretty nice, although sometimes the matches aren't correct, and it does tend to slow the response of Firefox down a little for a Google search.



I recommend the site pb wiki for setting up a quick 'n' easy wiki. There's a very functional free version available and it's pretty easy to use. Of course, many readers of this blog would prefer to set up their own, but I haven't yet done that myself. I should though.



And I'd be entirely remiss if I didn't mention the amazing Javascript feat that is TiddlyWiki, a one page wiki for users. I'm not sure I entirely agree with the concept of keeping your entire wiki in a single file, downloaded all the time, but it still is some incredible Javascript going on it there.



Tuesday, September 5, 2006

Wallpapers to the rescue

For some reason, my posting with a couple of links to some BSD wallpaper sites here is one of the most popular pages on my blog. It's a mystery why it (and the other one here) get looked at so much! But hey, if it is popular, I'll just go with the flow and post Yet Another BSD Wallpaper Site (YABWS). This one even has five pages of them!



Bsdportal.Ru :: Wallpapers :: Part 1





Chucktips keeps a noob informed

A self-proclaimed "newbie-friendly" site for FreeBSD users. Forums, Q&A, tips and tricks irregularly posted. Looks like a simpler Slashdot kind of site.



Chucktips - Newbie Friendly






Monday, September 4, 2006

xorg.conf battles

So I'm a little further along. Not too much, but a little. I spent over two days, probably at least 8 - 10 hours, playing with my X config file, trying to get my ATI X850 dual monitor card to work. Each monitor was showing the same image, a clone of each other. Not quite what I wanted. On Windows, I have my cheapo 14" LCD monitor set up to the left of my 19" CRT, and it is very easy to use the Display Properties dialog to move things around. The CRT is in 1280x1024 mode, while the LCD is in 1024x768, which works just fine in Windows.



But under X it is a whole new ballgame. It was *very* difficult to get the appropriate information on the web. What I could find was one or more of a] out of date, b] for Linux, c] for nVidia and/or d] for a different ATI card. I would have been happy to find a reasonable man page even for the magical xorg.conf file, and especially the ATI driver. But most pages talked about the various ATI proprietary drivers for Linux, which didn't help me at all for my PC-BSD installation. And those that did talk about BSD were using a different card to do dual monitors.



See, ATI has two ways of doing dual monitors. One is a card with one VGA plug on the back, and a splitter cable that has two VGA plugs to plug two monitors into. A similar setup is for a laptop showing on both the internal and external display. But mine actually has two plugs on the board, one for VGA and one for DVI (which came with a DVI->VGA adapter, as my LCD isn't DVI - told you it was cheap).



So this meant all talk about the flgrx couldn't be used, as that has never been ported to BSD. I'd love to see a petition for ATI to make BSD drivers! And there was a lot of talk about Screen 0 and Screen 1, but that never seemed to work for me.



Anyway, after a gazillion hours of experimentation, I was sure I had to ignore all the advice saying to use Screen 0 and Screen 1 in the "Driver" section. For instance, the xorg.conf file found here has:


Section "Device"
Identifier "aticonfig-Device[0]"
Driver "fglrx"
BusID "PCI:1:0:0"
EndSection

Section "Device"
Identifier "aticonfig-Device[1]"
Driver "fglrx"
BusID "PCI:1:0:0"
Screen 1
EndSection


(note especially the BusID - we'll come back to that later) This is a typically recommended configuration for dual monitor with ATI cards. In this case, it is for a laptop to use both the internal and an attached external monitor. Or another found on the web:




Section "Device"
Identifier "Card0"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "Radeon X300"
BusID "PCI:1:0:0"
Screen 0
EndSection

Section "Device"
Identifier "Card1"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "Radeon X300"
BusID "PCI:1:0:0"
Screen 1
EndSection


Again, note the matching BusID and the different Screen numbers. Basically, this tells X that there are two screens, and, in a "Screen" section, you'll tell it which monitor is on which screen, thusly:




Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultColorDepth 16
SubSection "Display"
Depth 1
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Card1"
Monitor "Monitor1"
DefaultColorDepth 16
SubSection "Display"
Depth 1
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection


So I tried a million variations on this, and would either get the driver complaining about devices not being found ("no matching Device section for instance (BusID PCI:1:0:1)", mismatched devices or it would just go "poof", with no report, no display and a reset button press in my future. Round and round I went, often starting over using "X -configure" to generate me a new xorg.conf and trying to change one piece at a time to see exactly what was happening. Change a piece, type in "X -config xorg.conf.test", read /var/log/Xorg.0.log and try to decipher its nearly 1000 lines of technical jargon for some kind of help.



To work on this, I would boot into X, then type, from a root Konsole window, "shutdown now". This would drop me into single user text mode. From there I could edit the test config file, run X to see what it would do (of course, it was running a bare metal X, so nothing was really working), Ctrl-Alt-Backspace to kill the X server and try again. There was the added frustration that Ctrl-G (to cancel a command in emacs) would kill emacs and drop me back to the command shell. A command shell that was in some weird mode that didn't echo back any characters. I thought at first it was hung, but it was actually getting the characters, but Enter wasn't being recognized. I had to hit Ctrl-J to enter the (invisible) line. Oh, what fun I had! And to add to my frustration, PC-BSD intermittently hangs. sigh.



(BTW, a better method of doing this would be to use the alternate terminals in X. Ctrl-Alt-F7 puts you into tty6, in text mode. Edit the xorg.conf file, switch back to the X "terminal" with Ctrl-Alt-F9, and the reset the X driver with Ctrl-Alt-Backspace. This would give me a real KDE display, rather than the basic X of black and white crosshatch.)



After many hours of this, I felt like I was no closer, but by now I was determined to get to the bottom of it. I was certain, given the kinds of errors I was getting, that the Screen 0 and Screen 1 stuff wasn't for me. I eventually came to the conclusion it is for the dual head that uses the single VGA connector with the split, which makes sense, The BusID says which bus to talk to on the video card, and the screen number says which cable to talk to. But that wasn't my set up, and I was certain I needed to heed the warnings about "No matching Device section" and so I created two device sections, one for BusID "PCI:1:0:0" and one for "PCI:1:0:1". This would bring up X on both windows, but still they were clones of each and not two different displays.



So I reached deep into my Google-fu and I finally found this page: MergedFB on Freedesktop.org. I liked the idea of the Virtual command, but I wasn't exactly sure how he meant it to be used. But the Radeon man page linked from there was also a huge help, in explaining the options, explaining the arguments and telling me what they actually did. And it explained an incredibly important option - change the default setting of the "CRT2Position" option from "Clone" (sound familiar?) to be "RightOf". Now who in their sickest dreams would decide that the default setup for a two monitor computer should be where the two monitors are clones? How many people would actually want that? I wouldn't be surprised to learn but for want of that one option I could have been saved hours and hours of tweaking!



The other important option, as mentioned, is the Virtual one. This tells X how to layout your two screen desktops. It will only work with rectangular regions, unlike Windows which just abuts the two different rectangular screens, even if they are of different sizes. So I defined a Virtual area of (1280+1024)=2304 by 1028, so it abuts the LCD monitor to the left of the CRT (the LCD is always the CRT1 for the X850 card), with a desktop that scrolls from top to bottom (as the desktop is 1024 pixels vertically but the display is only 768). There's a small bit of "tear" from the mouse cursor when the desktop scrolls up and down, but it goes away immediately and thus isn't too bad.



I also had to play some games with the monitor refresh, as X insisted on setting the horizontal to slightly less than the LCD would handle, but luckily the monitor actually gave me a nice error message, saying the mode wasn't supported and showing me the mode that was being tried. I'm not sure why X thought that 59.9 was enough for a monitor that wanted 60!



I also played with the Xinerama mode, which is slightly different than the MergedFB mode. But it won't do the irregular layout of my two displays, and instead finds the highest common denominator, in this case 1024x768. It is, however, nice that the task bar goes across both monitors and it really acts like a big 2048x786 screen. MergedFB is more like Windows, in that there are two displays and many things when asked to be put in the center, will go in the center of Screen 0. In Xinerama, it will really just go in the middle of both screens! Oh, and another option I set was "MergedXineramaCRT2IsScreen0", as CRT2 is my CRT, which is right in front of me (and Display 1 for Windows), while without this option, centered dialogs (like the login dialog for X) show up on my little LCD monitor.



So that's my X window story. I would really hate to think of just how long I banged my head on the keyboard working at this. Most of Friday night, on and off through most of Saturday, until late Saturday night I finally got it working correctly. I really think that had the "CRT2Position" option defaulted to the more expected "RightOf" or "LeftOf"(you can even do "Above" or "Below"!), I may have figured it out a few hours before. Because when you don't know what you are doing, you change lots of things, but without that option, it never looked right. And nearly everything on the web (including the few bits of help I found on the PC-BSD forums) talked about setting Screen 0 and Screen 1, which just isn't right for my card.



So, here's my complete xorg.conf file. I'm not sure what other tweaks I made. Some options can be put in the "Device" section or the "Screen" section, but I could never figure out which. I mean, what exactly does this mean (from the xorg.conf(5) man page):



Note that most of the Options listed here (but not the other entries) may be specified in the Screen section instead of here in the Device section.


Speaking some other language than English, I think! So I made sure AGP was turned on and tweaked a few other performance options. Rereading the Radeon man page just now, I noticed the "MergedNonRectangular" option, which would exactly match my Windows setup. I'll have to think about whether I want to use it or not, although I am not a big fan of scrolling desktops.




Section "ServerLayout"
Identifier "ATI Dual Monitor"
Screen "Screen0" 0 0
Screen "Screen1" RightOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
# Option "Xinerama" "True"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection

Section "Module"
Load "extmod"
Load "glx"
Load "dri"
Load "dbe"
Load "record"
Load "xtrap"
Load "type1"
Load "freetype"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
#DisplaySize 280 210 # mm
Identifier "LCD-Mon"
VendorName "PTS"
ModelName "PZ456"
### Comment all HorizSync and VertSync values to use DDC:
# HorizSync 30.0 - 60.0
VertRefresh 61.0 - 75.0
Option "DPMS"
EndSection

Section "Monitor"
#DisplaySize 350 260 # mm
Identifier "CRT-Mon"
VendorName "SAM"
ModelName "SyncMaster"
### Comment all HorizSync and VertSync values to use DDC:
HorizSync 30.0 - 96.0
VertRefresh 50.0 - 160.0
Option "DPMS"
EndSection

Section "Device"
Identifier "ATI Port 1"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "R480 [Radeon X850Pro]"
BusID "PCI:1:0:0"

# MergedFB options
Option "MergedFB" "True"
Option "EnablePageFlip" "True"
Option "AGPMode" "4"
Option "AGPFastWrite" "True"
Option "MergedXineramaCRT2IsScreen0" "True"
Option "CRT2Position" "RightOf"
EndSection

Section "Device"
Identifier "ATI Port 2"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "R480 [Radeon X850Pro]"
BusID "PCI:1:0:1"
EndSection

Section "Screen"
Identifier "Screen0"
Device "ATI Port 1"
Monitor "LCD-Mon"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768" "800x600"
Virtual 2304 1024
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "ATI Port 2"
Monitor "CRT-Mon"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600"
EndSubSection
EndSection





hier page

Cool man page showing the layout of the FreeBSD file system. Ever wonder what that directory is for? Well, here's your answer:



man hier






Saturday, September 2, 2006

Making the move

Well, I'm getting there. Unfortunately, I'm still posting this from my WinXP boot, but progress is being made. Here's what I've done so far:




  1. Cleaned up one of the 120gb hard drives, in order to turn it over entirely to PC-BSD.

  2. Made a PC-BSD CDROM. Well, to be honest, I've made about about ten PC-BSD CDROMs, as I'm having problems getting one to boot without any errors. Using two different burners and two different pieces of software (BurnCDCC and Easy Media Creator), burning at a variety of speeds (from "Optimal", through 16x, 8x and down to 4x) to burn the ISO, and booting it on 4 different computers and 5 different CD drives (I found out my main machine will boot from either CD drive), I still get random CD errors while booting, which has me scared. One suggestion was to try setting the 'hw.ata.atapi_dma' to zero, but that didn't help (by selecting option 6 at boot time, and typing in:



    # set hw.ata.atapi_dma=0

    # boot

    But that didn't help either. The one I burned at 16x seemed to work the best - both fast enough (slower speeds were real drags) and with the same number of (minimal) "READ_BIG MEDIUM ERROR" reports as slower speeds. It seemed to install okay, finding my 160GB hard drive on my Promise controller card just fine.


  3. I installed BootIT NG and it found both the old WinXP and the new PC-BSD boot partitions, and I can boot into either.




The boot in PCBSD worked fine, but now I have to play the usual, tiring, X Window games. I have an ATI 8500 card with dual monitors, and now I have to figure out how to get that setup to work, as both monitors show the same screen. It looks like it can be made to work, but I'm not sure how just yet. Then I have to tweak the X display to be bigger and better.



I was pleased to see that PC-BSD easily found all my WinXP partitions, which is nice. Not sure if I can write to them, as most of them are NTFS partitions. But at least reading them is nice.



Friday, September 1, 2006

Movin' on up

So I think I'm going to take the plunge and move my main home system over to FreeBSD, specifically, PC-BSD 1.2. I've been having a good time with it on my oldest machine (an 833mhz overclocked(!) Celeron), and I've moved most of my professional development over to my work machine (a real beaut - dual 3.0ghz dual core, hyper-threaded CPUs with 2gb of RAM), so I think I can finally break free from the shackles of Windows on my everyday personal machine. I will be dual-booting it for my game playing, though, so the break won't be complete.



So that means I should be updating this blog a lot more too. I've released 3 new PBIs to PBIDir.com:




  • Enscript : a pretty amazingly flexible "filter" from the GNU folks that translates text into Postscript, HTML and RTF. It's especially cool for creating HTML files from your source code. The example line in the man pages is:



    $ enscript -E --color -whtml --toc -pfoo.html *.h *.c


    But oddly enough, that complains about a bad -w parameter, although 'enscript --help' lists -w as well. Just change it to the more GNU-like "--lang=html" and you have an html file that contains all of your .c and .h files nicely colorized. Very cool. I created PBIs for both the a4 and letter versions, which I guess just pick the default paper size.



  • gnuls : It's kind of a pain that Linux and Cygwin use GNU file utilities like mv, cp and ls, while BSD uses, well, BSD ones, with their incompatible arguments. I especially the colorization, although upon further reflection, the BSD ls has the -G option for colorization. But it sure makes sharing .bashrc files difficult between my Cygwin, Redhat Linux, and BSD machines a pain. So I created the gnuls PBI, which makes on program that matches anyway. There's probably a GNU utiities package too, somewhere, that would make the transition easier too.



I will try to put up some notes on the process of creating the PBI. I'm getting to be pretty good at it.



First step is to consolidate my hard drives. I have three on my machine - 2 120GB drives and a 160GB - wow, who would have imagined such numbers just a few short years ago! I just recently put in the 120gb, so it is pretty empty and I will dedicate that to be my PC-BSD drive. I'll also re-install Windows XP for gaming, to get rid of 3 years of cruft. And I'll keep my current WinXP boot as well, just in case I forget something.



For a boot manager, I'll go with BootITNg. I always used to be a System Commander guy, but I started to have problems and have settled on BootIT. Very nice program, albeit a little rougher our the edges than System Commander, and it doesn't have the wonderful Partition Commander either.



Other specs on this machine include an 256mb ATI Radeon X850, 1GB of RAM, using a 2.5ghz Intel Pentium 4, a SoundBlaster Live! sound card, a no-name 50x CD and a LiteOn DVD+RW drive, an LS120 floppy drive (remember the 120mb floppy drives?), an SiS onboard network card, and two monitors, a Samsung SyncMaster 997df (very nice 19" monitor) and a no-name 14" LCD monitor. Wonder how tough it will be to get X to work with them both?



It'll be interesting to see how it works out. I've had some problems in the past getting PC-BSD to recognize hard drives beyond the first one. It should be something to do on a rainy Labor Day weekend. We'll see how it works this time - wish me luck!