Switching from MySQL to MariaDB

This blog started life on MySQL 4.x & continued to live on 5.0 until today. Whilst performing maintenance, all the packages came up to date apart from two, the MySQL 5.0 client & server which had been long removed.
I was about to commence with installing version 5.5 when I remembered a conversation I had a couple of weeks back about MariaDB, after a quick check to see what the switchover entailed, I decided to install to MariaDB instead.
It’s intended to act as a drop in replacement for MySQL, my instance has been for serving blogs & other fairly common 3rd party open source software so I didn’t have to do much apart from run mysql_upgrade after install.
In /var/db/mysql/server.example.com.err MariaDB logged
Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50084, now running 50312. Please use mysql_upgrade to fix this error. to highlight the fact.

mysql_upgrade output:
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Processing databases
mydb.wp_commentmeta Needs upgrade
mydb.wp_comments OK
mydb.wp_links OK
mydb.wp_options OK
mydb.wp_postmeta OK
mydb.wp_posts OK
mydb.wp_term_relationships OK
mydb.wp_term_taxonomy OK
mydb.wp_terms OK
mydb.wp_usermeta OK
mydb.wp_users OK
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category Needs upgrade
mysql.help_keyword Needs upgrade
mysql.help_relation OK
mysql.help_topic Needs upgrade
mysql.host OK
mysql.proc Needs upgrade
mysql.procs_priv OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name Needs upgrade
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_topic OK
mysql.proc OK
mysql.time_zone_name OK
Phase 3/3: Running 'mysql_fix_privilege_tables'...

I decided to recreate my.cnf using the files shipped with MariaDB due to the introduction of new settings and a difference in values for existing settings.

12″ PowerBook G4 PT 4

Due to various factors, I’ve not had much of a chance to play with the PowerBook much this month, earlier this moth a follow up to PR/48740 happened, requesting feedback on new changes which had been committed that I’ve not had a chance to test yet.
One thing I did do tonight was to re-flash the SuperDrive with a RPC-1 firmware image which turns the DVD drive region-free.
The firmware images are hosted on MacBook.fr and cover Macs all the way back to G3’s.
Flashing was straightforward though I could only re-flash with the version currently on the drive. It was not possible to flash a newer stock or region-free image on the drive.
Aside from the firmware on the DVD drive, Mac OS also tries to enforce region locking, the Region X utility can reset the Mac OS related setting regarding content region.

Building CoovaChilli on FreeBSD 10 & newer

I’ve been working on getting CoovaChilli running on FreeBSD 10 the past few weeks. The first problem was that the source code would not build. FreeBSD 10 shipped with clang instead of GCC as the default compiler which is not as forgiving as GCC, clang flagged up lots of issues with the code base such as lack of parameters for functions, one change needed which was a shortcoming of clang itself was the lack of support for nested functions.
The other problem was that CoovaChilli was using a structure that had been marked as deprecated in Net/Free/OpenBSD/Darwin for quite some time & with the release of 10.0, FreeBSD removed this structure from their codebase. This resulted in the tun(4) interface being initialised but no IP address being assigned to it, which was interesting, dhcp responses were still going out but obviously nothing could talk back to the IP address that coova was configured to be listening on (uamlisten).

All BSDs & derivatives were separated out from Linux in dev_set_address(), Linux was set to use the pre-existing method & the BSD & derivatives were switch to use the “new” ifaliasreq structure.

With these change, it’s possible for a client connected to a router running CoovaChilli to visit sites listed in uamallowed. These are sites which CoovaChilli allows to be browsed without needing authentication through the captive portal first. Next stage is to get the captive portal running along with a RADIUS server so that the previous revision of the setup guide can be updated. With the release of FreeRADIUS 3 configuration has changed somewhat, hence the old documentation for version 2 doesn’t necessarily apply.

These changes so far only allow the code to build without any features enabled, for example, enabling OpenSSL support yielded more errors which have not been fixed yet & I suspect others will show up as more options are switched on.

The work so far can be found here

Merged 3/6/2014

12″ PowerBook G4 PT 3

Since I last posted about dealing with pkgsrc on my PowerBook earlier this week, a patch has been committed which solves the linker issue on lang/gcc45 along with another fix related to how stripping of binaries is handled on Darwin. Unfortunately PR/48740 mentioned gcc44 to 46 suffer from the same issue but the patch has not been applied to gc44 or 46, I’m waiting to hear back from the committer.
One thing I forgot to mention in the previous post is that there is another issue with build process for GCC. There appears to be a deadlock issue where sh sits there chewing up CPU & context switching, at this point, aborting the build with & restarting again allows the build to continue.
Attaching to sh with gdb does not give any further insight as to what’s going on 🙁

Revisiting the NeXT icon set for Mac OS X

As I have a system running Mac OS X Tiger, I thought I’d give the NeXT icon set a try again, nearly all sites hosting the components required have now all shut down, thankfully for the Internet Archive copies were saved.
You can obtain a copy of ShapeShifter from here
I’d mirrored the eXec theme which is now unfetchable because it was available as a download from within ShapeShifter. Download, uncompress & rename eXec.guikit to eXec.guiKit before opening.
My NeXT icon set is available here
The original NeXT theme is available from here.
The NeXT icon set applied to Tiger
NeXT icons

NeXT icon set & eXec theme
NeXT eXec

NeXT icon set & NeXT 2.0 themeNeXT Icon set & NeXT 2.0 theme

Everything seems ok on Mac OS X 10.4.11 apart from Safari which causes the original OS X skin to display on the menu bar when it’s the active application.

Apple’s Darwin according to GCC

From gcc’s target definitions for Darwin (Mac OS X) systems

