Jun 01

Any operating system that contains the letters B, S and D usually conjures images of geeky elitism, arcane interfaces and the undead world of UNIX. Despite its similarity, this is an image Linux has largely been able to shake off, thanks to its friendly graphical installers and configuration tools. But BSDs can offer a unique insight into what has made Linux popular, as well as an opportunity to hone your command-line and trouble shooting skills in a world that might be getting too easy. And while you do need a little technical confidence to get any BSD system up and running, it’s not half as difficult as it first appears.

FreeBSD is not as demonic as its logo might suggest. Honest.

FreeBSD is a the most popular implementation of version 4.4 of the Berkeley Software Distribution. This was the original BSD, a version of UNIX that was developed between the late-70s and the mid-90s and used a famously liberal licence. This licence has meant that anyone can use, copy and redistribute and re-implement its code and APIs. Which is exactly what FreeBSD attempts to do, alongside other projects like OpenBSD and NetBSD. In turn, there are many projects like Apple’s OS X that build upon the foundations in FreeBSD, all thanks to the liberal licences of the original.

Step 1: Prologue

There are several important differences between FreeBSD and Linux, but the most fundamental is the kernel. The term ‘Linux’ is most often used to refer to the entire operating system, from the boot code and drivers to the desktop and the applications. We’d call Ubuntu, Fedora and OpenSUSE different versions of Linux, for instance. But this definition isn’t accurate. ‘Linux’ should only really refer to the kernel – the chunk of code at the heart of the system that deals with hardware, networking, drivers, storage, CPU and process management, and the BSD kernel is entirely different.

The Linux kernel that was originally developed by Linus Torvalds, and it’s still the only part of the whole operating system he has control over. The remainder of what makes a complete operating system, the windowing environment, the desktops and the applications, are pulled from open source project that are mostly using one of the the GNU Public Licences. Hence, the official name for the entire Linux operating system is really GNU/Linux to show that there are two parts of the whole project. Which is why replacing the kernel isn’t a trivial operation.

Don’t be scared of text mode. It’s part of Linux’s legacy, and serves a very useful purpose.

Any new kernel needs to be broadly compatible with Linux so that the remainder of the software stack can be ported without too much difficulty. Fortunately, both FreeBSD and Linux are UNIX-alike, which means there are many similarities, and the result is that with a standard installation, you’ll find many of the tools you’re already familiar with, albeit in a different configuration.

Many system administrators feel FreeBSD is has been a more stable choice for servers over the years, and that it can out-perform its cousin on certain tasks. It’s also a great choice if you want to run a server on limited hardware, as the requirements for a BSD-based system are often less than for the Linux equivalent. FreeBSD, for example, lists its minimum requirements as a 486 CPU with 24MB RAM, which is quite staggering in today’s world of terabytes and quad core processors. FreeBSD is also a i386-based platform. There are ports to other processors, but the project’s focus has always been compatibility with Intel’s standard architecture, and as a result, could be better suited to the majority of machines that parts of the Linux kernel.

Step 2: Installation

While there are Live CD versions of FreeBSD, the traditional install disc is still the most common medium for getting hold of the latest version. But you’ll need to steel yourself against its antiquated installation mechanism.

When you boot your machine with the disc in the drive, the first thing you’ll see is the black and white ASCII art of the install menu. You won’t see any other graphical embellishment until you’re able to boot successfully into a working desktop. For most installs, you’ll need to choose option 1 from the menu, but if you’re using an older machine, you may want to try 2 (with ACPI disabled) to avoid any potential problems.

Unlike trial Linux installation packages like Wubi, installing BSD has a tendency to be destructive. Make sure you’re not going to obliterate anything important before continuing.

You’ll then have to wait a few moments while various kernel messages scroll by before you’ll see the text-based installation and configuration screen. If you’ve used Debian, this kind of text installer will feel familiar. There’s no linearity to the install process. You can move backwards and forwards through the various options, and continue to make adjustments to the installation until you quit the installer and restart the system.

For a basic, working environment, you will need to do at least the following. Select the second option in the menu to initiate a ‘Standard Install’ and read the information on the screen that follows. The next page displays ‘fdisk’, the disk partitioning and formatting tool. Press F1 for documentation, but if you’re using your entire hard drive for this installation, press ‘a’ to select everything, followed by ‘q’ to apply the changes. This will delete everything currently on the drive, so be careful.

