Monthly Archive for December, 2008

Eric Anholt: snowmageddon

I've been enjoying the snowpocalypse. The first few days were pretty fun, as with an inch or two you could bike quite well in it, yet the streets were almost empty of cars. Except for crazies who insist on passing you under any circumstance, and with minimal room to spare. Still, mostly of the time it was good, and people got a kick out of me on the brompton in the snow. Some hippies stopped, got out of their car, and asked to take a picture of me to "document their day". Sure, no problem. Then they asked if I was carrying a piece, and I was amused to find that despite selling out I can be mistaken for the kind of person who would smoke a bowl with strangers in broad daylight.


Biking in the snow.
Scaled down picture so you can't tell that my camera is angry about the soaking it got this summer/.


By Sunday morning, though, biking was pretty much out. 3" of snow or so was more than I could successfully plow through, so walking and biking were about tied in the mile or so I did getting home, and the walking was a lot less comical. So I've been walking and taking the bus/MAX since. Everybody I know is stir-crazy, frustrated by the snow, and yet I think I've been out of the house more than I usually am.


Matteo Riondato: Code tools

This is mostly a follow-up from yesterday post: ATM, to write code for my little project, I’m using Eclipse+PyDev+Subclipse+SVN on my MacBook Late 2008. These tools seem to help improving my productivity.

Matteo Riondato: Writing code when you are a theorist

Despite my involvement in the FreeBSD and FreeSBIE projects, I do not think of myself as a coder, nor a “system” guy in general. I’ve always been more attracted by theory and I followed a mainly theoretic courses path during my M.Sc. . My thesis is about theory in data mining but involves some experiments and I have to write the code for them. The day I had to write the first of these experiments, I decided Python would have been my language of choice, mostly because I wanted a language which allows fast and easy write-test-run cycles. Python gave me that.

In the last few weeks I thought about improving the way I write code: I felt I was lacking discipline and order. One of my advisors said my writing style is really formal when I write about computer theory. My code was quite the opposite. It was ugly, with no underlying design, with a lot of semantic errors, fragile and so on. I had to steer away from that development style.

I am now a little bit slower in writing code, but my code is better. It is easier to test. Easier to debug. Easier to be reused. More formally correct but easier to read. It will improve even more, I hope, now that I have a (small) project to work on every day.

Will Backman: bsdtalk168 – Michael Lauth from iXsystems

Can you believe it has been three years of BSDTalk?

News: BSDCan is now accepting proposals for talks.

Interview with Michael Lauth, CEO of iXsystems. We talk about his experiences with running a business using BSD.

File Info: 17Min, 8MB.

Ogg Link:
http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk168.ogg

Ulf Lilleengen: Setting up a zfs-only system

After loader support for ZFS was imported into FreeBSD around a month ago, I've been thinking of installing a ZFS-only system on my laptop. I also decided to try out using the GPT layout instead of using disklabels etc.

The first thing I started with was to grab a snapshot of FreeBSD CURRENT. However, I discovered that the loader doesn't support ZFS, so you have to build your own FreeBSD cd in order to install a working loader! Look in src/release/Makefile and src/release/i386/mkisoimages.sh for how to do this. Since sysinstall doesn't support setting up ZFS etc, it can't be used, so one have to use the Fixit environment on the FreeBSD install cd to set it up. I started out by removing the existing partition table on the disk (just writing zeros to the start of the disk will do).

Then, the next step was to setup the GPT with the partitions that I wanted to have. Using gpt in FreeBSD, one should create one partition to contain the initial gptzfsboot loader. In addition, I wanted a swap partition, as well as a partition to use for a zpool for the whole system.

To setup the GPT, I used gpart(8) and looked at examples from the man-page. The first thing to do is to setup the GPT partition scheme, first by creating the partition table, and then add the appropriate partitions.