/* The definitions in this file are common to all processor types
running Darwin, which is the kernel for Mac OS X. Darwin is
basically a BSD user layer laid over a Mach kernel, then evolved
for many years (at NeXT) in parallel with other Unix systems. So
while the runtime is a somewhat idiosyncratic Mach-based thing,
other definitions look like they would for a BSD variant. */

/* Although NeXT ran on many different architectures, as of Jan 2001
the only supported Darwin targets are PowerPC and x86. */

/* One of Darwin's NeXT legacies is the Mach-O format, which is partly
like a.out and partly like COFF, with additional features like
multi-architecture binary support. */

Issues with V6 UNIX

From the article Bringing up V6 Unix on the Ersatz-11 PDP-11 Emulator

V6 as distributed is strictly a 20th Century operating system. Literally. You can’t set the date to anytime in the 21st century, for two reasons.
First, the ‘date’ command only take a 2-digit year number. Second, even if you fix that, the ctime() library routine has a bug in it that makes it stop working in the closing months of 1999. (IIRC, it is that the number of 8-hour blocks since the epoch – January 1, 1970 – overflows a 15-bit integer at that point. ‘Vanilla’ V6 C doesn’t have unsigneds.)

I have ‘fixed’ copies of date.c and ctime.c; here and here. You can download them and install them; ctime.o goes in /lib/libc.a:

ar r /lib/libc.a ctime.o
The ‘date’ command has been extended to support 2- and 4-digit year numbers (to be upwardly compatible, the 2-digit ones assume 19xx). It has also been extended (for forgetful people like me 🙂 so that if you type:
date -
it will tell you what order the arguments go in.
The ‘fix’ in ctime() is really kludgy – sorry, I was in a hurry! It will also break in another 15 years or so (when the number of 8-hour periods overflows 16 bits). Someone else can fix that one!

12″ PowerBook G4 PT 2

As I wrote the previous post, the PowerBook was attempting to compile lang/gcc48 from pkgsrc & since then I’ve still been attempting to build lang/gcc48 with varying levels of success which led me to branch out from trying to build GCC 4.8 to the other 4.x releases on pkgsrc.

In-between roasting the PowerBook I managed to obtain a re-writable CD, that allowed me to install OpenBSD on the PowerBook. Everything went smoothly apart from some bug with installer/documentation. The OpenBSD install was short-lived as I swapped the 5400RPM HDD for an 64GB SSD, the empty partition is there ready for reinstall but the GCC builds have consumed most of the time with the computer so I’ve not got around to reinstalling on the new disk.


Capacity: 59.63 GB
Model: TS64GPSD330
Revision: 20140121
Serial Number:
Removable Media: No
Detachable Drive: No
BSD Name: disk0
Protocol: ATA
Unit Number: 1
Socket Type: Internal
OS9 Drivers: No
S.M.A.R.T. status: Verified
Macintosh HD:
Capacity: 41.5 GB
Available: 26.21 GB
Writable: Yes
File System: Journaled HFS+
BSD Name: disk0s3
Mount Point: /

The laptop is now running with 1.25GB of RAM which has made a big difference, more than the SSD did, though the change is mainly visible in the apple supplied application binaries e.g System Preferences or Activity Monitor which don’t bounce on the dock whilst loading, click & it’s there, running.
About This Mac 1.25GB RAM
Trying to install a newer version of GCC from pkgsrc has been quite painful, build attempts are taking up to 20+ hours before failing, depending on which languages / options are enabled.

I reverted to attempting to building with only C & C++ language support to speed up the time to success/fail. This reduced the build time down to 8-10 hours, it then became apparent (a little quicker) that all GCC 4.x releases in pkgsrc fail to build on Mac OS X Tiger.
GCC 4.4 was the easiest to fix as the only thing that prevented the build of the C/C++ language support was a space between the -I flag & the path to headers to include which caused the linker to complain, this issues is taken care of in lang/gcc47 & gcc48 but the fix wasn’t retroactively applied to previous releases.
Attempting to build with GCC 4.5 & newer revealed further issues.
Thanks to the maintainer of TigerBrew, Misty De Meo who was able to provide hints for issues that need to be addressed in-order to build a more recent version of GCC on Tiger, having gone through the same problems when adding support in TigerBrew.

I’m not sure how many iterations other builds use but on pkgsrc gcc is built with 3 iterations of tests where binaries generated are compared at each iteration. The tests would fail on the third iteration, forcing dwarf2 format for debug data allowed the tests to succeed. As the G4 is a 32-bit PowerPC CPU, the build then failed when it came to 64-bit binaries, disabling multilib support resolved this issue, the build then failed as the linker & assembler bundled with XCode 2.5 were too old & missing functionality. Bug 52482 covers this issue.

gmake[4]: Entering directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libstdc++-v3' true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CC_FOR_TARGET=/usr/pkgsrc/lang/gcc48/work/build/./gcc/xgcc -B/usr/pkgsrc/lang/gcc48/work/build/./gcc/" "CFLAGS=-g -pipe -O2 -I/usr/pkg/include -I/usr/include" "CXXFLAGS=-g -pipe -O2 -I/usr/pkg/include -I/usr/include" "CFLAGS_FOR_BUILD=-pipe -O2 -I/usr/pkg/include -I/usr/include" "CFLAGS_FOR_TARGET=-g -pipe -O2 -I/usr/pkg/include -I/usr/include" "INSTALL=/usr/bin/install -c -o root -g wheel" "INSTALL_DATA=/usr/bin/install -c -o root -g wheel -m 644" "INSTALL_PROGRAM=/usr/bin/install -c -s -o root -g wheel -m 755" "INSTALL_SCRIPT=/usr/bin/install -c -o root -g wheel -m 755" "LDFLAGS=-L/usr/pkg/lib" "LIBCFLAGS=-g -pipe -O2 -I/usr/pkg/include -I/usr/include" "LIBCFLAGS_FOR_TARGET=-g -pipe -O2 -I/usr/pkg/include -I/usr/include" "MAKE=/usr/pkg/bin/gmake" "MAKEINFO=/usr/pkgsrc/lang/gcc48/work/.tools/bin/makeinfo --split-size=5000000 --split-size=5000000 " "SHELL=/bin/sh" "RUNTESTFLAGS=" "exec_prefix=/usr/pkg/gcc48" "infodir=/usr/pkg/gcc48/info" "libdir=/usr/pkg/gcc48/lib" "includedir=/usr/pkg/gcc48/include" "prefix=/usr/pkg/gcc48" "tooldir=/usr/pkg/gcc48/powerpc-apple-darwin8" "gxx_include_dir=/usr/pkg/gcc48/include/c++/" "AR=ar" "AS=/usr/pkgsrc/lang/gcc48/work/build/./gcc/as" "LD=/usr/pkgsrc/lang/gcc48/work/build/./gcc/collect-ld" "RANLIB=ranlib" "NM=/usr/pkgsrc/lang/gcc48/work/build/./gcc/nm" "NM_FOR_BUILD=" "NM_FOR_TARGET=nm" "DESTDIR=" "WERROR=" DO=all multi-do # /usr/pkg/bin/gmake gmake[4]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libstdc++-v3' gmake[3]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libstdc++-v3' gmake[2]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libstdc++-v3' Checking multilib configuration for libitm... gmake[2]: Entering directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm' /usr/pkg/bin/gmake all-recursive gmake[3]: Entering directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm' Making all in testsuite gmake[4]: Entering directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm/testsuite' gmake[4]: Nothing to be done for 'all'. gmake[4]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm/testsuite' gmake[4]: Entering directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm' /bin/sh ./libtool --mode=compile /usr/pkgsrc/lang/gcc48/work/build/./gcc/xgcc -B/usr/pkgsrc/lang/gcc48/work/build/./gcc/ -B/usr/pkg/gcc48/powerpc-apple-darwin8/bin/ -B/usr/pkg/gcc48/powerpc-apple-darwin8/lib/ -isystem /usr/pkg/gcc48/powerpc-apple-darwin8/include -isystem /usr/pkg/gcc48/powerpc-apple-darwin8/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.8.2/libitm -I../../../gcc-4.8.2/libitm/config/powerpc -I../../../gcc-4.8.2/libitm/config/posix -I../../../gcc-4.8.2/libitm/config/generic -I../../../gcc-4.8.2/libitm -Wall -Werror -Wc,-pthread -g -pipe -O2 -I/usr/pkg/include -I/usr/include -MT sjlj.lo -MD -MP -MF .deps/sjlj.Tpo -c -o sjlj.lo ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S libtool: compile: /usr/pkgsrc/lang/gcc48/work/build/./gcc/xgcc -B/usr/pkgsrc/lang/gcc48/work/build/./gcc/ -B/usr/pkg/gcc48/powerpc-apple-darwin8/bin/ -B/usr/pkg/gcc48/powerpc-apple-darwin8/lib/ -isystem /usr/pkg/gcc48/powerpc-apple-darwin8/include -isystem /usr/pkg/gcc48/powerpc-apple-darwin8/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.8.2/libitm -I../../../gcc-4.8.2/libitm/config/powerpc -I../../../gcc-4.8.2/libitm/config/posix -I../../../gcc-4.8.2/libitm/config/generic -I../../../gcc-4.8.2/libitm -Wall -pthread -Werror -g -pipe -O2 -I/usr/pkg/include -I/usr/include -MT sjlj.lo -MD -MP -MF .deps/sjlj.Tpo -c ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S -fno-common -DPIC -o .libs/sjlj.o ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S:155:Invalid mnemonic 'FUNC' ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S:250:Invalid mnemonic 'CALL' ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S:259:Invalid mnemonic 'END' ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S:262:Invalid mnemonic 'HIDDEN' ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S:263:Invalid mnemonic 'FUNC' ../../../gcc-4.8.2/libitm/config/powerpc/sjlj.S:407:Invalid mnemonic 'END' Makefile:496: recipe for target 'sjlj.lo' failed gmake[4]: *** [sjlj.lo] Error 1 gmake[4]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm' Makefile:697: recipe for target 'all-recursive' failed gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm' Makefile:360: recipe for target 'all' failed gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build/powerpc-apple-darwin8/libitm' Makefile:16624: recipe for target 'all-target-libitm' failed gmake[1]: *** [all-target-libitm] Error 2 gmake[1]: Leaving directory '/usr/pkgsrc/lang/gcc48/work/build' Makefile:889: recipe for target 'all' failed gmake: *** [all] Error 2 *** Error code 2 Stop. bmake: stopped in /usr/pkgsrc/lang/gcc48 *** Error code 1

Apple provides updates as part of their open source initiative, cctools contain the as & ld sources but sadly with the move to intel & the startup of the Hackintosh scene Apple has made it a little difficult to build things, their first move was to stop generating the iso of Darwin builds & the documentation seems non-existent now. Funnily enough the legacy information on the iPhone jailbreak & Hackintosh scene seems to be the commonly available documentation, that is ofcourse after you’ve excluded bug reports from fink & mac/darwinports in your search results. The main problem with building the open-source components is the bespoke build mechanism which seems to have various issues with Mac OS X, mainly missing header files, with TigerBrew, they seem to work around this issue by using the headers from a newer version of OS X. Through my search for a solution I discovered the OpenDarwin project, the project repackaged the source for the open source Apple components around the GNU toolchain. A version is available in pkgsrc in emulators/darwin_lib though it’s intended for NetBSD/PowerPC to provide binary compatibility, sadly the version it attempts to build is older than the version available with XCode 2.5. The OpenDarwin site is broken & the project doesn’t appear to be in development but I was able to find a repository on Apples MacOS Forge for the OpenDarwin cctools which contained the cctools-758. This was sufficient to allow GCC 4.x to build successfully, AS & AS_TARGET variables need to be set to where the new version of as(1) installed from odcctools however. GCC 4.7 built successfully with C, C++, Fortran, Objective C, Objective C++ & Fortran support. The code is in a SVN repository, you can obtain precompiled binaries of old versions of svn from collab.net.
Using built-in specs. COLLECT_GCC=/usr/pkg/gcc47/bin/gcc COLLECT_LTO_WRAPPER=/usr/pkg/gcc47/libexec/gcc/powerpc-apple-darwin8/4.7.3/lto-wrapper Target: powerpc-apple-darwin8 Configured with: ../gcc-4.7.3/configure --enable-languages='c obj-c++ objc java fortran c++' --enable-shared --enable-long-long --with-local-prefix=/usr/pkg/gcc47 --enable-libssp --enable-threads=posix --with-boot-ldflags='-static-libstdc++ -static-libgcc -L/usr/pkg/lib ' --with-dwarf2 --disable-multilib --disable-nls --with-gmp=/usr/pkg --with-mpc=/usr/pkg --with-mpfr=/usr/pkg --with-ecj-jar=/usr/pkgsrc/distfiles/ecj-4.5.jar --enable-java-home --with-os-directory=darwin --with-arch-directory=powerpc --with-jvm-root-dir=/usr/pkg/java/gcc47 --with-java-home=/usr/pkg/java/gcc47 --with-system-zlib --enable-__cxa_atexit --with-gxx-include-dir=/usr/pkg/gcc47/include/c++/ --with-libintl-prefix=/usr/pkg --prefix=/usr/pkg/gcc47 --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --infodir=/usr/pkg/gcc47/info --mandir=/usr/pkg/gcc47/man Thread model: posix gcc version 4.7.3 (GCC)
While attempting to get things to build, lang/gcc48 was updated in pkgsrc and languages were separated out to individual packages with gcc48 becoming a wrapper around this, these changes are very much in their infancy and have issues which need to be addressed. As it currently stands, it’s not possible to build individual languages as there is ties which need to be removed e.g attempting to build lang/gcc48-cc++ will build in lang/gcc48-fortran. For me, the next step is to get these changes prepared correctly & submitted for inclusion in pkgsrc, for the duration of getting things to run I hard coded the paths for as(1) & defined the configure arguments globally, where as these changes are specific to Tiger & prior / 32-bit PowerPC specific. Then there’s dealing with odcctools, I’m not sure if it will require a new package or emulators/darwin_lib should be extended. emulators/darwin_lib introduces more than just odcctools hence my leaning towards a separate package. I also want to try out building from a RAM disk using Make RAM disk to see if build can be sped up any further. Since I wrote the previous article I found out how to set the location in F.lux, thanks to co-developer of F.lux, Michael Herf

It seems that some people opt to cross-compile for OS X on another platform, including macports developers (sorry, I didn’t make a note of the bug report where the developer explained building packages on Linux). iTerm 0.10 from the original project is now my terminal emulator with the Inconsolata font, the font smoothing isn’t that great on this machine when using white text on black background so I’ve opted for the opposite here & it’s working out well.
There is a MAC POWERPC ? blog which provides regular articles. I found an article on how to rebuild the PowerBook battery with new cells if it should fail.

Following the instructions from floodgap.com to update the curl-ca-bundle bundled with OS X I discovered that the version included in Tiger was from 2000!!

/usr/share/curl/curl-ca-bundle.crt - Last Modified: Thu Mar 2 09:32:46 CET 2000, These were automatically extracted from Netscape Communicator 4.72's certificate database (the file `cert7.db')