The next page will ask if you want to install a boot loader, which is the menu that lets you choose between whatever operating systems you have installed. Choose the second option (BootMGR), and on the following page, you need to create the various partitions used by FreeBSD using the same fdisk-like interface we’ve just seen.

Once again, if you’re using an entire drive for the installation, you can just press ‘a’ to let the installer create the most appropriate array of partitions followed by ‘q’ to make the changes permanent.

The next page will ask you to choose a distribution. Unlike a Linux distribution, FreeBSD uses the term to refer to the default selection of packages that are to be installed. Select ‘Custom’ and add ‘base’ and ‘kernels > GENERIC’ to your installation.

This will give you enough package to get a working system, and we’ll need to add the desktop environment at a later stage. Return to the ‘Exit’ option at the top of the list and press space to jump into the package installation routine.

Step 3: Post-Install

After all the preliminary configuration has completed, you’ll be asked whether you want to configure any Ethernet or SLIP/PPP devices. Select ‘Yes’ if you are connecting to the internet through your machine’s ethernet port, and you should see your adaptor listed in the top of thew connections list. Choose the adaptor, say no to IPV6, say yes to DHCP and skip through the configuration page to the OK button. Say ‘no’ to your machine being a network gateway,’no’ to enabling any inetd services or running SSH, FTP and NFS server and clients, and don’t edit the console settings. You can safely setup a timezone for your machine and enable the PS2 mouse emulation if you’re using one.

Don’t worry too much about your initial selection of packages. You can easily add more later.

Say ‘Yes’ to the next question, and you’ll now be looking at the package manager. This is where you choose what applications you want to be installed on top of the default option we chose earlier, and there are thousands of packages to choose between. For a simple setup, jump into the ‘x11’ menu and select the ‘kde4-4.3.1′ package. It’s exact name will depend on the version of FreeBSD you’re playing with. If you’re not a fan of Gnome, you could also choose ‘gnome2-2’ from the same list of packages. Selecting either will also mark their dependencies for installation. You also need to select xorg-7, and any other packages you know you’re going to need.

When you’re ready to go, jump back to the top package list, select ‘Install’ and press space. You’ll need to wait a while for all the packages to install. The next step is to create a user account. You can do this by saying ‘Yes’ to the option, then selecting ‘Add User’, and entering a user name in the page that follows. Select OK to make the change permanent and exit from the users and groups menu. You’ll then be asked for the system manager’s password, and you’ll need to type this twice.

After that, you can say ‘No’ to the post-install configuration request and wait for your machine to reboot. You’re now at the point where you should have a basic, working installation, and you can quit from the installation menu and restart your system.

Step 4: Configuration

When your machine re-appears, you’ll be greeted by the sombre monochrome of the command line. Login as ‘root’ with your system manager’s password. For both Gnome and KDE, you need to add the following two lines to the ‘/etc/rc.conf’ configuration file:

dbus_enable="YES"
hald_enable="YES"

Unfortunately, you’re going to need to use the ‘vi’ text editor. Type ‘vi /etc/rc.conf’ to load the file. Press ‘i’ to enter insert mode, move to a new line and type the following. Press escape to exit insert mode, followed by ‘:wq’ (without quotes) to save the changes and quit the editor. Next type ‘reboot’ to restart your system.

FreeBSD doesn’t come with a desktop activated by default, but it’s simple enough to change.

When you get back to the login screen, enter your user account details this time, and when you get dropped back to the command line, type ‘vi .xinitrc’ and add the following line to the file:

exec /usr/local/kde4/bin/startkde4

This is telling your system that when the X.org graphical system starts, you want KDE to be used as your desktop environment. Save and exit vi.

Step 5: Launch Desktop

Usually, at this point, you need to create an ‘xorg.conf’ file to define the display properties for your machine. But recent releases of the X server are able to create a working configuration without any further editing. Which means typing ‘startx’ is all you need to do to launch a graphical environment running KDE. If this doesn’t work, then you will need to create create a working /etc/X11/xorg.conf file.

But with FreeBSD 8, it’s more likely that you are now looking at KDE running through its Akanadi porting routines as it builds up a configuration for your desktop. After a couple of minutes, this will leave you with a KDE desktop running on-top of FreeBSD, and you’ve just earned another trophy for your awards cabinet.

At long last: a GUI! And one of the more stable interfaces you’ll find. Here’s hoping BSD serves you well.