gpart create -s GPT ad4
gpart add -b 34 -s 128 -t freebsd-boot ad4
gpart add -b 162 -s 5242880 -t freebsd-swap ad4
gpart add -b 5243042 -s 125829120 -t freebsd-zfs ad4
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad4

This creates the initial GPT, and adds three partitions. The first partition contains the gptzfsboot loader which is able to recognize and load the loader from a zfs partition. The second partition is the swap partition (I used 2.5 GB for swap in this case). The third partition is the partition containing the zpool (60GB). Sizes and offsets are specified in sectors (1 sector is typically 512 bytes). The last command puts the needed bootcode into ad4p1 (freebsd-boot).

Having setup the partitions, the hardest part should be done. As we are in the fixit environment, we can now create the zpool as well.

zpool create data /dev/ad4p3

The zpool should now be up and running. I then decided to create the different filesystems i wanted to have in this pool. I created /usr, /home and /var (I use tmpfs for /tmp).

Then, freebsd must be installed on the system. I did this by copying all folders from /dist in the fixit environment into the zpool. In addition, the /dev folder have to be created. For better details on this, you can follow (http://wiki.freebsd.org/AppleMacbook) At least /dist/boot should be copied in order to be able to boot.

Then, the boot have to be setup. First, boot/loader.conf have to contain:

zfs_load="YES"
vfs.root.mountfrom="zfs:data"

Any additional filesystems or swap has to be entered into etc/fstab, in my case:

/dev/ad4p2 none swap sw 0 0

I also entered the following into etc/rc.conf

zfs_enable="YES"

In addition, boot/zfs/zpool.cache has to exist in order to be able to let the zpool be imported automatically when zfs loads on system boot. To do this, I had to:

mkdir /boot/zfs
zpool export data && zpool import data

In order to make /boot/zfs/zpool.cache get populated in the Fixit environment. Then, I copied zpool.cache to boot/zfs on the zpool:

cp /boot/zfs/zpool.cache /data/boot/zfs

Finally, a basic system should be installed.The last ting to do is to unmount the filesystem(s) and set a few properties:

zfs set mountpoint=legacy data
zfs set mountpoint=/usr data/usr
zfs set mountpoint=/var data/var
zfs set mountpoint=/home data/home
zpool set bootfs=data data

To get all the quirks right, such as permissions etc, you should to a real install with making world or using sysinstall when booted into the system. Reboot, and you might be as lucky as me and boot into your ZFS-only system :) For further information, take a look at:

http://wiki.freebsd.org/ZFSOnRoot which contains some information on how to use ZFS as root, but by booting from ufs and: http://wiki.freebsd.org/AppleMacbook which has a nice section on setting up the zpool in a Fixit environment.

Update:

When rebuilding FreeBSD after this type of install, it's also important that you build with LOADER_ZFS_SUPPORT=YES in order for the loader to be able to read zpools.

Warner Losh: DLink DIR-615 Rev C1

Today I saw that Office Depot had a DIR-615 on sale for $40.00. It was a new hardware revision: C1. I took a chance that it was a new non-Ubimax based router. I'm glad I did, at least so far.

The router is based around the Atheros AR9130 CPU. This is MIPS based, so there's a good chance that I'll be able to put FreeBSD onto it. We'll see how it goes.

I'll report more when I get a chance to examine the RAM and Flash parts, as well as map out the serial port to see what is reported there. Stay tuned.

Warner Losh: More CardBus fixes

After I committed my previous set of CardBus fixes, reports came in about interrupt storms, first with 16-bit cards, and later with 32-bit cards. These have been corrected in my latest fixes. We always act the CSTS interrupt when we see it. In addition, I've changed the acking of the 16-bit ExCA register to only happen when there's a "R2" or 16-bit card in the slot. Otherwise we now skip it. Hopefilly, this will help the shared interrupt case as well by eliminating some PCI bus cycles...

The CSTS bit is interesting. It is the least well documented bit in the CardBus standard. It is unclear when it fires from reading the standard, but seems to be related to the card finishing its reset sequence. How this differs from the power-up interrupt, I'm not sure. I think we could further optimize the bring up of CardBus cards with it.