Building RetroBSD on Mac OS X

Earlier this week it was announced on the RetroBSD forum that the official repository had moved to GitHub. Along with the move came changes which fixed previous issues with the build so now it is possible to build a RetroBSD image on Mac OS X.

As covered in the RetroBSD installation document, I installed the required dependencies from MacPorts & used the prebuilt PIC32 toolchain to build RetroBSD.

port install bison byacc flex libelf

The compiler was uncompressed to /usr/local to keep it inline with the code base & reduce the number of changes need to get thing to build.

I’d previously installed the command line tools from within Xcode, while this had installed clang & the rest of the toolchain into /usr, I was missing /usr/include, installing the command line tools manually with xcode-select --install fixed this.

Kernel built from the SVN code base on Google Code:
2.11 BSD Unix for PIC32, revision 892M build 2:
Compiled 2014-03-29 by xxx@xxx:
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: XT crystal, PLL div 1:2 mult x20
console: tty0 (5,0)
sd0: port SPI2, select pin C14
sd0: type SDHC, size 15339520 kbytes, speed 13 Mbit/sec
phys mem = 128 kbytes
user mem = 96 kbytes
root dev = rd0a (0,1)
root size = 102400 kbytes
swap dev = rd0b (0,2)
swap size = 2048 kbytes
temp0: allocated 30 blocks
/dev/rd0a: 588 files, 8752 used, 93247 free
temp0: released allocation
Starting daemons: update cron

2.11 BSD UNIX (pic32) (console)

Kernel built from the git code base on GitHub:
2.11 BSD Unix for PIC32, revision G38 build 1:
Compiled 2014-04-19 by xxx@xxx:
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: XT crystal, PLL div 1:2 mult x20
console: tty0 (5,0)
sd0: port SPI2, select pin C14
sd0: type SDHC, size 15339520 kbytes, speed 13 Mbit/sec
phys mem = 128 kbytes
user mem = 96 kbytes
root dev = rd0a (0,1)
root size = 102400 kbytes
swap dev = rd0b (0,2)
swap size = 2048 kbytes
/dev/rd0a: 588 files, 8752 used, 93247 free
Starting daemons: update cron