This is exactly the same KDE you’ll find on Linux, and you’ll be hard pressed to find any difference between the way it works on FreeBSD and the way it works with Kubuntu. It’s only when it comes to system configuration that you’ll notice because FreeBSD doesn’t have any graphical configuration tools, which means if you need to change anything, you’ve got to be prepared to go back to the command line. But that’s another story.

See also: PC-BSD 8.0

If you’ve followed the main text to install a shiny new version of FreeBSD, you might have noticed that the install mechanism really wasn’t all that shiny or new. It reality, it feels ancient. But this doesn’t mean that the operating system has been languishing unloved and undeveloped, it just means that making the installer easier to use is low on the priority list.

Fortunately, this being open source, demand for a better way of doing things has led to several alternatives, the best of which is PC-BSD, which you’ll find at www.pcbsd.org. It does several impressive things. Firstly, it replaces the tepid monochrome installer of FreeBSD with a graphical application much-more in-line with its Linux counterparts. It will also automatically install and configure a recent version of the KDE desktop, which should mean you can get productive with a FreeBSD system as quickly as possible, without touching the command line, and there’s a wonderful wiki full of helpful documentation.

This means you can install PC-BSD by placing the disc in the drive, rebooting your machine, answer the questions that appear and wait for the operating system to install. You won’t even need to worry about manually partitioning your drive unless you want to create a custom configuration.

Another important difference is that it PC-BSD doesn’t use the same package management as FreeBSD, although you can still get to it if you need to. Instead, package are available as single files with the ‘.pbi’ file extension, which can then me installed with a simple click. It’s more like how packages are handled on OS X, and is far better than the weird world of dependencies you find on Linux.

May 25

Despite being an open-source stalwart, I’m ashamed to admit that I’ve always had something of a love-hate relationship with Apple. In the ’80s, I owned – and still do own – an original Apple IIe along with a real hard drive and two 5.25in floppy drives. It was inherited from the video shop that I worked in, and I put it and its immense customer database to all kinds of nefarious uses. But eventually I moved on to the upland pastures of colour displays, 880kB of storage on a 3.5in disk and four-channel sound. All thanks to Commodore.

In the ’90s, Apple’s expensive and closed hardware meant that an upgrade was never on the cards. This was now the world of Windows, of cheap hardware and modular upgrades. It was the time when Microsoft solidified its dominance, and the time that many of us were looking for a more open alternative. Developing applications on Windows was expensive, especially if you wanted to share the source code. That left us with only one option: Linux. And I’ve never looked back.

But I’ve continued to follow, and occasionally invest in, the progress of Apple, especially in recent years. The move to Intel and a BSD-based operating system has made OS X eminently more hackable, and Linux-
based open-source applications are far easier to build and port to OS X than they are to Windows. This has helped make the venerable MacBook Pro one of the most common laptops in use at open-source and Linux conventions, despite Apple’s obsessive control of the hardware. Apple, for many, has become an acceptable compromise for those who believe in free software but still want a machine that can resume from hibernation without the need to build a custom kernel.

But it’s the iPhone, and now the iPad, that has built a brick wall of division between what most of us are willing to ignore, and what Apple hopes will become their ultimate cash cow. Both are the result of a singular, draconian vision, the antithesis of what the open-source community represents. This isn’t a bad thing in itself, especially when the results leave a lot of free software products wanting. The interfaces of iPhone apps tend to be refined, simple and intuitive. The apps are consistent, responsive and cheap. Our parents could use an iPad without fear of viruses, malware and updates. For almost all the same reasons I’ve been telling them to switch to Linux, they can now switch to Apple for about the same cost.

But doing so is a pact with the devil, because you’re forgoing technical complexity in exchange for loss of freedom. This is the reason for Richard Stallman’s GNU manifesto. And while there’s little doubt that Apple’s enforced gateway to new applications has helped to make it a success, it’s this subtle trade of simplicity for complicity that is perhaps the biggest threat to free software in 10 years.

My fears were proven when Apple recently changed clauses 3.3.1 and 3.3.2 in its developer’s agreement, stopping programmers linking to third-party APIs. Its motivation may have been to halt apps using Adobe’s new Flash-based building tools, but it could also stop applications using open source-based frameworks such as MonoTouch and SDL. Apple refuses to clarify what will and will not be allowed through its vetting procedure. Presumably Electronic Arts games will still be allowed to use the LUA scripting engine, for example, while many independent developers aren’t going to know whether their approach is acceptable until they submit their app for review.

