Golang Application on Kindle

2020-04-15

Short hands-on to get an golang application running on kindle

Specifications

... On your kindle:

cat /proc/cpuinfo 

Processor	  : ARMv7 Processor rev 5 (v7l)
BogoMIPS	  : 799.53
Features	  : swp half thumb fastmult vfp edsp neon vfpv3 
CPU implementer   : 0x41
CPU architecture  : 7
CPU variant	  : 0x2
CPU part	  : 0xc08
CPU revision	  : 5
Hardware	  : Amazon.com MX50 YOSHI Board
Revision	  : 50011

Test application

Let's use a simple hello world example hello.go.

package main

import "fmt"

func main() {
    fmt.Println("Hello, tester")
}

Go go!

compile it:

GOARCH=arm GOARM=7 GOOS=linux go build hello.go

copy resulting file over to kindle:

scp hello root@192.168.178.27:/mnt/us/hello

And finally, execute it on kindle :)

cd /mnt/us/hello
./hello

It should print the following on your terminal output:

Hello, tester