2.11 BSD UNIX (pic32) (console)

12″ PowerBook G4

PowerBook G4
With the talk on Twitter & App.net about old computers I started to get nostalgic. I had cleared out most of my collection back in 2012 & been resisting the urge to resume hoarding again largely, having successfully put off the purchase of a Ubiquiti EdgeRouter Lite to run FreeBSD on, I remembered that I was offered a G4 PowerBook a few months back which I turned down. It was still available if I wanted to take it, which made very happy. a 12″PowerBook6,4 that I’d assumed it was going to be a 15″ model. I’ve been playing about with it for the past couple of days, wiping the pre-installed copy of Leoapard & going through the Panther to Tiger path.

The system is now running 10.4.11, patching was a lot of fun, java update after java update, pretty sure it didn’t seem that bad at the time.
It was interesting to see that there was no iTunes update made available, having to manually fetch v9.2.1 from kb DL1056. Safari was updated to v4.1.3.

With no more updates on offer from the software update facility I disabled the java & macromedia plugins by moving them out of /Library/Internet Plug-ins & /Library/Application Support.

Going back to Tiger was a mixture of pleasure & pain, visually, I much prefer the brighter white look of aqua, as opposed to the grey theme which introduced in Leopard. Terminal.app in Tiger is not that great, font smooth is particularly poor, I may have to resort to sourcing a copy of the original iTerm. Plan9 from userspace built without issues using gcc from XCode 2.5, but I guess finder doesn’t like something about the bundled transparent icon of Glenda on the dock as it shows up with a white background & though acme launches correctly, the icon continues to bounce on the dock.
F.lux 1.1 is the last supported PowerPC build which runs on Tiger, no support for UK in location settings of this build.
TenFourFox takes the place of Firefox as an up to date, maintained version for the PowerPC Mac’s. Python was updated to 2.7.6 using a package straight from python.org.

There is a PowerPC Software site, which contains links to the last builds of popular software which supported the PowerPC Mac’s.

Mercurial & Ruby built successfully from source, pkgsrc also bootstrapped without any issue, the system is currently building GCC 4.8 from pkgsrc.
Needed to declare MACOSX_DEPLOYMENT_TARGET=10.4 otherwise the build process would fail with ld: flag: -undefined
dynamic_lookup can't be used with MACOSX_DEPLOYMENT_TARGET environment
variable set to: 10.1

The system currently has 512MB of RAM & a 74GB HDD, 40GB allocated to OS X & the remaining intended for use with OpenBSD, will have to netinstall OpenBSD as I don’t have any blank CD’s with me, no USB hub, the USB ports don’t provide sufficient power to run a Zalman Virtual CD and I suspect the system is unable to boot from USB anyway. Been looking on Amazon for IDE SSD drives but probably will increase the RAM first.


RetroBSD on chipKIT Max32 with Arduino Ethernet shield

I bought myself one of these boards to play with RetroBSD a few months back but with build issues & other distractions in real life I didn’t get very far because the stock MAX32 kernel configuration is for SD card slots wired to the board whereas I was trying to use the SD card slot on an ethernet shield. This resulted in the kernel not being able to detect the SD card, hence no root file system. I’d use prebuilt binaries without trying to build my own but for some reason there is no prebuilt kernel image for the configuration I require. Finally, tonight I managed to get a MAX32-ETH kernel built & flashed onto the board, still unable to build the userland but I was able to get an older prebuilt image from the RetroBSD Autobuild Server which currently has images for build 860 & 778.

Will follow up once I have everything building from scratch.
Building RetroBSD on Mac OS X

2.11 BSD Unix for PIC32, revision 892 build 1:
Compiled 2014-03-29 by xxx@xxx.xxx:
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: XT crystal, PLL div 1:2 mult x20
console: tty0 (5,0)
sd0: port SPI2, select pin C14
sd0: type SDHC, size 15339520 kbytes, speed 13 Mbit/sec
phys mem = 128 kbytes
user mem = 96 kbytes
root dev = rd0a (0,1)
root size = 163840 kbytes
swap dev = rd0b (0,2)
swap size = 2048 kbytes
temp0: allocated 47 blocks
/dev/rd0a: 576 files, 8644 used, 154555 free
temp0: released allocation
Starting daemons: update cron

2.11 BSD UNIX (pic32) (console)


Serial terminal on Nexus 7 with keyboard

Back in September last year at Wuthering Bytes, during a discussion about programming I thought I’d look into the availability of development tools on the android platform & was pleasantly surprised to find tool chains & IDE’s, not having a keyboard made even a simple hello world application painful to write though so I left it at that with the intention of buying a keyboard. I finally got around to buying a keyboard for my 2012 model, settling for a mobile bluetooth keyboard for nexus 7, first impression is the keys feel a little on the small size on but will see after a bit more use.

I’m happy with the size & form factor, it reminds me of the Windows CE HP Journada PDA which are supported by NetBSD/hpcsh though the Journada’s were smaller.

As I have a OTG cable which allows me to connect USB devices to the nexus 7 which normally wouldn’t work (due to requiring host mode) I looked into the state of serial adapter support.

Prolific who produce a very popular USB to Serial chip (PL2303) have an app for Android, as I didn’t have a null modem cable at hand I couldn’t test functionality beyond seeing if the adapter is detected.