This type of business plan shows the very worst of what closed-source development has to offer, and exactly what open-source software blossomed to combat. But we can’t fight it with rhetoric and positive spin while our hardware and applications aren’t as good as those from closed systems. Public development and public scrutiny should lead to a better, more usable and more stable product. It worked for Linux servers and desktops, but it hasn’t worked for mobile devices yet. This is the challenge for free software developers.

It’s going to be tough, but this point in time probably marks the biggest opportunity for free software to prove its worth. It’s going to be a simple battle between closed, proprietary development on a single platform, and open innovation on open hardware. Open-source developers need to rise to the challenge or face a future that will be closed to collaboration, community and conscience.

Oct 16

Out of all the many things I detest, the worst is paying for items and still not owning them. With the world the way it is, I have no option but to disobey the laws of economics and open my wallet for gadgets that curb my freedom to use them to their full potential, and then pay for a dressed-up upgrade every six months. Which is why it gives me immense pleasure to report that the last bastion of exclusive hardware ownership has been breached. Open-source hardware has reached its tipping point.

If the time wasn’t ripe for this revolution, news of an open-source camera from a university wouldn’t have made it past the campus science journal. But Stanford’s Frankencamera project is popping up all over the radar. The idea is simple – take the principles of open-source software and apply them to a low-cost assimilation of off-the-shelf camera parts tied together with a Linux-based OS that’s available to everyone for modification. Forget proprietary APIs and SDKs, this is the holy grail for people that spent their school breaks soldering radios.

When (not if) this union of open hardware and software specifications trickles down to consumer-grade cameras, you’ll be able to super-size your point-and-shoot to take RAW shots, or use more pre-configured modes for shooting at night, or make use of the ability to adjust the auto-timer settings and more. Just like with open-source software, you don’t need to meddle with the innards of the camera: pick it off the shelf, connect to the internet, and fetch the wisdom of the community in a firmware upgrade. Or just order a supercharged modded version that’ll shoot under water and has a hot shoe for attaching a custom flash.

Frankencamera isn’t a lone example. The Arduino computer project started as an inexpensive prototyping system and is now accessible to electronic students worldwide thanks to dozens of clones that spawned because of Arduino’s open specs. Then there’s the RepRap self-replicating open spec 3D printer that’s 50 times cheaper than commercial alternatives. Hardware maker VIA has released a reference design for a netbook, MIT plans to do the same with its solar-powered car and there’s even an open-source graphics card under development.

So open-source hardware definitely makes sense to the garage mechanic and the independent researcher. Using non-proprietary standard hardware helps them keep their costs down. But why would traditional hardware companies want to spend money developing a new piece of hardware and then just release the specs? It’s a complete reversal of their current modus operandi.

They’d do it because open-source hardware actually presents a business opportunity for the hardware vendors. Take the example of Cisco. When a licence violation forced the company to release the specs for one of its routers, sales picked up. A dozen or so third-party firmware projects mushroomed around the router and made it do things way beyond Cisco’s wildest imagination.

In a similar vein, backup company BackBlaze has just taken open source hardware to another level. The company sells unlimited online storage for about £3. Since existing commercial storage solutions wouldn’t allow it to keep its expenses in check, it decided to assemble its own 67TB 4U storage pods. Its hard work cost it $117,000 for one petabyte (that’s 1,048,576GB) storage rack. Dell retails the same amount of storage for $826,000, Sun for $1million, and EMC for over $2.8million. You do the maths.

These are the kind of savings you need to beat the charts in the current cost-conscious market. So what does the company that has seemingly cracked the code do? Just like you’d expect, they show off with fancy cost comparison charts and stacks of storage units on their blog. Then they take a leap into the future and explain in great detail how you can copy their design! They have it all – videos, specs and wiring diagrams. They even tell you how to dampen the vibration from all the disks.

From a traditional business model point of view, BackBlaze has just committed commercial suicide. But the pointy-haired nay-sayers fail to see that by letting people work from its design, BackBlaze is offloading the R&D burden on to more people than it could ever pay for on its own. That’s something you can take to the management, and not have it thrown back in your face.

For these reasons, open-source hardware is finally on the verge of breaking through into a store near you. Depending on how they play it, far-sighted hardware vendors will receive either a pat on their back, or a slap in their face. What is certain, however, is that they can’t afford the opportunities any longer.