<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>FreeBSD on FreeBSD developer&#39;s notebook</title>
    <link>https://kernelnomicon.org/categories/freebsd/</link>
    <description>Recent content in FreeBSD on FreeBSD developer&#39;s notebook</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 30 Jul 2020 00:13:20 +0000</lastBuildDate>
    <atom:link href="https://kernelnomicon.org/categories/freebsd/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Audio subsystem hardware internals</title>
      <link>https://kernelnomicon.org/posts/audio-subsystem-hardware-internals/</link>
      <pubDate>Thu, 30 Jul 2020 00:13:20 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/audio-subsystem-hardware-internals/</guid>
      <description>&lt;p&gt;I wrote an introductory article on how the audio subsystem on SBCs work: CODECs, I&lt;sup&gt;2&lt;/sup&gt;S, DTS, whole nine yards. WordPress editor didn&amp;rsquo;t seem to be a very convenient tool for this kind of write up so I gave asciidoc a try and so far liked it.&lt;/p&gt;
&lt;p&gt;Link to the article: &lt;a href=&#34;https://kernelnomicon.org/texts/sbc-audio.html&#34;&gt;https://kernelnomicon.org/texts/sbc-audio.html&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>yubikey-agent on FreeBSD</title>
      <link>https://kernelnomicon.org/posts/yubikey-agent-on-freebsd/</link>
      <pubDate>Thu, 04 Jun 2020 00:03:01 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/yubikey-agent-on-freebsd/</guid>
      <description>&lt;p&gt;Some time ago &lt;a href=&#34;https://filippo.io/&#34;&gt;Filippo Valsorda&lt;/a&gt; wrote &lt;a href=&#34;https://github.com/FiloSottile/yubikey-agent&#34;&gt;yubikey-agent&lt;/a&gt;, seamless SSH agent for YubiKeys. I really like YubiKeys and worked on the FreeBSD support for U2F in Chromium and pyu2f, getting yubikey-agent ported looked like an interesting project. It took some hacking to make it work but overall it wasn&amp;rsquo;t hard. Following is the roadmap on how to get it set up on FreeBSD. The actual details depend on your system (as you will see)&lt;/p&gt;</description>
    </item>
    <item>
      <title>wpa_supplicant.conf &#34;manager&#34; for coffee shops</title>
      <link>https://kernelnomicon.org/posts/wpa_supplicant-conf-manager-for-coffee-shops/</link>
      <pubDate>Tue, 12 May 2020 22:59:46 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/wpa_supplicant-conf-manager-for-coffee-shops/</guid>
      <description>&lt;p&gt;&lt;img alt=&#34;https://github.com/gonzoua/chaifi&#34; loading=&#34;lazy&#34; src=&#34;https://kernelnomicon.org/uploads/2020/05/screenshot-1024x576.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;Whenever I sit down to work at the coffee shop I&amp;rsquo;ve never been before my preparation routine looks more or less like this: &lt;code&gt;ifconfig wlan0 list scan&lt;/code&gt;, copy SSID, &lt;code&gt;vim /etc/wpa_supplicant.conf&lt;/code&gt;, &lt;code&gt;service netif restart&lt;/code&gt;. The WM I use, i3, does not have fancy network managers that nicely offer you to join available WiFi networks. It&amp;rsquo;s mildly annoying but not annoying enough to actually make me open a browser and go looking for ways to automate this procedure. Implementing such a utility, on the other hand, sounds like a nice weekend project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Creating FreeBSD OVA files</title>
      <link>https://kernelnomicon.org/posts/creating-freebsd-ova-files/</link>
      <pubDate>Sun, 19 Jan 2020 16:13:17 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/creating-freebsd-ova-files/</guid>
      <description>&lt;p&gt;If you want to jump right into the action check out &lt;a href=&#34;https://github.com/gonzoua/freebsd-mkova&#34;&gt;freebsd-mkova&lt;/a&gt; repo. Below are some technical details on what OVA is and its internals.&lt;/p&gt;
&lt;p&gt;In addition to installation media like DVD or memstick, FreeBSD RE ships FreeBSD releases as a virtual disk image in a number of formats. This is a convenient way when you start your whole VM using bhyve or qemu, as a single CLI command and pass the image location as an argument. It&amp;rsquo;s less handy if you try to create VM using GUI-based tools like VMWare or VirtualBox. You need to create VM and then configure it to use the image as a drive. Not an awful lot of work but still.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Audio for RK3399</title>
      <link>https://kernelnomicon.org/posts/audio-for-rk3399/</link>
      <pubDate>Sat, 30 Nov 2019 19:46:08 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/audio-for-rk3399/</guid>
      <description>&lt;p&gt;Last two weeks I&amp;rsquo;ve been working on audio support for Firefly-RK3399. Full support requires a number of things that are not quite there or not available in the mainline FreeBSD kernel. The main low-level hardware functionality consists of two parts: I2S block in the SoC and RT5640 audiocodec that converts digital audio to an analog signal. They talk to each other using the I2S protocol. A little bit higher is FDT virtual &amp;ldquo;devices&amp;rdquo; called simple-audio-card. This part is responsible for coordinating the setup of both hardware components: make sure they agree on a number of channels, a number of bits per sample and clock specifics of the I2S protocol. There is no code for it in the FreeBSD kernel, so I had to just hardcode these things in both hardware drivers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Color themes support^Whack for vt(4)</title>
      <link>https://kernelnomicon.org/posts/color-themes-supportwhack-for-vt4/</link>
      <pubDate>Sat, 19 Aug 2017 21:16:08 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/color-themes-supportwhack-for-vt4/</guid>
      <description>&lt;p&gt;I was updating my laptop to the latest HEAD today and noticed that my bash prompt looks ugly in default console color scheme. So what with one thing and another I ended up writing color themes support for vt(4). Just because it was fun thing to do. The idea is that you can redefine any ANSI color in console using variable in /boot/loader.conf, i.e.:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kern.vt.color.0.rgb=&amp;#34;0,0,0&amp;#34; # color 0 is black
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# or
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kern.vt.color.15.rgb=&amp;#34;#ffffff&amp;#34; # color 15 is white
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here is how my Tomorrow Night theme looks like:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Minnowboard Turbot: GPIO, I2C, and SPI</title>
      <link>https://kernelnomicon.org/posts/minnowboard-turbot-gpio-i2c-and-spi/</link>
      <pubDate>Fri, 06 Jan 2017 14:35:33 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/minnowboard-turbot-gpio-i2c-and-spi/</guid>
      <description>&lt;p&gt;Last year I got my hands on Minnowboard Turbot (courtesy of Frank H.) and spent some time working on communications protocols support for it. Below is short summary of what works and what doesn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://wiki.minnowboard.org/MinnowBoard_Turbot&#34;&gt;Minnowboard Turbot&lt;/a&gt; is Atom-base SoC, and standard x86 part (HDMI, network, USB) FreeBSD just works on it. The board has expansion connector that exposes I2C, SPI, and GPIO pins and can be used to talk to peripheral devices. Short summary of header pins can be found on &lt;a href=&#34;https://developer.microsoft.com/en-us/windows/iot/docs/pinmappingsmbm&#34;&gt;developer.microsoft.com&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Accessing I2C and SPI from userland</title>
      <link>https://kernelnomicon.org/posts/accessing-i2c-and-spi-from-userland/</link>
      <pubDate>Sat, 17 Dec 2016 20:29:46 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/accessing-i2c-and-spi-from-userland/</guid>
      <description>&lt;p&gt;Over years I accumulated fair number of devices I have no real use for. I ordered them either on impulse, or to add couple of $$$ to the bill to get free delivery. So in order to get at least some value from those purchases I put together goofy demo using two of such devices: &lt;a href=&#34;https://www.sparkfun.com/products/11931&#34;&gt;I2C temperature sensor breakout&lt;/a&gt; from Sparkfun and &lt;a href=&#34;https://www.adafruit.com/products/661&#34;&gt;128x32 SPI OLED display&lt;/a&gt; from Adafruit.&lt;/p&gt;