For serial console on my Rasberry Pi’s I use a SiLabs CP2102 chipset USB to TTL & a FTDI FT232PL chipset adapter for BeagleBone Black. To connect both of these adapters to my Nexus 7 I used USB Serial Lite. At first the app seemed very unstable, becoming unresponsive after the first attempt to send something over the serial port, this turned out to be CR / LF not being enabled to send on transmit, having at least one of them above the text entry box on the TX row & ticked solves this issue.
There are many more apps available in the Play store for connecting to USB serial adapters but I couldn’t get any of them to produce output from the CP2012.

Building tcsh on 4.3BSD-Quasijarus

So after build installing 4.3BSD on simh I was left with a somewhat bare environment.
My first need was a better shell than stock csh with history & tab completion. I proceeded to download the latest version of tcsh to attempt a build.
Things fell into place quickly as I realised this was not going to be as straight forward.
At some point in the development path of tcsh, support for the GNU tool chain was added which would allow one to use autotools to build the software.
Bootstrapping the baseline is always a lengthy pain which prepackaged binaries ease. I was reminded of the period I avoided using OpenBSD-CURRENT because I was unaware packages were available so I would resort to painfully long builds as I started to tried to compile firefox on a freshly installed system.
I decided to see how far I can get in building software without the introduction GNU components, not using up to date versions is acceptable just so I can achieve the task. This also falls in line with the philosophy of the 4.3BSD-Quasijarus project.

I struggled to get tcsh 6.18.01 to build so thought I’d try the earliest version I could find on the official mirror to see if that would work any better.
Version 6.00 is the earliest one available on the US FTP site, the README file references 4.2 & 4.3BSD among a whole bunch of other legacy OS’s & no sign of GNU autoconf.
With a bit of experimentation I had tcsh compiled, essentially just needed to undefine functionality that was not present in my stock install (NLS) or available in the version I was running (better POSIX compliance).
There is lots of code which is spaced out so as to disable its functionality requiring the deletion of the spaces to re-enable depending on the intended target.
This approach assumes knowledge of the OS & its capabilities along with the functionality enabled in the version installed as apposed to the autotools approach where the developer is responsible for putting together something which in theory will reduced the requirement from the end user installing the software to running configure & make.
In my opinion it’s an idea which is poorly executed while not actually solving the problem, instead pushing the responsiblity from one end to the other with added complexity.
I discovered through an interview with Larry Wall that he was responsible for the patch utility we commonly use, I was curious to see how it would function on 4.3BSD & to my surprise there was no patch utility in base. There is the diff utility for generating differential patches but no support for unified context just copied context. You can generate scripts for ed which can be used to apply the changes for subsequent users.

To build tcsh on 4.3BSD Qausijarus
Fetch the tcsh-6.00.00.tar.gz from FTP
Uncompress with
gzcompat tcsh-6.00.00.tar.gz | uncompress | tar xf -

Copy tcsh-6.00/config/config.bsdreno to tcsh-6.00/config.h

Apply the following changes in this diff to your source & build by running make

By default, the install process puts files into /usr/local so you’ll need to create /usr/local/bin & /usr/local/man

> echo $version
tcsh 6.00.00 (Cornell) 07/04/91 options 8b,dl,al,dir

Last week I came across a project to develop 4.5BSD, a continuation from where 4.4BSD stopped. Comparing the current state of the modern BSD derivatives, we’ve come a long long way, with effort going in to reduce the need to bring the system to a useable state post install & shipping with sane defaults we are in a much better place. 20 years worth of changes to back port is a serious effort.

Running 4.3BSD Quasijarus with simh VAX

I’d previously installed simh via macports & though it was supposedly built with networking support, the guests didn’t actually work with networking on mavericks.
I gave the v4.0 beta a try to see if the problem existed, following the simh Ethernet document I built simh using
make USE_NETWORK=1 LPATH=/usr/lib:/usr/local/lib:/opt/local/lib with libpcap installed via macports & tuntap installed from sourceforge (it is available from macports if you prefer as tuntaposx).
Networking support turned out to work fine with the stock MicroVAX 3900 simulator, failing on the other VAX guests (11/{730,750,780} and 8600) with an error about a non-existent device.

To install 4.3BSD Quasijarus on simh I followed this guide fetching the Mkdisttap.pl script & gzcompat.c from the Computer History Wiki.

I used the following ini file I used for the guest once everything was installed

load -r /opt/local/share/simh/VAX/ka655x.bin
set cr dis
set lpt dis
set rl dis
set ry dis
set ts dis
set rq0 ra82
att rq0 quas.dsk
set rq1 dis
set rq2 dis
set rq3 dis
att tq0 quas.tap
set dz lines=8
att dz 8888
set dz 7b
att xq tap:tap0
set cpu idle=ALL
att nvr nvram.dat
dep bdr 1
! ifconfig tap0 netmask

With the ini file above, the host is assigned the IP address, serial console listening on TCP port 8888 and IDLE loop detection works with set cpu idle=ALL, this means that a guest sits at around 3% CPU & only goes up to a maximum of 70% CPU on my macbook air when compiling software as opposed to 100% at all time. As the application needs to bind to a tap interface & set an IP address it needs to be run as root.


Mac displays prohibition sign when booting from install media

I wanted to re-configure my 11″ MacBook Air so that it dual boots Mac OS X as well as OpenBSD but found that I was unable to boot from a USB flash drive containing 10.8.5.
Booting from a flash drive resulted in a prohibition sign in place of the apple logo with the spiral animation continuing to spin.

Booting again but this time in verbose mode (command + v) showed that the kernel is waiting & repeating the message

Still waiting for root device

, I assumed this message was regarding the USB boot disk, it turns out it’s referring to onbroad SSD.

Searching around I found a thread which used the remote recovery function along with a USB flash drive to restore the Mac (something which I was trying to completely avoid because my internet connection is really poor & the recovery process is slow), this reminded me of the recovery disk assistant which allows you to build a recovery disk as well as update the recovery partition on your system disk.
Attempting to boot from a recovery disk succeeded & allowed me to repartition the SSD in my macbook air with disk utility. I was then able to boot from the USB flash disk containing mac os x & reinstall successfully.