In addition, I noticed there's a READY bit in the ExCA CSC register. We're currently doing busy waits to bring up the cards, including a couple of millisecond long DELAYs. I'll have to look into the prospect of using that interrupt to get around these issues there.

Finally, I'm looking in earnest at the Alchemy Au1550 CPU for the OpenMicroServer port I'm doing. I've noticed that it uses a 16-bit PC Card interface. Maybe I'll finally need to rewrite the old PCIC driver from OLDCARD to make use of it (snagging the exca routines to make that easier). The OpenMicroServer has a CF card attached to it.

Will Backman: bsdtalk167 – DCBSDCon with Jason Dixon

News:
A bsdconferences channel has been created on YouTube.

I speak with Jason Dixon about DCBSDCon, which will take place in February 2009. For more info see www.dcbsdcon.org

File Info: 10Min, 5MB.

Ogg Link:
http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk167.ogg

Eric Anholt: excitement in X land

A couple of major milestones this week:

- DRI2 merged to intel master and server-1.6-branch.
We'll have DRI2 in this server release, seriously. We don't have DRI2 vblank-synced swaps going, but we should be able to make Mesa do its old path (wait for vblank, then ask DRM (now the xserver) to do the swap) and have people mostly happy with that. I just ran xcompmgr -c and glxgears at the same time and it was everything I thought it could be.

- DRM modesetting merged to drm-intel-next.
That means we're planning on having this working, seriously, for 2.6.29. It's ready to test today if you've got a lucky platform, with sudo modprobe i915 modeset=1, then using drmtest from the modesetting-gem branch of libdrm, or libdrm from that branch plus xf86-video-intel built against it. I hear the 2D driver needs a bit of love again after recent shakeups, but that may be unfounded rumor.

I'm doing my best to dogfood the whole mess on my development system, as we're planning on having DRI2 and GEM stable for release this month. I've got some misrendering with UXA, though things are much better today than before (Thanks Pierre Willenbrock!). 965 3D's in pretty good shape since my last fix, and I've been using it most days to play Eschalon. We've still got IRQ issues on GM965, though, as long as it's not my GM965. Plenty to keep us busy this month.

Warner Losh: Cardbus Fixes

I just checked into the tree some CardBus fixes. The biggest change was to the power-up sequence, as well as transitioning to using filters for the card change events. These two changes are somewhat intertwined, unfortunately, since the latter exposed some holes in the former. In a nutshell, we now register a filter for the card status change events. This means we can mark the card as bad right away before any additional interaction can happen to the card. We defer doing anything about the badness for a little bit (basically until the machine is idle enough for the cardbus kernel thread to run). The interlock mechanism is also much ligher weight, having moved from mutexes and CVs to simple msleeps. Fast interrupts require some care to get right, so I hope I've gotten it all right. The move is dictated by what you can and cannot do in a fast interrupt handler.

Before making these changes, my atheros card would often reset for no reason. After these changes, I've not had it reset until I started using a kernel without the changes. I'm not sure why this would make such a big difference, and I hate mysteries. They indicate that there's something I don't understand, which I also hate. I'd be interested to see if I still see this when the fully integrated code is committed and looped back (I have several trees, and I most frequently run an unmodified kernel from svn, but sometimes also run one of these trees). There's a small chance that one of my other local changes could be the cause, but given what they are it seems doubtful. Still, a good datapoint if it is.

In addition, these fixes add a retry option for the BadVcc errors that we'd see sometimes. These are annoying on some machines, and often times the best way to get around them was to reload the driver. They don't happen at all on TI based chipsets that I've seen (at least more recent ones). Instead, they were confined to the Ricoh chipsets. Since I switched my laptop a couple of years ago, I haven't seen them. These changes post-date the change, but have been tested lightly on another Ricoh laptop that I have. They've been heavily tested on the TI laptop. They are based only on the description of the problem in the NetBSD PR, since the implementations are so different for the different BSDs in this area.