&lt;p&gt;I wrote two libraries to talk to TMP102 (chip in which temp sensor is based) over I2C and to SSD1306(OLED display chip) over SPI and several demos simple enough to put together in one day but flashy enough to excite my inner child and bring fond memories of MSDOS days. The SPI chip requires &lt;a href=&#34;https://svnweb.freebsd.org/base?view=revision&amp;amp;revision=310170&#34;&gt;this fix&lt;/a&gt; in kernel. Userland SPI API provides only very basic functionality but luckily it was enough to talk to SSD1306.&lt;/p&gt;</description>
    </item>
    <item>
      <title>rfkill on Jetson TK1</title>
      <link>https://kernelnomicon.org/posts/rfkill-on-jetson-tk1/</link>
      <pubDate>Sun, 11 Dec 2016 13:50:42 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/rfkill-on-jetson-tk1/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re trying to install half-sized mini-PCIe wifi card in Jetson TK1, be aware, that the board has rfkill feature that is enabled by default. rfkill is hardware or software controlled switch that enables/disables RF signal on the wifi card itself. In case of mini-PCIe it&amp;rsquo;s controlled by level on pin 20 of the card. On Jetson TK-1 that pin is connected to GPIO X.7 pin. So to enable wifi on the board you need to run something like:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quest for SMP on Raspberry Pi 3, part II</title>
      <link>https://kernelnomicon.org/posts/quest-for-smp-on-raspberry-pi-3-part-ii/</link>
      <pubDate>Fri, 25 Nov 2016 15:47:14 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/quest-for-smp-on-raspberry-pi-3-part-ii/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Update (11/29/2016): DTB overlay no longer required. PSCI monitor will patch in-memory DTB to add psci node. &lt;a href=&#34;https://github.com/gonzoua/rpi3-psci-monitor/commit/0d65e734e5d03f91bc10451c4f510f60e5b90bc5&#34;&gt;Commit&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&#34;short-version-of-how-to-get-rpi3-with-smp-support&#34;&gt;Short version of how to get RPi3 with SMP support&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Build GENERIC arm64 kernel for your image, not GENERIC-UP&lt;/li&gt;
&lt;li&gt;Copy &lt;a href=&#34;https://people.freebsd.org/~gonzo/arm/rpi3-smp/u-boot.bin&#34;&gt;https://people.freebsd.org/~gonzo/arm/rpi3-smp/u-boot.bin&lt;/a&gt; and &lt;a href=&#34;https://people.freebsd.org/~gonzo/arm/rpi3-smp/armstub8.bin&#34;&gt;https://people.freebsd.org/~gonzo/arm/rpi3-smp/armstub8.bin&lt;/a&gt; to FAT partition on SD card.&lt;/li&gt;
&lt;li&gt;Copy &lt;a href=&#34;https://people.freebsd.org/~gonzo/arm/rpi3-smp/psci.dtbo&#34;&gt;https://people.freebsd.org/~gonzo/arm/rpi3-smp/psci.dtbo&lt;/a&gt; to &lt;code&gt;overlays&lt;/code&gt; directory on FAT partition&lt;/li&gt;
&lt;li&gt;Edit config.txt: change value of device_tree_address and add psci overlay. These two lines should be there:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;device_tree_address=0x4000
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Reboot device. It should boot with all four cores enabled and reboot should work too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;long-version-of-whats-in-those-bindtbo-files&#34;&gt;Long version of what&amp;rsquo;s in those .bin/.dtbo files&lt;/h3&gt;
&lt;p&gt;Boot sequence for PSCI monitor on RPi3 looks like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quest for SMP on Raspberry Pi 3</title>
      <link>https://kernelnomicon.org/posts/quest-for-smp-on-raspberry-pi-3/</link>
      <pubDate>Thu, 24 Nov 2016 10:58:06 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/quest-for-smp-on-raspberry-pi-3/</guid>
      <description>&lt;p&gt;Getting SMP support for RPI3 took some time and was interesting learning experience. So I share bits of what I learned here.&lt;/p&gt;
&lt;p&gt;FreeBSD/arm boot start on one CPU (called primary) the rest of CPUs are &amp;ldquo;on hold&amp;rdquo;. At some point in boot sequence non-primary CPUs are forced to call mpentry() function. The way CPU is forced to call mpentry is platform-dependent. RPi2 for instance passes mpentry and argument to VideoCore using mailbox interface and then VideoCore kicks ARM CPU in action. So most of SoC has their own implementation of platform_mp_start_ap platform API method.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MFC tracking web-tool</title>
      <link>https://kernelnomicon.org/posts/mfc-tracking-web-tool/</link>
      <pubDate>Sun, 16 Oct 2016 19:50:03 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/mfc-tracking-web-tool/</guid>
      <description>&lt;p&gt;Next week I plan to do bunch of MFCs for ARM and evdev stuff and to make it less of an ordeal I made this tool to track what&amp;rsquo;s merged and what&amp;rsquo;s not: &lt;a href=&#34;http://mfc.kernelnomicon.org&#34;&gt;mfc.kernelnomicon.org&lt;/a&gt;. It provides basic functionality I thought I would need for this process:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Navigator for HEAD commits with visual representation of MFC state: &amp;ldquo;no mfc scheduled&amp;rdquo;, &amp;ldquo;ready for mfc&amp;rdquo;, &amp;ldquo;waiting for &amp;lsquo;mfc after&amp;rsquo; date&amp;rdquo;, &amp;ldquo;merged&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Basic filtering: by author name, by two states: &amp;ldquo;waiting&amp;rdquo;, and &amp;ldquo;ready&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;MFC basket&amp;rdquo; - manage set of commits I would like to merge back in one go&lt;/li&gt;
&lt;li&gt;Generate svn command and change log for selected &amp;ldquo;MFC basket&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Stack used: Django + Bootstrap3 + jQuery&lt;/p&gt;</description>
    </item>
    <item>
      <title>Raspberry Pi support in HEAD</title>
      <link>https://kernelnomicon.org/posts/raspberry-pi-support-in-head/</link>
      <pubDate>Fri, 14 Oct 2016 22:29:03 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/raspberry-pi-support-in-head/</guid>
      <description>&lt;p&gt;Raspberry Pi 3 limited support was committed to HEAD. Most of drivers should work with upstream dtb, RNG requires attention because callout mode seems to be broken and there is no IRQ in upstream device tree file. SMP is work in progress. There are some compatibility issue with VCHIQ driver due to some assumptions that are true only for ARM platform.&lt;/p&gt;