Edit: clarify that it was the SSD which was repartitioned in last paragraph.

OpenBSD on 11″ MacBook Air 5,1 (mid-2012)

While my MacBook was away at the service centre to have the SSD replaced I noticed the NetBSD wiki had marked the install guide as obsolete as it’s no longer required to build a custom kernel because the necessary changes have been integrated so that the generic kernel works out of the box.
The last time I tried to run OpenBSD on a MacBook Air was over the christmas holiday on a mid-2012 13″ model & while I managed to boot a multiuser system, USB support was very unstable & eDP support was missing from Xenocara.
Having received my MacBook back I decided to revisit Net/OpenBSD, I tried booting NetBSD/AMD64 6.1.1 & the 29/08/2013 AMD64 OpenBSD snapshot.
Both exhibited the same behavior, as soon as the kernel loaded into memory the screen would go blank, I attached a thunderbolt display which made displayed some output before going to a blank screen as the kernel probes for devices, I believe this is when OpenBSD now changes font.
I switched from the OpenBSD snapshot to what I (half asleep) thought was 5.4-RELEASE but it turned out to be a mislabelled iso of a snapshot from July. This time it worked fine using a Thunderbolt display, screen still goes blank otherwise.
Onboard wireless doesn’t work, instead I’m using a tiny urtwn(4) wireless adapter.