Finally, I did some comment tweaking and shuffling. I also managed a style change or two. These should have absolutely no effect on the running code, but hopefully help the reader of the code understand it better. Past experience has shown that these types of commits are most likely to provoke comment, even though the other two parts of my commits are actually quite a bit more important.

Oh, why the flurry of commits? I was low on disk space, so I thought I'd go clean up. 11MB free just isn't enough. So I was looking around and discovered I still had a CVS tree and was going to blow it away. I did a final update just to see what changes I had. I'm glad I did, since I found these, and a few others. I still have more local changes there than I realized. Sometimes I guess it is good to run out of disk space and go on a cleaning spree? It also makes for smaller backups when you don't have top copy 5GB of /usr/obj and kernel build trees...

Warner Losh: Moving towards board files

I've spent a little bit of time implementing the start of board files for the arm port. The initial push has been for the at91 subport only, and many improvements could be made to this. I've written up my initial thoughts on this on the FreeBSD wiki FreeBSD Arm Boards. It could use much improvement, I'm sure.

One idea that hasn't been reflected there yet, was shown to me by Sam Laffler who suggested using linker sets to allow boards to 'probe', 'init' and other standardized functions. This is an interesting idea and I plan on working on adding it to the above links when Sam has results to share.

I'd also like to expand the above wiki page to be a 'best practices' guide for all architectures where there's great diversity of boards/cpus/etc (eg, not the homogeneous env that x86 provides).

I'm also soliciting comments on the above boards in addition to the above. Send them to me, or post them here.

Henrik Brix Andersen: Booting nanoBSD on the Alix2c2 SBC

A friend and I recently purchased a couple of Alix2c2 SBCs from PC Engines with the intention of running FreeBSDs nanoBSD on them.

However, getting nanoBSD to boot on the Alix board turned out to require a few customizations which I will post here in the hope of saving others the trouble.

The Alix2c2 reports the following at boot time for the noname 1GB CF card from PC Engines:

PC Engines ALIX.2 v0.99
640 KB Base Memory
261120 KB Extended Memory

01F0 Master 044A CF 1GB
Phys C/H/S 1966/16/63 Log C/H/S 983/32/63

Running diskinfo(8) on the CF in an USB CF card reader on another FreeBSD machine revealed the capacity of the card:

$ diskinfo /dev/da0
/dev/da0        512     1014644736      1981728 967     64      32

Gettng nanoBSD to boot on the Alix2c from the 1GB CF card required the following customizations to the nanoBSD configuration file:

# Drive geometry
NANO_DRIVE=ad0
NANO_MEDIASIZE=`expr 1014644736 / 512` # size from diskinfo(8) on the UBS CF card reader
NANO_HEADS=32 # heads from the logic CHS information at boot time
NANO_SECTS=63 # sects from the logic CHS information at boot time

# Boot loader
NANO_BOOT0CFG="-o nopacket -s 1 -m 3" # nopacket seems to be required by tinyBIOS

Before booting nanoBSD, hit ‘s’ on the Alix2c2 serial console during RAM testing and switch the BIOS to LBA mode and 9600 baud serial console (default is 38400 baud, but this wont work with boot0sio). Re-attach to the serial console with 9600 baud and reboot to verify the setup.

Matteo Riondato: On the naming of computers and its evolution

Like many geeks, I have my own style in naming the machines I have access to. This may sound strange to people not used to live between a chair and a monitor but, according to many, you may really want to give a name to the non-animated thinking being (please note the double absurd of calling something non-animated as a being and describing it as thinking) you spend much of your time with.

My naming convention has always been the same since the very beginning of my “serious” (like in UNIX) involvement in computers: using different translation of the word “emperor”. “Emperor” is one of the countless nicknames my friends gave to me in these 22 years. Since the computers were/are mine and/or administered by me, I chose to give them one of my names. Yes, a bit selfish.

