[UPDATE: Revise instructions and links to use latest upstream nabla repo with merged aarch64 support.]

In previous posts, we covered a bit of background on rumprun, the nabla containers fork and our port on aarch64. In this post, we describe how to build everything from source. In order to build a rumprun unikernel for aarch64, the first step is to build the rumprun toolchain.

Clone the relevant repositories:

1git clone https://github.com/nabla-containers/rumprun
2git clone https://github.com/cloudkernels/rumprun-packages
1cd rumprun
2git submodule update --init

Build rumprun with:

1cd rumprun
2make

The build is tested with gcc-5 but it should work with gcc versions up to 6. If you need to explicitly set the gcc version use:

1cd rumprun
2CC=<gcc-version> make

Solo5 is now built by default as part of the nabla-containers code distribution.

Build (& bake) hello (both hvt and spt versions):

1cd rumprun-packages
2cd hello
3make

Output is the following:

 1mkdir -p build
 2cp src/* build
 3CC=aarch64-rumprun-netbsd-gcc make -C build hello.spt
 4make[1]: Entering directory '/build/rumprun-packages/hello/build'
 5aarch64-rumprun-netbsd-gcc hello.c -o hello-rumprun
 6rumprun-bake solo5_spt hello.spt hello-rumprun
 7
 8!!!
 9!!! NOTE: rumprun-bake is experimental. syntax may change in the future
10!!!
11
12make[1]: Leaving directory '/build/rumprun-packages/hello/build'
13mkdir -p bin
14cp build/hello.spt bin/hello.spt
15CC=aarch64-rumprun-netbsd-gcc make -C build hello.hvt
16make[1]: Entering directory '/build/rumprun-packages/hello/build'
17rumprun-bake solo5_hvt hello.hvt hello-rumprun
18
19!!!
20!!! NOTE: rumprun-bake is experimental. syntax may change in the future
21!!!
22
23make[1]: Leaving directory '/build/rumprun-packages/hello/build'
24mkdir -p bin
25cp build/hello.hvt bin/hello.hvt

Try to run both (an existing dummy file and tap0 device are expected):

1../../rumprun/solo5/tenders/hvt/solo5-hvt --disk=dummy --net=tap0 ./bin/hello.hvt

Output:

 1solo5-hvt: bin/hello.hvt: Warning: phdr[0] requests WRITE and EXEC permissions
 2solo5-hvt: WARNING: Tender is configured with HVT_DROP_PRIVILEGES=0. Not dropping any privileges.
 3solo5-hvt: WARNING: This is not recommended for production use.
 4            |      ___|
 5  __|  _ \  |  _ \ __ \
 6\__ \ (   | | (   |  ) |
 7____/\___/ _|\___/____/
 8Solo5: Memory map: 512 MB addressable:
 9Solo5:   reserved @ (0x0 - 0xfffff)
10Solo5:       text @ (0x100000 - 0x30efff)
11Solo5:     rodata @ (0x30f000 - 0x35bfff)
12Solo5:       data @ (0x35c000 - 0x3cafff)
13Solo5:       heap >= 0x3cb000 < stack < 0x20000000
14rump kernel bare metal bootstrap
15
16[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
17[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
18[   1.0000000]     2018 The NetBSD Foundation, Inc.  All rights reserved.
19[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
20[   1.0000000]     The Regents of the University of California.  All rights reserved.
21
22[   1.0000000] NetBSD 8.99.25 (RUMP-ROAST)
23[   1.0000000] total memory = 253 MB
24[   1.0000000] timecounter: Timecounters tick every 10.000 msec
25[   1.0000080] timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
26[   1.0000090] cpu0 at thinair0: rump virtual cpu
27[   1.0000090] root file system type: rumpfs
28[   1.0000090] kern.module.path=/stand/evbarm/8.99.25/modules
29[   1.0200090] mainbus0 (root)
30[   1.0200090] timecounter: Timecounter "bmktc" frequency 1000000000 Hz quality 100
31rumprun: could not find start of json.  no config?
32mounted tmpfs on /tmp
33
34=== calling "rumprun" main() ===
35
36This is the Rumprun Hello World ...
37... using the Solo5 framework ...
38... in a Nabla container via runnc!
39
40=== main() of "rumprun" returned 0 ===
41
42=== _exit(0) called ===
43[   3.0281712] rump kernel halting...
44[   3.0281712] syncing disks... done
45[   3.0281712] unmounting file systems...
46[   3.0281712] unmounted tmpfs on /tmp type tmpfs
47[   3.0281712] unmounted rumpfs on / type rumpfs
48[   3.0281712] unmounting done
49halted
50Solo5: solo5_exit(0) called

and the spt one:

1../../rumprun/solo5/tenders/spt/solo5-spt --disk=dummy --net=tap0 ./bin/hello.spt
 1solo5-spt: bin/hello.spt: Warning: phdr[0] requests WRITE and EXEC permissions
 2            |      ___|
 3  __|  _ \  |  _ \ __ \
 4\__ \ (   | | (   |  ) |
 5____/\___/ _|\___/____/
 6Solo5: Memory map: 512 MB addressable:
 7Solo5:   reserved @ (0x0 - 0xfffff)
 8Solo5:       text @ (0x100000 - 0x30bfff)
 9Solo5:     rodata @ (0x30c000 - 0x357fff)
10Solo5:       data @ (0x358000 - 0x3c6fff)
11Solo5:       heap >= 0x3c7000 < stack < 0x20000000
12rump kernel bare metal bootstrap
13
14[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
15[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
16[   1.0000000]     2018 The NetBSD Foundation, Inc.  All rights reserved.
17[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
18[   1.0000000]     The Regents of the University of California.  All rights reserved.
19
20[   1.0000000] NetBSD 8.99.25 (RUMP-ROAST)
21[   1.0000000] total memory = 253 MB
22[   1.0000000] timecounter: Timecounters tick every 10.000 msec
23[   1.0000080] timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
24[   1.0000090] cpu0 at thinair0: rump virtual cpu
25[   1.0000090] root file system type: rumpfs
26[   1.0000090] kern.module.path=/stand/evbarm/8.99.25/modules
27[   1.0200090] mainbus0 (root)
28[   1.0200090] timecounter: Timecounter "bmktc" frequency 1000000000 Hz quality 100
29rumprun: could not find start of json.  no config?
30mounted tmpfs on /tmp
31
32=== calling "rumprun" main() ===
33
34This is the Rumprun Hello World ...
35... using the Solo5 framework ...
36... in a Nabla container via runnc!
37
38=== main() of "rumprun" returned 0 ===
39
40=== _exit(0) called ===
41[   3.0211861] rump kernel halting...
42[   3.0211861] syncing disks... done
43[   3.0211861] unmounting file systems...
44[   3.0315990] unmounted tmpfs on /tmp type tmpfs
45[   3.0315990] unmounted rumpfs on / type rumpfs
46[   3.0315990] unmounting done
47halted
48Solo5: solo5_exit(0) called