
Gokrazy – a pure-Go userland for Raspberry Pi 3 appliances - dchuk
https://gokrazy.github.io/?hn
======
oxplot
A while ago, I had the "krazy" idea of writing my own single binary Go router
software on top of linux kernel. Turns out it's fairly easy to get up and
running with literally having nothing but a kernel image and a single
executable that gets called on boot. My kernel booted in less than 2 second on
a VM.

~~~
jagger27
I guess the next step would be to try a uni-kernel. ClickOS claims to be able
to boot in 20ms.

[http://unikernel.org/projects/](http://unikernel.org/projects/)

~~~
vog
Also, MigrageOS is amazingly fast, and can use tons of existing OCaml
libraries.

~~~
perbu
Or just use IncludeOS, and you'll have the option to recompile most of the
software out there (as IncludeOS is C++).

~~~
pjmlp
Including the memory corruption bugs written by those that use it as "C with
C++ compiler".

------
mmcwilliams
Very cool project! I'm just getting started with Go and my target platform is
the Raspberry Pi (and other low-powered ARM boards). Will the newly-announced
Zero W support this?

~~~
secure
Unfortunately not. The arm64 architecture is a requirement (see also
[https://www.reddit.com/r/golang/comments/5xgf8u/gokrazy_a_pu...](https://www.reddit.com/r/golang/comments/5xgf8u/gokrazy_a_purego_userland_for_your_raspberry_pi_3/dei7b2m/)),
and the Zero W uses the older BCM2835 SoC, which is not arm64.

~~~
atomi
It's armv6 and golang may be dropping support for it
[https://github.com/golang/go/issues/17082](https://github.com/golang/go/issues/17082)

------
weberc2
The documentation says to compile with GOARCH=amd64; isn't RPI3 an ARM
architecture? Is that a typo, or am I misunderstanding something?

~~~
pdpi
Either a typo that was fixed in the meanwhile, or you misread. It currently
reads "arm64".

~~~
weberc2
Ah, I probably misread. Thanks!

------
orik
this seems fun.

I wonder though if bringing Go or Rust bare metal onto the Pi would give you
the smallest attack surface?

[http://blog.thiago.me/raspberry-pi-bare-metal-programming-
wi...](http://blog.thiago.me/raspberry-pi-bare-metal-programming-with-rust/)

~~~
weberc2
Go doesn't currently run on bare metal, though I think there are forks that
do. At any rate, this would be unusable for most interesting programs unless
you plan to rewrite all of the things the kernel gives you in Go/Rust (though
there are projects which aim to do this as well).

~~~
pjmlp
The most usable thing would be to prove to naysayers that it is possible to
use Go in such scenarios.

Another usable thing would be to program bare metal devices without memory
corruption issues.

------
jeyoor
Anything like this available for .NET Core?

~~~
carussell
Yes, .NET Micro Framework is a thing.

Also what's notable is that it was opened up in 2009--a full five years before
all the hubbub about core and corefx. And it's under Apache 2.0, so if any
organization has any problems swallowing the terms of MS's patent grant on
.NET Core, they have a more palatable option.

[http://netmf.github.io](http://netmf.github.io)

------
jdfellow
What would it take to get this to support other ARM boards? (Especially the
Orange Pi in my case.)

~~~
fancy_pantser
They have no plans to but would entertain someone volunteering:
[https://www.reddit.com/r/golang/comments/5xgf8u/gokrazy_a_pu...](https://www.reddit.com/r/golang/comments/5xgf8u/gokrazy_a_purego_userland_for_your_raspberry_pi_3/dei6fim/)

------
agumonkey
If I ever write a Go thing I'll be sure to call it Getnuts.

------
fabmilo
does it support docker?

~~~
0x006A
no, docker does not work with CGO_ENABLED=0

------
kingmanaz
Excellent. Perhaps it's finally time to build a wunderground-consulting
sprinkler timer...