My main desktop machine has always been called kaiser (German): it is a strong word with a powerful pronunciation which resembles the meaning of the word. Other machines’ names I used are czar (Russian) and empereur (French). Starting from this use of royalty names, I began using others: kadett (German for `cadet’) (my old HP Jornada 680), margravio (an old Italian word for `marquess’) (a very very old IBM PS/2 N33SX, actually one of the first computers I used and which I resurrected using FreeDOS), ambassador (not really royalty, but it fitted because it was the name of my wireless network), siniscalco (Italian for `seneschal’) (another wireless network). There is another convention which I use on my *nix machines: the following line is always present in the /etc/motd file

Welcome to Rionda's $OSNAME (with $OSNAME being usually FreeBSD, or Darwin for my laptop)

The names of my laptops don’t follow the royalty naming convention, but my first Apple iBook Firewire (named scudiero, Italian for `squire’). The second, the immortal beautiful (not really) powerful (not really) IBM Thinkpad R50e was named krapfengeist, a German word which approximately means “the spirit of donuts” =). Third, and last one, my current Apple MacBook Aluminium, whose name is no less than abulafia.

Now, let me explain this last one. One of my favourite books, together with “The Name of the Rose” and “Goedel, Escher, Bach: an Eternal Golden Braid”, is Umberto Eco’s “Foucault’s Pendulum”. I read it at least once every year, often twice a year. One of the main characters uses a computer to develop a Plan (why the capital “P”? Go read the book!) and to write personal memories. Or, as Wikipedia says, it was used “not only for word processing, but also to attempt to extract meaningful snippets from random permutations of text in a fashion reminiscent of Abraham Abulafia’s methods”. Yes, the computer’s name in the book is abulafia. I like the book and the way the computer is used in the book so much that I chose to name my own laptop after it.

There is an additional feature of the book I like to mention. It is a bit of a spoiler, so don’t read this paragraph if you want to read the book. At the very start of the book, another main character has to break into abulafia but he doesn’t know the password. When the machine is started, the following message is printed on the screen:

Do you have the password?

After having tried many times using numbers, names, permutations of the name of God (ihaveh) (the book even describes a program to generate the 720 permutations), the hacker is tired and lost:

Do you have the password?   no

He types “no”. And he is logged in. “no” was the password. I find this brilliant. It makes sense with everything. I cannot explain why here: I would spoil the whole plot.
Read the book.

And give a name to your computer. It deserves it.

As bonus, you get the /etc/motd from my laptop:

Welcome to Rionda's Darwin

Do you have the password? no
Umberto Eco - "Foucault's Pendulum"

P.S. Nice geekish post, isn’t it?

Warner Losh: Cassio Fiva’s screen dead

I was very fortunate enough to get a Casio Fiva MCP-205 given to me in 2000. I've used this laptop for years. I built Mozilla on it once, and melted the frame around the LCD! This resulted in a new warning in the Mozilla build instructions. Since Casio is a Japanese company, and I got this as the result of my contacts in Japan at the time, my news of melting the Fiva spread like wild fire there. Recently, when I was in Tokyo for AsiaBSDCon people were asking me about it.

I've been using this laptop to do background builds, as a mobile terminal, firewire debugging platform, etc since I got it. Recently, i had put the laptop on the shelf. I'd not used it in the past 6 months or so for a variety of reasons. Last night I thought I'd give it a spin again, since I need a nice mobile platform. Sadly, while it was in storage the screen was cracked. I cannot get any text on the screen at all. I don't have the VGA cable so I could keep this laptop around as a server, since there's no console access. I cannot find an LCD to replace it, but I imagine that it would be expensive. More expensive than a modern netbook, which would be better for the FreeBSD project anyway...

It is sad to see this laptop give up the ghost. Every time I used it, I was reminded of the good times in Japan. I'll hang onto the laptop for a little while on the off chance I can turn up a replacement LCD, but I fear it is dead.