&lt;p&gt;SD card layout is the same as for RPi and RPi2 but boot chain is different. All ARM64 supported by FreeBSD up to now used EFI as boot environment. RPi 3 has only VC firmware and whatever it can spin off, e.g. u-boot. So it seemed easier to enable EFI API in U-Boot instead of porting ubldr to arm64. There were some hiccups with netbooting, (see &lt;a href=&#34;https://people.freebsd.org/~gonzo/arm/patches/u-boot-rpi3-uefi-netboot.diff&#34;&gt;patch&lt;/a&gt;) but otherwise it was OK. U-Boot port and crochet config for Pi 3 should be committed &amp;ldquo;real soon&amp;rdquo;(tm).&lt;/p&gt;</description>
    </item>
    <item>
      <title>64-bit U-Boot on Raspberry Pi 3</title>
      <link>https://kernelnomicon.org/posts/64-bit-u-boot-on-raspberry-pi-3/</link>
      <pubDate>Sun, 09 Oct 2016 16:57:35 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/64-bit-u-boot-on-raspberry-pi-3/</guid>
      <description>&lt;p&gt;Short summary of couple of frustrating hours I spent trying to get my RPi3 netbooting:&lt;/p&gt;
&lt;p&gt;U-Boot - 2016.09
&lt;a href=&#34;https://github.com/raspberrypi/firmware/boot&#34;&gt;raspberrypi/firmware/boot&lt;/a&gt; - ec63df146f454e8cab7080380f9138246d877013&lt;/p&gt;
&lt;p&gt;armstub.bin, armstub7.bin, armstub8.bin - NOT REQUIRED. There are tens of google results mentioning these files along with some dd magic - they all obsolete. Aforementioned version of firmware does not require them. 64-bit mode is controlled by arm_control variable in config.txt (see below). If  64-bit mode requested default kernel name becomes kernel8.img, and kernel load address becomes 0x80000. U-Boot uses correct default load address so no need for any additional parameters or hacks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multitouch support on FT5406</title>
      <link>https://kernelnomicon.org/posts/multitouch-support-on-ft5406/</link>
      <pubDate>Sat, 08 Oct 2016 11:54:47 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/multitouch-support-on-ft5406/</guid>
      <description>&lt;p&gt;Few weeks ago evdev support was finally committed to HEAD. Project &lt;a href=&#34;https://wiki.freebsd.org/SummerOfCode2014/evdev_Touchscreens&#34;&gt;started&lt;/a&gt; a part of SoC 2014 by Jakub Klama and then picked up, finished and submitted by Vladimir Kondratiev. It&amp;rsquo;s drop-in compatible with Linux API which means all you need to do is add #ifdef _&lt;em&gt;FreeBSD&lt;/em&gt; around respective includes and existing code (if it&amp;rsquo;s otherwise cross-compatible with FreeBSD) should just work. Which is the case for &lt;a href=&#34;https://codereview.qt-project.org/#/c/172829/&#34;&gt;Qt&lt;/a&gt; and to lesser extent for &lt;a href=&#34;https://github.com/kergoth/tslib/pull/42&#34;&gt;tslib&lt;/a&gt;. Hardware support is still moving target, FreeBSD has evdev-compatible drivers for USB keyboards, USB mice, TI&amp;rsquo;s AM33xx touchscreen controller and Raspberry Pi&amp;rsquo;s official touchscreen. Only the latter device supports multitouch and Vladimir submitted patch required to get it working. To my knowledge it&amp;rsquo;s the first multitouch touchscreen ever working on FreeBSD so I decided to record demo to save this moment for generations to come. Well, not really. Mostly to brag and to let people know that it&amp;rsquo;s possible and encourage them to make stuff and experiment with FreeBSD, ARM, and Qt.&lt;/p&gt;</description>
    </item>
    <item>
      <title>VirtualBox Shared Folders: progress report</title>
      <link>https://kernelnomicon.org/posts/virtualbox-shared-folders-progress-report/</link>
      <pubDate>Mon, 12 Sep 2016 15:59:05 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/virtualbox-shared-folders-progress-report/</guid>
      <description>&lt;p&gt;I spent Labor Day weekend laboring on VBox shared folders support for FreeBSD. It&amp;rsquo;s been some time since I worked on it last time so I had to refresh my memory first. Things have moved on since then - VBox in ports was updated to version 5, but fortunately Li-Wen synced up &lt;a href=&#34;https://github.com/lwhsu/freebsd-vboxfs&#34;&gt;freebsd-vboxfs&lt;/a&gt; repo to the latest version. After three days of laid-back hacking I am glad to announce that following VOPs are kind of implemented (in no particular order): lookup, access, readdir, read, getattr, readlink, remove, rmdir, symlink, close, create, open, write. &amp;ldquo;Kind of implemented&amp;rdquo; means that I was able to mount directory, traverse it, read file, calculate md5 sums and compare with host&amp;rsquo;s md5sum, create/remove directories, unzip zip file, etc but I doubt it would survive stress-test. Locking is all wrong at the moment and read/write VOPs allocate buffers for every operation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jetson TK1, FreeBSD, and SSD</title>
      <link>https://kernelnomicon.org/posts/jetson-tk1-freebsd-and-ssd/</link>
      <pubDate>Fri, 19 Aug 2016 13:30:39 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/jetson-tk1-freebsd-and-ssd/</guid>
      <description>&lt;p&gt;Looks like my attempt to cheap out on SSD for TK1 has backfired. I went for the cheapest SSD available in local store (Toshiba Q300) but when I tried to checkout FreeBSD sources to the drive I got bunch of WRITE_FPDMA_QUEUED timeouts and system locked up. The same thing happened when I tried to perform checkout on Linux. The drive itself was OK, it survived &amp;ldquo;svn co &amp;hellip;/head&amp;rdquo; and dd when connected using USB-to-SATA adapter.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FreeBSD on Jetson TK1</title>
      <link>https://kernelnomicon.org/posts/freebsd-on-jetson-tk1/</link>
      <pubDate>Tue, 28 Jun 2016 13:33:41 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/freebsd-on-jetson-tk1/</guid>
      <description>&lt;p&gt;I finally got around to BSDify my Jetson TK1. Here is short summary of what is involved. And to save you some scrolling here are artifacts obtained from whole ordeal: &lt;a href=&#34;https://people.freebsd.org/~gonzo/arm/jetson-tk1/&#34;&gt;https://people.freebsd.org/~gonzo/arm/jetson-tk1/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://kernelnomicon.org/uploads/2016/06/IMG_2064-e1467143789207.jpg&#34;&gt;&lt;img alt=&#34;Jetson TK1&#34; loading=&#34;lazy&#34; src=&#34;https://kernelnomicon.org/uploads/2016/06/IMG_2064-e1467143789207-768x1024.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;u-boot&#34;&gt;U-Boot&lt;/h2&gt;
&lt;p&gt;First of all - my TK1 didn&amp;rsquo;t have U-Boot. Type of bootloader depends on the version of Linux4Tegra TK1 comes with. Mine had L4T R19, with some kind of &amp;ldquo;not u-boot&amp;rdquo; bootloader. My first attempt was to use tegrarcm tool, it uses libusb, so it&amp;rsquo;s possible to build it on FreeBSD with some elbow grease, but once I tried to run it - it gave me cryptic errors and USB is not my strong skill so I took low road and installed Ubuntu VM. For what is&amp;rsquo;s worth I got the same kind of error on Ubuntu.&lt;/p&gt;</description>
    </item>
    <item>
      <title>bsdfb platform plugin merged to Qt dev branch</title>
      <link>https://kernelnomicon.org/posts/bsdfb-platform-plugin-merged-to-qt-dev-branch/</link>
      <pubDate>Mon, 13 Jun 2016 17:28:22 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/bsdfb-platform-plugin-merged-to-qt-dev-branch/</guid>
      <description>&lt;p&gt;Few weeks back Ralf Nolden, who is *BSD champion in Qt community, urged me to clean-up and submit my Qt5-related projects to upstream and &lt;a href=&#34;https://github.com/gonzoua/qt-platform-scfb&#34;&gt;scfb platform plugin&lt;/a&gt; was picked as a test dummy. It took  &lt;a href=&#34;https://codereview.qt-project.org/#/c/159316/&#34;&gt;12 iterations&lt;/a&gt; to get things right, along the way plugin was renamed to bsdfb, but eventually patch has been &lt;a href=&#34;https://github.com/qtproject/qtbase/commit/1542d8881fc5ccbc5918cd4acbe4091ebbd24508&#34;&gt;merged&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Next two candidates are &lt;a href=&#34;https://github.com/gonzoua/qt5-bsd-input&#34;&gt;bsdkeyboard and bsdsysmouse input plugins&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>VirtualBox Shared Folders: One VOP at a Time</title>
      <link>https://kernelnomicon.org/posts/virtualbox-shared-folders-one-vop-at-a-time/</link>
      <pubDate>Sun, 12 Jun 2016 18:31:32 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/virtualbox-shared-folders-one-vop-at-a-time/</guid>
      <description>&lt;p&gt;Two months ago I tried to setup dev environment using FreeBSD Vagrant box just to find out that FreeBSD does not support VirtualBox shared folders. After some googling I found Li-Wen Hsu&amp;rsquo;s github &lt;a href=&#34;https://github.com/lwhsu/freebsd-vboxfs&#34;&gt;repository&lt;/a&gt; with some work in this area. Li-Wen and Will Andrews has already done major chunk of work: patches to VirtualBox build system, skeleton VFS driver, API to talk to hypervisor but hit a block with some implementation details in VirtualBox&amp;rsquo;s virtual-memory compatibility layer. Will provided &lt;a href=&#34;https://github.com/lwhsu/freebsd-vboxfs/blob/master/vboxvfs/vboxvfs_prov.c#L131&#34;&gt;very comprehensive analysis&lt;/a&gt; of the problem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>gpiokeys support committed</title>
      <link>https://kernelnomicon.org/posts/gpiokeys-support-committed/</link>
      <pubDate>Fri, 20 May 2016 17:10:36 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/gpiokeys-support-committed/</guid>
      <description>&lt;p&gt;To those who do not track FreeBSD commit messages: I committed gpiokeys driver to -CURRENT as &lt;a href=&#34;https://svnweb.freebsd.org/base?view=revision&amp;amp;revision=299475&#34;&gt;r299475&lt;/a&gt;. The driver is not enabled in any of the kernels but can be built as a loadable module.&lt;/p&gt;
&lt;p&gt;For now it stays disconnected from main build because it breaks some MIPS kernel configs. Configs in question include &amp;ldquo;modules/gpio&amp;rdquo; as part of MODULES_OVERRIDE variable and since gpiokeys can be built only with FDT-enabled kernel the build fails.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Qt 5.6 is here and it runs on FreeBSD/Pi</title>
      <link>https://kernelnomicon.org/posts/qt-5-6-is-here-and-it-runs-on-freebsdpi/</link>
      <pubDate>Sun, 20 Mar 2016 13:11:32 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/qt-5-6-is-here-and-it-runs-on-freebsdpi/</guid>
      <description>&lt;p&gt;Qt 5.6 is finally out so I thought I&amp;rsquo;d give it a spin on my Raspberry Pi. Previously I used cross-compilation but this time I thought I&amp;rsquo;d spend some time in trying to create ports Qt modules. There is Qt 5.5.1 in ports and it&amp;rsquo;s nicely split into sub-ports and most of gory details are hidden in bsd.qt.mk library. The problem with it is it&amp;rsquo;s highly coupled with Xorg stuff and I didn&amp;rsquo;t find easy way to squeeze non-desktop use cases into current infrastructure. So I just created new &lt;a href=&#34;https://github.com/gonzoua/experimental-freebsd-ports&#34;&gt;custom devel/qt56 port&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FreeBSD, BBB and 4DCAPE-43T</title>
      <link>https://kernelnomicon.org/posts/freebsd-bbb-and-4dcape-43t/</link>
      <pubDate>Sun, 04 Oct 2015 18:49:07 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/freebsd-bbb-and-4dcape-43t/</guid>
      <description>&lt;p&gt;Short demo of FreeBSD running on Beaglebone Black with &lt;a href=&#34;http://www.4dsystems.com.au/product/4DCAPE_43/&#34;&gt;4DCAPE-43T&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=4Vn_L_UzQhc&#34;&gt;https://www.youtube.com/watch?v=4Vn_L_UzQhc&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used vendor-provided am335x-boneblack-4dcape-43t.dts file to generate dtb, you can download compiled blob &lt;a href=&#34;http://people.freebsd.org/~gonzo/arm/patches/am335x-boneblack-4dcape-43t.dtb&#34;&gt;here&lt;/a&gt;. The system running on demo is &lt;a href=&#34;https://github.com/gonzoua/freebsd/tree/gpiokeys&#34;&gt;gpiokeys branch&lt;/a&gt; of my git repo: . Patch against -head is &lt;a href=&#34;http://people.freebsd.org/~gonzo/arm/patches/bbb-gpiokeys.diff&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re interested only in LCD screen - it&amp;rsquo;s supported by -head but you&amp;rsquo;ll need to either add &lt;code&gt;device gpiobacklight&lt;/code&gt; to BEAGLEBONE kernel config or enable LCD backlight manually using gpioctl: &lt;code&gt;gpioctl -f /dev/gpioc1 18 1&lt;/code&gt;. gpiokeys is somewhat more complex thing and still WIP, there are some pieces missing in HEAD I had to hack around to make them work. And I haven&amp;rsquo;t started research on touchscreen yet.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FDT overlays in FreeBSD</title>
      <link>https://kernelnomicon.org/posts/fdt-overlays-in-freebsd/</link>
      <pubDate>Fri, 24 Jul 2015 15:17:35 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/fdt-overlays-in-freebsd/</guid>
      <description>&lt;p&gt;FDT overlay is an extension to FDT format that lets user to modify base FDT run-time: add new nodes, add new properties to existing nodes or modify existing properties. It&amp;rsquo;s useful when you have base board and some extension units like cape/shield for Pi/BBB or loadable FPGA logic for Zynq. I will not go into details you can find internals described on &lt;a href=&#34;https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/device-tree-overlays&#34;&gt;Adafruit&lt;/a&gt; or &lt;a href=&#34;https://www.raspberrypi.org/documentation/configuration/device-tree.md&#34;&gt;Raspberry Pi&lt;/a&gt; websites.&lt;/p&gt;
&lt;p&gt;When dealing with overlays there are two options where to handle them: loader or kernel. Managing overlays at kernel level gives more flexibility but requires more related logic, e.g. re-init pinmux after applying overlay, re-run newbus probe/attach. On the other hand loader-level support is quite straightforward and involves nothing but DTB modifications and it&amp;rsquo;s a natural first step to adding FDT overlays to FreeBSD.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Qt5 for FreeBSD/Pi</title>
      <link>https://kernelnomicon.org/posts/qt5-for-freebsdpi/</link>
      <pubDate>Wed, 14 Jan 2015 20:26:55 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/qt5-for-freebsdpi/</guid>
      <description>&lt;p&gt;Build SD card image using crochet-freebsd with &lt;code&gt;option VideoCore&lt;/code&gt; enabled. Mount either SD card itself of image to build host&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mount /dev/mmcsd0s2a /pi
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Checkout Qt5 sources and patch them&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd /src
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone git://gitorious.org/qt/qt5.git qt5
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd qt5
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout 5.4.0
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;MODULES=qtbase,qtdeclarative,qtgraphicaleffects,qtimageformats,qtquick1,qtquickcontrols,qtscript,qtsvg,qtxmlpatterns
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;./init-repository --module-subset=$MODULES
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;fetch -q -o - http://people.freebsd.org/~gonzo/arm/rpi/qt5-freebsd-pi.diff | patch -p1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Configure, build and install Qt5 to SD card&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;./configure -platform unsupported/freebsd-clang -no-openssl -opengl es2 -device freebsd-rasp-pi-clang -device-option CROSS_COMPILE=/usr/armv6-freebsd/usr/bin/ -sysroot /pi/ -no-gcc-sysroot -opensource -confirm-license -optimized-qmake -release -prefix /usr/local/Qt5 -no-pch -nomake tests -nomake examples -plugin-sql-sqlite
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gmake -j `sysctl -n hw.ncpu`
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo gmake install
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You need BSD-specific plugins to enable mouse and keyboard input in EGLFS mode&lt;/p&gt;</description>
    </item>
    <item>
      <title>Audio on Raspberry Pi</title>
      <link>https://kernelnomicon.org/posts/audio-on-raspberry-pi/</link>
      <pubDate>Fri, 09 Jan 2015 23:25:08 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/audio-on-raspberry-pi/</guid>
      <description>&lt;p&gt;With stable VCHIQ driver next obvious target was to add VCHIQ-based audio support. So let me introduce to you: vchiq_audio, first take. It&amp;rsquo;s part of vchiq-freebsd repo so if you use Crochet to build SD card image just enable &lt;code&gt;option VideoCore&lt;/code&gt; in config file and module will be automatically included.&lt;/p&gt;
&lt;p&gt;From shell run &lt;code&gt;kldload vchiq_audio&lt;/code&gt; and you&amp;rsquo;re good to do. I believe that audio output is picked up automatically by VideoCore so if you have HDMI connected it&amp;rsquo;s probably going to be HDMI. I do not have device to confirm this. Adding knob to control audio output (auto, headphones, HDMI) is on my ToDo list.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Update on FreeBSD/armv6 in QEMU</title>
      <link>https://kernelnomicon.org/posts/update-on-freebsdarmv6-in-qemu/</link>
      <pubDate>Sat, 29 Jun 2013 17:37:58 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/update-on-freebsdarmv6-in-qemu/</guid>
      <description>&lt;p&gt;QEMU support in FreeBSD/armv6 regressed since I tried it last time few months back. Changes in FreeBSD kernel and in QEMU itself revealed bugs that were masked by previous behaviour.&lt;/p&gt;
&lt;p&gt;In FreeBSD it was r248467: the way memory/IO resources are activated on FDT bus has been changed and it triggered bug in versatile_pci.c&lt;/p&gt;
&lt;p&gt;The other issue is more complex. It seems that PCI IRQ routing in QEMU was out of sync with real hardware. So after &lt;a href=&#34;https://github.com/qemu/qemu/commit/66a96d7018b9cbabb73c9b87b62a37e4cc46580a&#34;&gt;commit 66a96d7018b9cbabb73c9b87b62a37e4cc46580a&lt;/a&gt; IRQ numbers assigned to PCI devices by FreeBSD kernel by default were invalid. Authors of QEMU eventually added compatibility knob to fall back to previous logic. So if you&amp;rsquo;re using QEMU 1.5 or later add this option to your command line:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Raspberry Pi console</title>
      <link>https://kernelnomicon.org/posts/raspberry-pi-console/</link>
      <pubDate>Mon, 24 Jun 2013 18:47:32 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/raspberry-pi-console/</guid>
      <description>&lt;p&gt;Quick hint. If you did not disable &lt;strong&gt;&amp;ldquo;device sc&amp;rdquo;&lt;/strong&gt; in kernel config all the message from kernel go to video console. But if something bad happened after kernel started and before framebuffer driver is activated all you&amp;rsquo;ll see would be &lt;strong&gt;&amp;ldquo;Kernel args: (null)&amp;rdquo;&lt;/strong&gt; message on serial console which is not very helpful. So in order to debug this problem and have kernel boot messages on both monitor and serial port without recompiling kernel just add following line to /boot/loader.rc on SD card:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Work in Progress: LCD driver for AM335x evaluation module</title>
      <link>https://kernelnomicon.org/posts/work-in-progress-lcd-driver-for-am335x-evaluation-module/</link>
      <pubDate>Sun, 05 May 2013 17:25:57 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/work-in-progress-lcd-driver-for-am335x-evaluation-module/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m trying to wrap up some project I started working on quite some time ago and this is first chunk of clean-up.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://people.freebsd.org/~gonzo/arm/patches/am335x-pwm-lcd.diff&#34;&gt;Patch&lt;/a&gt;contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kernel config for AM335x EVM&lt;/li&gt;
&lt;li&gt;dts file for AM335x EVM with TFT panel info&lt;/li&gt;
&lt;li&gt;LCD controller driver with some functionality missing: only 24/32 bit depth and only TFT mode is supported&lt;/li&gt;
&lt;li&gt;Really simple PWM driver. LCD backlight is controlled through eCAS submodule of PWMSS0 module.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tested it only on evaluation module, although I think with proper panel/pinmux configuration it should work with BeagleBone&amp;rsquo;s LCD caps too.
Parts missing: adjusting clock to proper pixel frequency, proper allocation of framebuffer memory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FDT driver skeleton generator</title>
      <link>https://kernelnomicon.org/posts/fdt-driver-skeleton-generator/</link>
      <pubDate>Fri, 03 May 2013 11:20:14 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/fdt-driver-skeleton-generator/</guid>
      <description>&lt;p&gt;Writing new driver for FDT-based device always involves several simple steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;writing generic newbus driver skeleton&lt;/li&gt;
&lt;li&gt;Checking for compatibility of node in probe routine&lt;/li&gt;
&lt;li&gt;Allocate memory/IRQ resources in attach routine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I can&amp;rsquo;t say for other developers but I just copy existing driver, remove all device-specific stuff and rewrite generic stuff. Which is less time-consuming then writing it from scratch but time-consuming it is. Being huge fan of automation of any kind I decided to let computer do all this dumb work and leave creative part (copy-pasting registers definition from spec to code) to myself. the result is &lt;a href=&#34;https://github.com/gonzoua/freebsd-misc/tree/master/fdt_skeleton&#34;&gt;this script&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Netbooting ARM/MIPS devices: kinds of kernel and u-boot</title>
      <link>https://kernelnomicon.org/posts/netbooting-armmips-devices-kinds-of-kernel-and-u-boot/</link>
      <pubDate>Fri, 15 Feb 2013 16:33:58 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/netbooting-armmips-devices-kinds-of-kernel-and-u-boot/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.denx.de/wiki/U-Boot&#34;&gt;U-Boot&lt;/a&gt; is a boot loader. Its task is to get kernel into memory and pass control to it. I will cover only parts of it related to netboot.&lt;/p&gt;
&lt;h2 id=&#34;kernel-or-kernelbin&#34;&gt;kernel or kernel.bin&lt;/h2&gt;
&lt;p&gt;But before we start loading something we need to know what to load. In &lt;a href=&#34;http://kernelnomicon.org/?p=306&#34;&gt;previous post&lt;/a&gt; I mentioned that there are kernel, kernel.bin, and ubldr files. Let&amp;rsquo;s get into details. First of all: ubldr requires its own post. So there will be one more covering just ubldr. Now kernel and kernel.bin.&lt;/p&gt;</description>
    </item>
    <item>
      <title>VCHIQ drivers work again</title>
      <link>https://kernelnomicon.org/posts/vchiq-drivers-work-again/</link>
      <pubDate>Sun, 13 Jan 2013 19:19:10 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/vchiq-drivers-work-again/</guid>
      <description>&lt;p&gt;I synced both &lt;a href=&#34;https://github.com/gonzoua/vchiq-freebsd&#34;&gt;vchiq-freebsd&lt;/a&gt; and &lt;a href=&#34;https://github.com/gonzoua/userland&#34;&gt;userland&lt;/a&gt; to latest and greatest.&lt;/p&gt;
&lt;p&gt;As I mentioned earlier - OS compatibility shim was removed from upstream sources so I had to create Linux KPI implementation layer which turned out not that awful task because I managed to reuse a lot of code from Max Khon&amp;rsquo;s &lt;a href=&#34;http://freebsdfoundation.blogspot.com/2010/10/update-on-dahdi-project.html&#34;&gt;DAHDI port&lt;/a&gt;. I had to implement (in somewhat hackish fashion) kthread API, re-implement semaphores support using condvar and mutex in order to get _interruptible part of API working properly and create dumb implementation of rather small subset of Linux list.h API.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FreeBSD/armv6: what&#39;s new and exciting?</title>
      <link>https://kernelnomicon.org/posts/freebsdarmv6-whats-new-and-exciting/</link>
      <pubDate>Sun, 30 Dec 2012 17:51:03 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/freebsdarmv6-whats-new-and-exciting/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s been a while since last update on the project status so it might seem as there was no progress in this area. The reality is: there is a bunch of activities happening with various levels of success. So I decided to give kind of end-of-the-year round-up of ongoing projects, plans and obstacles ARM hackers face.&lt;/p&gt;
&lt;p&gt;First of all we tried switching default cache type from write-through to write-back type. It should have increased performance but instead opened a can of worms. Memory corruption debugging led to L2 cache driver on Pandaboard, EHCI driver code and subsequently to busdma code. Whole process took quite a few days full of hair-pulling and nagging various people and ended up in committing USB fixes and Ian Lepore&amp;rsquo;s busdma patches. PL310 (L2 cache controller) driver is being tested at this very moment. Original issue (WB caches) still stands and postponed till next year.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cross-compilation hiccups</title>
      <link>https://kernelnomicon.org/posts/cross-compilation-hickups/</link>
      <pubDate>Sat, 01 Dec 2012 14:01:36 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/cross-compilation-hickups/</guid>
      <description>&lt;p&gt;Good news and bad news. Let&amp;rsquo;s start with good ones.&lt;/p&gt;
&lt;p&gt;Daisuke Aoyama tracked down what causes &amp;ldquo;Unrecognized filesystem type&amp;rdquo; error with some SD cards. It is U-Boot using High Speed mode. Root cause is still unknown but as a workaround I just disabled HS mode for SD card in u-boot and updated freebsd-uboot-20121129.tar.gz. Or alternatively you can get &lt;a href=&#34;http://people.freebsd.org/~gonzo/arm/rpi/uboot-nohs.img&#34;&gt;uboot-nohs.img&lt;/a&gt; and use it to replace uboot.img on your SD card.&lt;/p&gt;
&lt;p&gt;Bad news are: installworld for cross-compiled FreeBSD is broken unless you&amp;rsquo;re doing it on the latest HEAD. The reason is utility called mtree(8). It is used to ensure that target filesystem permissions and owners/groups are correct. Owners and groups are described as usernames and group names, not as numeric UIDs/GUIDs and mtree uses getpwXXX family of routines to convert names to numeric values. See the problem already? If new system user is added to latest HEAD and you use old trusty FreeBSD 9.0, there is no way mtree would know about this user. NetBSD solved this problem by introducing -N command-line option that lets you point mtree to the &lt;strong&gt;target&lt;/strong&gt; system&amp;rsquo;s master.passwd and groups. So we need to port this feature to FreeBSD in order to get proper cross-compilation environment. And that&amp;rsquo;s my plan for next few days.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FreeBSD on Pi: more stuff</title>
      <link>https://kernelnomicon.org/posts/freebsd-on-pi-more-stuff/</link>
      <pubDate>Thu, 29 Nov 2012 21:21:19 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/freebsd-on-pi-more-stuff/</guid>
      <description>&lt;p&gt;Long overdue update on how the things are going with FreeBSD on Raspberry Pi. We&amp;rsquo;ve made some good progress so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hans Petter Selasky fixed low-speed interrupt endpoints problem which means we have working USB keyboard now&lt;/li&gt;
&lt;li&gt;GPIO driver by Luiz Otavio O Souza. So now you can blink OK LED (gpioctl -f /dev/gpioc0 -t 16). Not the most productive activity though.&lt;/li&gt;
&lt;li&gt;Kernel now obtains information about display resolution, memory layout, MAC address from firmware&lt;/li&gt;
&lt;li&gt;Framebuffer/syscons support added&lt;/li&gt;
&lt;li&gt;Some stability fixes for SDHCI/li&amp;gt;
Initial port of VCHIQ interface (&lt;a href=&#34;https://github.com/gonzoua/vchiq-freebsd&#34;&gt;vchiq-freebsd&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Port of userland libraries (&lt;a href=&#34;https://github.com/gonzoua/userland&#34;&gt;userland&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Overall stability and performance is still a problem, but it&amp;rsquo;s what we&amp;rsquo;re going to work on next.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Flyswatter JTAG and AVR32</title>
      <link>https://kernelnomicon.org/posts/flyswatter-jtag-and-avr32/</link>
      <pubDate>Mon, 09 Aug 2010 04:21:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/flyswatter-jtag-and-avr32/</guid>
      <description>&lt;p&gt;Today I soldered AVR32 adapter for Flyswatter JTAG. Actually it&amp;rsquo;s very simple task - just connect respective pins and make common ground wire. No capacitors, resistors or MOSFETs. Idea was to make it nice and neat but having bought wrong breadboard and soldered first headers in a wrong place I just let it flow and here it is:&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;http://lh6.ggpht.com/_bTtZWrFtKsc/TF9749h_xnI/AAAAAAAAFYI/NgKmDdyq0_8/IMGP9940.JPG&#34;&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;http://lh3.ggpht.com/_bTtZWrFtKsc/TF975cHy0SI/AAAAAAAAFYM/Uy6SNPtWw8Q/IMGP9941.JPG&#34;&gt;&lt;/p&gt;
&lt;p&gt;From aesthetics point of view suck, but it also works and it&amp;rsquo;s everything I need:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Minor OpenOCD fixes</title>
      <link>https://kernelnomicon.org/posts/minor-openocd-fixes/</link>
      <pubDate>Tue, 06 Jul 2010 03:00:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/minor-openocd-fixes/</guid>
      <description>&lt;p&gt;Back from the land of GUI software. I have bought one more Flyswatter JTAG recently and now have two boards connected to my home box. Unfortunately both Flyswatters got the same USB serial number so stock openocd opens only the first device it stumbles upon. Here is &lt;a href=&#34;http://people.freebsd.org/~gonzo/openocd/ftdi_index.diff&#34;&gt;small patch&lt;/a&gt; that adds ft2232_index command to OpenOCD FTDI driver that allows to point at specific device to open. Works only with libftdi.  In the same directory you can find my configs for AR71XX-based RouterStation Pro and Portwell&amp;rsquo;s CAM-0010 device based on Octeon CN3010&lt;/p&gt;</description>
    </item>
    <item>
      <title>Writing FreeBSD NIC driver</title>
      <link>https://kernelnomicon.org/posts/writing-freebsd-nic-driver/</link>
      <pubDate>Fri, 19 Feb 2010 06:22:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/writing-freebsd-nic-driver/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been through writing NIC driver 2.5 times. 0.5 was porting ADM5120 switch driver by Ruslan Ermilov and Vsevolod Lobko from NetBSD. The usual routine for this kind of thing is &amp;ldquo;take existing driver and rewrite it&amp;rdquo;, e.g. copy selected parts or remove unnecessary ones. So I decided that it would be nice to skip &amp;ldquo;remove&amp;rdquo; part of procedure next time.&lt;/p&gt;
&lt;p&gt;All cards I had to deal with (&amp;ldquo;both&amp;rdquo; wouldn&amp;rsquo;t be that impressive here) had similar design save for registers layout and some quirks. I believe that vast majority of NICs have the same design to some extent: there are circular RX/TX rings of more or less similar structure, interrupt status/mask register, media settings registers, you name it. Not a rocket science.&lt;/p&gt;</description>
    </item>
    <item>
      <title>projects/mips RIP</title>
      <link>https://kernelnomicon.org/posts/projectsmips-rip/</link>
      <pubDate>Mon, 11 Jan 2010 19:45:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/projectsmips-rip/</guid>
      <description>&lt;p&gt;All changes from projects/mips has been merged to HEAD. Kudos go to imp@ for sieving through mergeinfo mess projects/mips has been.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FreeBSD/mips and LLVM</title>
      <link>https://kernelnomicon.org/posts/freebsdmips-and-llvm/</link>
      <pubDate>Fri, 08 Jan 2010 23:12:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/freebsdmips-and-llvm/</guid>
      <description>&lt;p&gt;Good news: LLVM builds fine on RouterStation Pro with root mounted over NFS.&lt;/p&gt;
&lt;p&gt;Bad news: it segfaults on some tests and when trying to build hello world application.&lt;/p&gt;
&lt;p&gt;Stay tuned&lt;/p&gt;</description>
    </item>
    <item>
      <title>ohloh and FreeBSD</title>
      <link>https://kernelnomicon.org/posts/ohloh-and-freebsd/</link>
      <pubDate>Tue, 05 May 2009 20:37:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/ohloh-and-freebsd/</guid>
      <description>&lt;p&gt;ohloh seems to be unable to grind FreeBSD&amp;rsquo;s svn repo. I&amp;rsquo;ve been watching for its efforts for several days now and commits progress meter resets from time to time:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.ohloh.net/p/freebsd/enlistments&#34;&gt;https://www.ohloh.net/p/freebsd/enlistments&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>singleuser on routerstation</title>
      <link>https://kernelnomicon.org/posts/singleuser-on-routerstation/</link>
      <pubDate>Fri, 01 May 2009 05:23:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/singleuser-on-routerstation/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://people.freebsd.org/~gonzo/mips/routerstation.log&#34;&gt;http://people.freebsd.org/~gonzo/mips/routerstation.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some issues still pending though. Cache management is major one. Things seemed to work fine in emulation but backfired into face with real hardware. I ran into several &amp;ldquo;random&amp;rdquo; bugs that were narrowed down to caches. More to go :( Also ethernet driver performance is low but it&amp;rsquo;s easier then hunting down ethereal cache matters. Or so I think.&lt;/p&gt;
&lt;p&gt;This weekend will be dedicated to making openocd work with routerstation, learning debugging and profiling techniques for MIPS hardware and improving FreeBSD/MIPS pieces of DDB.&lt;/p&gt;</description>
    </item>
    <item>
      <title>JTAG, OpenOCD &amp; FreeBSD</title>
      <link>https://kernelnomicon.org/posts/jtag-openocd-freebsd/</link>
      <pubDate>Sun, 19 Apr 2009 18:51:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/jtag-openocd-freebsd/</guid>
      <description>&lt;p&gt;As it was &lt;a href=&#34;http://bsddev.blogspot.com/2009/02/wip-ubiquitys-router-station.html&#34;&gt;mentioned earlier&lt;/a&gt; now I have new cool toy to play with. Flyswatter JTAG with MIPS14 adapter. Though Tin Can Tools kindly warned me that OpenOCD did not support EJTAG/MIPS I decided to order it and it turned to be a good deal. Why? Because there is EJTAG/MIPS support for OpenOCD as of 0.1.0. Moreover it works really nice with FreeBSD port of libftdi. So all I had to do was to make &lt;a href=&#34;http://people.freebsd.org/~gonzo/ports/openocd.tar&#34;&gt;devel/openocd&lt;/a&gt; port and tweak some configs. And that&amp;rsquo;s it. Stock gdb for MIPS is not ready yet, but one can attach, examine registers, single step using telnet interface to daemon:&lt;/p&gt;</description>
    </item>
    <item>
      <title>svk &amp; vim</title>
      <link>https://kernelnomicon.org/posts/svk-vim/</link>
      <pubDate>Fri, 10 Apr 2009 16:45:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/svk-vim/</guid>
      <description>&lt;p&gt;My SCM of choice for FreeBSD-related projects is SVK (it&amp;rsquo;s much faster then subversion and provides offline access to repo history, easy branching/merging and so on). And my editor of choice is vim. And it turns out vim doesn&amp;rsquo;t highlight svk commit files. What a shame. No bright colors for happy hacker who is about to commit clean and robust code (or break buildworld, whatever).  So I spent 20 minutes of tweaking svn.vim and produced &lt;a href=&#34;http://www.vim.org/scripts/script.php?script_id=2604&#34;&gt;this&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WIP: Ubiquity&#39;s router station</title>
      <link>https://kernelnomicon.org/posts/wip-ubiquitys-router-station/</link>
      <pubDate>Thu, 26 Feb 2009 21:30:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/wip-ubiquitys-router-station/</guid>
      <description>&lt;p&gt;So it has been a month since last post about this device and I think it&amp;rsquo;s time to announce current state of affairs.&lt;/p&gt;
&lt;p&gt;At the moment further progress was blocked with something that looks like memory corruption. It&amp;rsquo;s hard to trace with ktr(4) and printf(9) so I ordered &lt;a href=&#34;http://www.tincantools.com/product.php?productid=16134&#34;&gt;Flyswatter JTAG adapter&lt;/a&gt; and &lt;a href=&#34;http://www.tincantools.com/product.php?productid=16145&amp;amp;cat=251&amp;amp;page=1&#34;&gt;MIPS14 adapter&lt;/a&gt; from Tin Can Tools. I was warned that Flyswatter/MIPS combination is not supported by OpenOCD but I&amp;rsquo;d better spend some time making it work then tracing obscure memory corruptions in the wild.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Thinkpad T400 and FreeBSD</title>
      <link>https://kernelnomicon.org/posts/thinkpad-t400-and-freebsd/</link>
      <pubDate>Thu, 22 Jan 2009 01:12:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/thinkpad-t400-and-freebsd/</guid>
      <description>&lt;p&gt;Finally I got my hands on new and shiny Lenovo Thinkpad T400. What can I say? It&amp;rsquo;s cool. My only complaint about T60 was its somewhat dim display (yes, I tried to save some money on this vital part and got punished). This time I ordered model with LED backlight and it&amp;rsquo;s worth every dime spent :)&lt;/p&gt;
&lt;p&gt;My configuration also included Atheros wifi, built-in bluetooth, Intel GMA X4500 graphics (I&amp;rsquo;m not in games, really). Unfortunately 7.1 was able to run wifi. Newer HAL did the trick though and here I am: eating my own dog food - running -CURRENT on a workhorse.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Joy of Bugbusting</title>
      <link>https://kernelnomicon.org/posts/the-joy-of-bugbusting/</link>
      <pubDate>Wed, 11 Jun 2008 14:11:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/the-joy-of-bugbusting/</guid>
      <description>&lt;p&gt;While waiting for MIPS toolchain import to happen I entertain myself with bugbusting. You should try it sometime. GNATS jungle, small and large bugs are sneaking around, scent of rotten emails in the air. I don&amp;rsquo;t feel like hunting down large bugs. They&amp;rsquo;re dangerous beasts. It&amp;rsquo;s much better to deal with small ones. Pick a (one|two|three|up-to-twenty)-liner and fix it. Then you can bring it home, varnish it and eventually MFC it. Nice outdoor activity for developers :)&lt;/p&gt;</description>
    </item>
    <item>
      <title>bsddev blog SitRep</title>
      <link>https://kernelnomicon.org/posts/bsddev-blog-sitrep/</link>
      <pubDate>Thu, 29 May 2008 14:36:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/bsddev-blog-sitrep/</guid>
      <description>&lt;p&gt;Long time no blog. Many things have happened during last 6 months: I got a commit bit, FreeBSD/MIPS reached multiuser and started migration from P4 to CVS. Right now we&amp;rsquo;re waiting for toolchain patches to be imported to contrib/binutils properly. So let&amp;rsquo;s prepare to celebrate buildable FreeBSD/MIPS world in a couple of weeks! Meanwhile I&amp;rsquo;m busy with getting latest zaptel (they changed name to DAHDI, actually) drivers to FreeBSD and a couple of side aсtivities like digging into aio code from OpenSolaris/Linux/FreeBSD. Hope to blog more regularly now. Stay tuned.&lt;/p&gt;</description>
    </item>
    <item>
      <title>NY gift from Juniper</title>
      <link>https://kernelnomicon.org/posts/ny-gift-from-juniper/</link>
      <pubDate>Fri, 28 Dec 2007 14:57:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/ny-gift-from-juniper/</guid>
      <description>&lt;p&gt;Juniper released FreeBSD/MIPS port to public. There are no references to JNPR-specific hardware pieces but a lot of mature code for generic MIPS devices that mips2 tree lacks: VM/pmap, libc, FPU support. Nice gift, thanks JNPR!&lt;/p&gt;</description>
    </item>
    <item>
      <title>RB532 progress</title>
      <link>https://kernelnomicon.org/posts/rb532-progress/</link>
      <pubDate>Sun, 09 Dec 2007 19:37:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/rb532-progress/</guid>
      <description>&lt;p&gt;This weekend I spent writing driver for IDT RC32434 on-board Ethernet adapter. Weird hobby, isn&amp;rsquo;t it? Writing NIC drivers is new to me so I shared my time between reading if_XX sources, reading IDT specs and writing my own code. Task turned out easier then it appeared and 15 minutes ago I managed to mount root over NFS using kr0 interface. Time to get some beer and celebrate!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mikrotik RB532 - single user mode.</title>
      <link>https://kernelnomicon.org/posts/mikrotik-rb532-single-user-mode/</link>
      <pubDate>Sat, 01 Dec 2007 23:38:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/mikrotik-rb532-single-user-mode/</guid>
      <description>&lt;p&gt;Today I managed to get shell prompt on Mikrotik&amp;rsquo;s Routerboard 532. So now we have 3 platforms with single user mode for FreeBSD/mips, not very useful :)  The last problem was getting high-level console interface working. I always fell lost when it comes to resource allocation and uart stuff. I should write a couple of posts on these subjects to memorize all details better.&lt;/p&gt;</description>
    </item>
    <item>
      <title>INTR_FAST and selwakeup</title>
      <link>https://kernelnomicon.org/posts/intr_fast-and-selwakeup/</link>
      <pubDate>Sun, 25 Nov 2007 13:22:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/intr_fast-and-selwakeup/</guid>
      <description>&lt;p&gt;I stumbled over this problem a couple of years ago, ignored it, was punished for my carelessness, came out with hackerish solution and now I know &amp;ldquo;The Right Way&amp;rdquo; to solve this issue. So, the headache starts when you&amp;rsquo;re trying to wakeup userland application polling on a descriptor from INTR_FAST IRQ handler (for 7.X and later that would be interrupt filter). INTR_FAST/interrupt filter  routines are usually used for timing-critical tasks and run in IRQ dispatcher context, so no operations that may cause context switch are allowed in this code. Unfortunately &lt;a href=&#34;http://www.freebsd.org/cgi/man.cgi?query=selwakeup&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+7-current&amp;amp;format=html&#34;&gt;selwakeup(9)&lt;/a&gt; tries to acquire sellock that leads to a possible context switch and leaves us in a total mess. My solution was handmade kernel thread that has been running through list of channels and performed all dirty work, not the cleanest and easiest to maintain code. &amp;ldquo;Zaptel-bsd take 2&amp;rdquo; utilizes &lt;a href=&#34;http://www.freebsd.org/cgi/man.cgi?query=taskqueue&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+7-current&amp;amp;format=html&#34;&gt;taskqueue(9)&lt;/a&gt; interface to work around IRQ handler limitations. There is handler routine:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Module/kernel parameters</title>
      <link>https://kernelnomicon.org/posts/modulekernel-parameters/</link>
      <pubDate>Tue, 20 Nov 2007 20:58:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/modulekernel-parameters/</guid>
      <description>&lt;p&gt;Sometimes it&amp;rsquo;s desirable to pass some arguments to module to customize its behavior, e.g.: to set/unset verbosity level of debug output, set operation mode etc&amp;hellip; Linux modules can get this information from insmod utility, but kldload is not capable of doing such kind of things. What a pity. But don&amp;rsquo;t get desperate - tunables to the rescue!&lt;/p&gt;
&lt;p&gt;Just like an ordinary command shell (bash, csh, sh) kernel has its own environment, the set of &amp;lt;name, value&amp;gt; pairs. You can get, set, test, unset these variables using &lt;strong&gt;getenv&lt;/strong&gt;, &lt;strong&gt;setenv&lt;/strong&gt;, &lt;strong&gt;testenv&lt;/strong&gt;, &lt;strong&gt;unsetenv&lt;/strong&gt; functions in the kernel and &lt;a href=&#34;http://www.freebsd.org/cgi/man.cgi?query=kenv&amp;amp;sektion=2&amp;amp;apropos=0&amp;amp;manpath=FreeBSD+7-current&#34;&gt;&lt;strong&gt;kenv(2)&lt;/strong&gt;&lt;/a&gt; syscall or &lt;a href=&#34;http://www.freebsd.org/cgi/man.cgi?query=kenv&amp;amp;sektion=1&amp;amp;apropos=0&amp;amp;manpath=FreeBSD+7-current&#34;&gt;&lt;strong&gt;kenv(1)&lt;/strong&gt;&lt;/a&gt; command in userland. So if you want to set verbosity level for module, you would do something like this:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