OpenBSD 5.4-current (GENERIC.MP) #50: Mon Sep 2 13:43:54 MDT 2013
RTC BIOS diagnostic error b1
real mem = 8475713536 (8083MB)
avail mem = 8242003968 (7860MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0000 (54 entries)
bios0: vendor Apple Inc. version "MBA51.88Z.00EF.B02.1211271028" date 11/27/2012
bios0: Apple Inc. MacBookAir5,1
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: wakeup devices P0P2(S4) PEG2(S4) EC__(S4) HDEF(S4) RP02(S4) ARPT(S4) RP05(S4) EHC1(S4) EHC2(S4) XHC1(S4) ADP1(S4) LID0(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz, 1896.01 MHz
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 99MHz
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz, 1895.70 MHz
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz, 1895.70 MHz
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 1, core 0, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz, 1895.70 MHz
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
acpiec0 at acpi0
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-153
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus -1 (PEG2)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP05)
acpicpu0 at acpi0: C3, C1, PSS
acpicpu1 at acpi0: C3, C1, PSS
acpicpu2 at acpi0: C3, C1, PSS
acpicpu3 at acpi0: C3, C1, PSS
acpibat0 at acpi0: BAT0 model "3545797981023400290" type 3545797981528607052 oem "3545797981528673619"
acpiac0 at acpi0: AC unit offline
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpibtn2 at acpi0: SLPB
acpivideo0 at acpi0: IGPU
acpivout0 at acpivideo0: DD02
cpu0: Enhanced SpeedStep 1896 MHz: speeds: 2001, 2000, 1900, 1800, 1700, 1600, 1500, 1400, 1300, 1200, 1100, 1000, 900, 800 MHz
memory map conflict 0xe00f8000/0x1000
memory map conflict 0xfed1c000/0x4000
memory map conflict 0xffe70000/0x30000
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 3G Host" rev 0x09
vga1 at pci0 dev 2 function 0 "Intel HD Graphics 4000" rev 0x09
intagp0 at vga1
agp0 at intagp0: aperture at 0x90000000, size 0x10000000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1366x768
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 7 Series xHCI" rev 0x04 at pci0 dev 20 function 0 not configured
"Intel 7 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
ehci0 at pci0 dev 26 function 0 "Intel 7 Series USB" rev 0x04: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 7 Series HD Audio" rev 0x04: msi
azalia0: codecs: Cirrus Logic CS4206, Intel/0x2806, using Cirrus Logic CS4206
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 7 Series PCIE" rev 0xc4: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 1 "Intel 7 Series PCIE" rev 0xc4: msi
pci2 at ppb1 bus 2
"Broadcom BCM43224" rev 0x01 at pci2 dev 0 function 0 not configured
ppb2 at pci0 dev 28 function 4 "Intel 7 Series PCIE" rev 0xc4: msi
pci3 at ppb2 bus 3
ppb3 at pci3 dev 0 function 0 vendor "Intel", unknown product 0x1547 rev 0x03
pci4 at ppb3 bus 4
ppb4 at pci4 dev 0 function 0 vendor "Intel", unknown product 0x1547 rev 0x03: msi
pci5 at ppb4 bus 5
vendor "Intel", unknown product 0x1547 (class system subclass miscellaneous, rev 0x03) at pci5 dev 0 function 0 not configured
ppb5 at pci4 dev 3 function 0 vendor "Intel", unknown product 0x1547 rev 0x03: msi
pci6 at ppb5 bus 6
ppb6 at pci4 dev 4 function 0 vendor "Intel", unknown product 0x1547 rev 0x03: msi
pci7 at ppb6 bus 55
ppb7 at pci4 dev 5 function 0 vendor "Intel", unknown product 0x1547 rev 0x03: msi
pci8 at ppb7 bus 104
ppb8 at pci4 dev 6 function 0 vendor "Intel", unknown product 0x1547 rev 0x03: msi
pci9 at ppb8 bus 105
ehci1 at pci0 dev 29 function 0 "Intel 7 Series USB" rev 0x04: apic 2 int 22
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
pcib0 at pci0 dev 31 function 0 vendor "Intel", unknown product 0x1e56 rev 0x04
ahci0 at pci0 dev 31 function 2 "Intel 7 Series AHCI" rev 0x04: msi, AHCI 1.3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: SCSI3 0/direct fixed naa.0000000000000000
sd0: 115712MB, 512 bytes/sector, 236978176 sectors, thin
ichiic0 at pci0 dev 31 function 3 "Intel 7 Series SMBus" rev 0x04: apic 2 int 18
iic0 at ichiic0
iic0: addr 0x2c 03=fc 05=66 06=40 71=06 72=80 86=70 90=37 91=1c 92=35 93=3f 94=62 95=8c 96=63 97=85 98=24 99=04 9a=88 9f=7c a0=7f a1=b5 a2=bf a3=7b a4=28 a5=cf a6=64 a7=2d words 00=0000 01=0000 02=00fc 03=fc00 04=0066 05=6640 06=4000 07=0000
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns8250, no fifo
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
nvram: invalid checksum
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
uhub2 at uhub0 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
uvideo0 at uhub2 port 1 configuration 1 interface 0 "Apple Inc. FaceTime HD Camera (Built-in)" rev 2.00/80.25 addr 3
video0 at uvideo0
ugen0 at uhub2 port 1 configuration 1 "Apple Inc. FaceTime HD Camera (Built-in)" rev 2.00/80.25 addr 3
uhub3 at uhub1 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
uhub4 at uhub3 port 8 "Standard Microsystems product 0x2512" rev 2.00/b.b3 addr 3
uhub5 at uhub4 port 1 "Apple Inc. BRCM20702 Hub" rev 2.00/1.00 addr 4
uhub5: device problem, disabling port 1
uhidev0 at uhub5 port 2 configuration 1 interface 0 "Apple Computer product 0x820b" rev 2.00/1.00 addr 5
uhidev0: iclass 3/1, 2 report ids
ums0 at uhidev0 reportid 2: 3 buttons
wsmouse0 at ums0 mux 0
ugen1 at uhub5 port 3 "Apple Inc. Bluetooth USB Host Controller" rev 2.00/1.00 addr 6
uhidev1 at uhub4 port 2 configuration 1 interface 0 "Apple Inc. Apple Internal Keyboard / Trackpad" rev 2.00/2.19 addr 7
uhidev1: iclass 3/1, 9 report ids
ukbd0 at uhidev1 reportid 1: 8 variable keys, 6 key codes, country code 15
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhid0 at uhidev1 reportid 9: input=0, output=0, feature=3
uhidev2 at uhub4 port 2 configuration 1 interface 1 "Apple Inc. Apple Internal Keyboard / Trackpad" rev 2.00/2.19 addr 7
uhidev2: iclass 3/0, 68 report ids
uhid1 at uhidev2 reportid 68: input=511, output=0, feature=0
uhidev3 at uhub4 port 2 configuration 1 interface 2 "Apple Inc. Apple Internal Keyboard / Trackpad" rev 2.00/2.19 addr 7
uhidev3: iclass 3/1, 2 report ids
ums1 at uhidev3 reportid 2: 3 buttons
wsmouse1 at ums1 mux 0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (0f625884de9eca57.a) swap on sd0b dump on sd0b
clock: unknown CMOS layout
hw.sensors.cpu0.temp0=36.00 degC
hw.sensors.cpu1.temp0=36.00 degC
hw.sensors.cpu2.temp0=36.00 degC
hw.sensors.cpu3.temp0=36.00 degC
hw.sensors.acpibat0.volt0=7.50 VDC (voltage)
hw.sensors.acpibat0.volt1=7.23 VDC (current voltage)
hw.sensors.acpibat0.power0=12.26 W (rate)
hw.sensors.acpibat0.watthour0=42.41 Wh (last full capacity)
hw.sensors.acpibat0.watthour1=0.25 Wh (warning capacity)
hw.sensors.acpibat0.watthour2=0.10 Wh (low capacity)
hw.sensors.acpibat0.watthour3=6.90 Wh (remaining capacity), OK
hw.sensors.acpibat0.raw0=1 (battery discharging), OK
hw.sensors.acpiac0.indicator0=Off (power supply)
hw.sensors.acpibtn0.indicator0=On (lid open)

Not even a 33KB SSD

The SSD on my 11″ 2012 Macbook Air has now failed too, this time nothing is registered in disk utility.
If your system ever gives you the firmware flash screen when there hasn’t been an update which you’ve initiated then take it as a signal that the end is near, this time round it was 2 weeks between the two events.


Dvorak layout with ctrl & caps lock swapped round on FreeBSD

Since getting a MacBook Air with a Japanese keyboard, I have grown accustomed to having the control key in place of the caps lock, so much so that now it’s annoying not having it there if I switch to another system. Searching around to see what I’d find on the subject, it seems that a similar frustration exists for users who are used to the left control key being in the bottom left hand side instead of the new Fn key & infact I have a bios image which makes this change for my X61s.

From the brief search for a bios image brought up lots of links to the image which I already have for swapping fn with ctrl & I didn’t fancy an introduction to ThinkPad BIOS hacking with IDA so I began to look for OS specific solutions.

On FreeBSD, a variant of the UK (uk.cp850-ctrl.kbd, uk.iso-ctrl.kdb) & US standard layouts (us.pc-ctrl.kbd) exist which swap the location of the two keys round & I found this guide (in Japenese) which discusses what changes are needed to a layout file (reassigning scan codes 29 & 58) but all this was already taken care of some 12 years ago. The header of us.dvorak.kbd menions:

“There are some minor variations, but this seems like the most common layout. I personally use one with three more pairs swapped:
esc `~, clock lctrl, and =+ \| (supplied as “us.dvorakx.kbd“). ”

I just needed to declare keymap="us.dvorakx.kbd" in /etc/rc.conf & restart /etc/rc.d/syscons.