Skip to content

Instantly share code, notes, and snippets.

@orangecms
Last active October 13, 2025 14:27
Show Gist options
  • Save orangecms/7f985ef19398544114599430b79868f7 to your computer and use it in GitHub Desktop.
Save orangecms/7f985ef19398544114599430b79868f7 to your computer and use it in GitHub Desktop.
Golang Linux to use new syscalls

What is this?

Golang on Linux was not yet using the new year 2038 proof syscalls on 32-bit systems, leading to crashes on >=5.0 kernels without 32-bit compat. I filed an issue and went on to implement that.

Reference commits where Linux added the new 64-bit syscalls:

This has been released in Linux v5.0.

See also:

Relevant Go resources:

How about Rust? 🦀

Other people are already on it, see rust-lang/libc#3175 and related PRs/issues.

Strategy

The Go runtime is implemented per platform. I have set up https://github.com/platform-system-interface/gotest/ for quick testing.

To compare the syscall numbers between Linux and Go, I ran:

  • Linux: grep sys_futex arch/*/**/syscall*.tbl
  • Go: grep runtime.futex src/sys_linux*.s

Note that Linux does not have the same structure for every arch. E.g. arch/riscv/ has no .tbl, using the generic scripts/syscall.tbl, and arm has the .tbl files in tools/ rather than kernel/syscalls/. New architectures are supposed to use the scripts/syscall.tbl.

An incosistency leads to confusion with the naming though. In scripts/syscall.tbl, it is:

98   time32   futex          sys_futex_time32
98   64       futex          sys_futex
...
422  32       futex_time64   sys_futex

I looked at the last column where the names start with sys_, because the defines in Go are prefixed with SYS_. However, for consistency within Go, I was asked to use the same names as in golang.org/x/sys/unix/zsysnum_linux_386.go.

The timespec structs are coming from include/uapi/linux/time_types.h:

struct __kernel_timespec {
  __kernel_time64_t    tv_sec;
  long long            tv_nsec;
};

struct __kernel_old_timespec {
  __kernel_old_time_t  tv_sec;
  long                 tv_nsec;
};

For the type definitions, see include/uapi/asm-generic/posix_types.h:

typedef __kernel_long_t __kernel_old_time_t;
typedef long long __kernel_time64_t;

Internally, the kernel uses (sorta!) equivalent structs:

include/linux/time64.h:

struct timespec64 {
  time64_t  tv_sec;
  long      tv_nsec;
};

Note the long here. How long is a long? In C, it depends!

include/vdso/time32.h:

struct old_timespec32 {
  old_time32_t  tv_sec;
  s32           tv_nsec;
};

I was also asked to cache the syscall probing using an atomic. Before I figured that I need to use the internal implementation, I ran into another crash.

Testing

initramfs

I use a minimal u-root environment for testing. Build instructions for the u-root initramfs shall follow, too.

Pre-5.0 Linux

Below are my defconfig and build/run scripts for Linux 4.20.7 in QEMU Arm.

https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.20.7.tar.xz

Linux 6.x

Using Buildroot:

make qemu_arm_vexpress_defconfig
make -j7

And to drop the 32-bit compat, run make linux-menuconfig, disable KCONFIG_, run make -j7 again.

QEMU:

qemu-system-arm -M vexpress-a9 -nographic \
  -kernel output/images/zImage \
  -dtb output/images/vexpress-v2p-ca9.dtb \
  -initrd /tmp/u-root-godama-armv7-mini.cpio.xz \
  -append "console=ttyAMA0"

This here happens when using sync/atomic instead of internal/runtime/atomic within the Go runtime (just use the internal things!):

runtime: newstack at sync/atomic.(*Bool).Load+0x40 sp=0x835730 stack=[0x835000, 0x835800]
        morebuf={pc:0x5e430 sp:0x835730 lr:0x0}
        sched={pc:0xa6910 sp:0x835730 lr:0x5e430 ctxt:0x0}
runtime.futex(0x698130, 0x80, 0x0, 0x0, 0x0, 0x0)
        runtime/os_linux_futex32.go:31 +0x10 fp=0x835758 sp=0x835730 pc=0x5e430
runtime.futexsleep(0x698130, 0x0, 0xffffffffffffffff)
        runtime/os_linux.go:73 +0x44 fp=0x835788 sp=0x835758 pc=0x5caf0
runtime.notetsleep_internal(0x698130, 0xffffffffffffffff)
        runtime/lock_futex.go:70 +0x290 fp=0x8357b0 sp=0x835788 pc=0x2bc94
runtime.notetsleepg(0x698130, 0xffffffffffffffff)
        runtime/lock_futex.go:124 +0x40 fp=0x8357c8 sp=0x8357b0 pc=0x2bd94
os/signal.signal_recv()
        runtime/sigqueue.go:152 +0xdc fp=0x8357e0 sp=0x8357c8 pc=0x9f160
os/signal.loop()
        os/signal/signal_unix.go:23 +0x14 fp=0x8357ec sp=0x8357e0 pc=0x1dc69c
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x8357ec sp=0x8357ec pc=0xa32dc
created by os/signal.Notify.func1.1 in goroutine 1
        os/signal/signal.go:152 +0x28
fatal error: runtime: stack split at bad time

runtime stack:
runtime.throw({0x40cd53, 0x20})
        runtime/panic.go:1227 +0x34 fp=0x84bf44 sp=0x84bf30 pc=0x9d1d8
runtime.newstack()
        runtime/stack.go:1048 +0xaa4 fp=0x84bfdc sp=0x84bf44 pc=0x80a24
runtime.morestack()
        runtime/asm_arm.s:406 +0x60 fp=0x84bfe0 sp=0x84bfdc pc=0xa1cf0

goroutine 8 gp=0x803448 m=3 mp=0x837008 [syscall]:
runtime.futex(0x698130, 0x80, 0x0, 0x0, 0x0, 0x0)
        runtime/os_linux_futex32.go:31 +0x10 fp=0x835758 sp=0x835730 pc=0x5e430
runtime.futexsleep(0x698130, 0x0, 0xffffffffffffffff)
        runtime/os_linux.go:73 +0x44 fp=0x835788 sp=0x835758 pc=0x5caf0
runtime.notetsleep_internal(0x698130, 0xffffffffffffffff)
        runtime/lock_futex.go:70 +0x290 fp=0x8357b0 sp=0x835788 pc=0x2bc94
runtime.notetsleepg(0x698130, 0xffffffffffffffff)
        runtime/lock_futex.go:124 +0x40 fp=0x8357c8 sp=0x8357b0 pc=0x2bd94
os/signal.signal_recv()
        runtime/sigqueue.go:152 +0xdc fp=0x8357e0 sp=0x8357c8 pc=0x9f160
os/signal.loop()
        os/signal/signal_unix.go:23 +0x14 fp=0x8357ec sp=0x8357e0 pc=0x1dc69c
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x8357ec sp=0x8357ec pc=0xa32dc
created by os/signal.Notify.func1.1 in goroutine 1
        os/signal/signal.go:152 +0x28

goroutine 1 gp=0x802128 m=nil [runnable]:
runtime.mapassign_faststr(0x399688, 0x8e62a0, {0x404715, 0x14})
        internal/runtime/maps/runtime_faststr.go:263 +0x67c fp=0x8e3b7c sp=0x8e3b7c pc=0x21728
runtime.initMetrics()
        runtime/metrics.go:89 +0x134c fp=0x8e3bec sp=0x8e3b7c pc=0x37564
internal/godebug.registerMetric({0x85c380, 0x33}, 0x816dd8)
        runtime/metrics.go:574 +0x18 fp=0x8e3c18 sp=0x8e3bec pc=0x9bb1c
internal/godebug.(*Setting).register(0x85e348)
        internal/godebug/godebug.go:130 +0xe8 fp=0x8e3c4c sp=0x8e3c18 pc=0xdbe34
internal/godebug.(*Setting).register-fm()
        <autogenerated>:1 +0x1c fp=0x8e3c54 sp=0x8e3c4c pc=0xdca88
sync.(*Once).doSlow(0x8283e4, 0x8e3ca4)
        sync/once.go:78 +0xa8 fp=0x8e3c80 sp=0x8e3c54 pc=0xbd678
sync.(*Once).Do(0x8283e4, 0x8e3ca4)
        sync/once.go:69 +0x40 fp=0x8e3c8c sp=0x8e3c80 pc=0xbd5c0
internal/godebug.(*Setting).IncNonDefault(0x85e348)
        internal/godebug/godebug.go:122 +0x3c fp=0x8e3cac sp=0x8e3c8c pc=0xdbd0c
time.syncTimer(0x853a40)
        time/sleep.go:26 +0x4c fp=0x8e3cbc sp=0x8e3cac pc=0xea1d4
time.NewTicker(0xfe502a)
        time/tick.go:44 +0x94 fp=0x8e3cf0 sp=0x8e3cbc pc=0xea8c8
github.com/charmbracelet/bubbletea.(*standardRenderer).start(0x8dad20)
        github.com/charmbracelet/bubbletea/standard_renderer.go:75 +0x54 fp=0x8e3d00 sp=0x8e3cf0 pc=0x208540
github.com/charmbracelet/bubbletea.(*Program).Run(0x86acc0)
        github.com/charmbracelet/bubbletea/tea.go:484 +0x4f4 fp=0x8e3dd4 sp=0x8e3d00 pc=0x20c670
github.com/knz/bubbline.(*Editor).GetLine(0x80cd10)
        github.com/knz/bubbline/getline.go:74 +0x1d4 fp=0x8e3e2c sp=0x8e3dd4 pc=0x2406c4
github.com/u-root/u-root/cmds/core/gosh.runInteractive(0x8b6828, 0x8d6008, {0x450dec, 0x8162c0}, {0x450dec, 0x8162c8})
        github.com/u-root/u-root/cmds/core/gosh/completer.go:117 +0x254 fp=0x8e3eb8 sp=0x8e3e2c pc=0x28dd74
github.com/u-root/u-root/cmds/core/gosh.run({0x450e7c, 0x8162b8}, {0x450dec, 0x8162c0}, {0x450dec, 0x8162c8}, {0x0, 0x0}, {0x8162e8, 0x0, ...})
        github.com/u-root/u-root/cmds/core/gosh/gosh.go:56 +0x15c fp=0x8e3eec sp=0x8e3eb8 pc=0x28ef00
github.com/u-root/u-root/cmds/core/gosh.registeredMain()
        github.com/u-root/u-root/cmds/core/gosh/gosh.go:34 +0x84 fp=0x8e3f34 sp=0x8e3eec pc=0x28ecfc
bb.u-root.com/bb/pkg/bbmain.Run({0x80e606, 0x4})
        bb.u-root.com/bb/pkg/bbmain/register.go:77 +0x90 fp=0x8e3f70 sp=0x8e3f34 pc=0x12b318
main.run()
        bb.u-root.com/bb/main.go:117 +0x50 fp=0x8e3fa4 sp=0x8e3f70 pc=0x34cc24
main.main()
        bb.u-root.com/bb/main.go:144 +0x88 fp=0x8e3fb8 sp=0x8e3fa4 pc=0x34cfc0
runtime.main()
        runtime/proc.go:289 +0x2bc fp=0x8e3fec sp=0x8e3fb8 pc=0x631c4
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x8e3fec sp=0x8e3fec pc=0xa32dc

goroutine 2 gp=0x8026c8 m=nil [force gc (idle)]:
runtime.gopark(0x42c788, 0x68aa70, 0x11, 0xa, 0x1)
        runtime/proc.go:464 +0xd8 fp=0x832fc0 sp=0x832fac pc=0x9d2e8
runtime.goparkunlock(0x68aa70, 0x11, 0xa, 0x1)
        runtime/proc.go:470 +0x3c fp=0x832fd4 sp=0x832fc0 pc=0x63748
runtime.forcegchelper()
        runtime/proc.go:377 +0xe0 fp=0x832fec sp=0x832fd4 pc=0x63614
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x832fec sp=0x832fec pc=0xa32dc
created by runtime.init.6 in goroutine 1
        runtime/proc.go:365 +0x1c

goroutine 3 gp=0x8027e8 m=nil [GC sweep wait]:
runtime.gopark(0x42c788, 0x68acb0, 0xc, 0x9, 0x1)
        runtime/proc.go:464 +0xd8 fp=0x8337b4 sp=0x8337a0 pc=0x9d2e8
runtime.goparkunlock(0x68acb0, 0xc, 0x9, 0x1)
        runtime/proc.go:470 +0x3c fp=0x8337c8 sp=0x8337b4 pc=0x63748
runtime.bgsweep(0x850000)
        runtime/mgcsweep.go:279 +0xa8 fp=0x8337e4 sp=0x8337c8 pc=0x4a54c
runtime.gcenable.gowrap1()
        runtime/mgc.go:212 +0x1c fp=0x8337ec sp=0x8337e4 pc=0x3a418
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x8337ec sp=0x8337ec pc=0xa32dc
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:212 +0x74

goroutine 4 gp=0x802908 m=nil [GC scavenge wait]:
runtime.gopark(0x42c788, 0x68b150, 0xd, 0xa, 0x2)
        runtime/proc.go:464 +0xd8 fp=0x833fa4 sp=0x833f90 pc=0x9d2e8
runtime.goparkunlock(0x68b150, 0xd, 0xa, 0x2)
        runtime/proc.go:470 +0x3c fp=0x833fb8 sp=0x833fa4 pc=0x63748
runtime.(*scavengerState).park(0x68b150)
        runtime/mgcscavenge.go:425 +0x58 fp=0x833fc8 sp=0x833fb8 pc=0x47650
runtime.bgscavenge(0x850000)
        runtime/mgcscavenge.go:653 +0x3c fp=0x833fe4 sp=0x833fc8 pc=0x47d28
runtime.gcenable.gowrap2()
        runtime/mgc.go:213 +0x1c fp=0x833fec sp=0x833fe4 pc=0x3a3ec
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x833fec sp=0x833fec pc=0xa32dc
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:213 +0xbc

goroutine 5 gp=0x802c68 m=nil [finalizer wait]:
runtime.gopark(0x42c60c, 0x697b90, 0x10, 0xa, 0x1)
        runtime/proc.go:464 +0xd8 fp=0x832790 sp=0x83277c pc=0x9d2e8
runtime.runFinalizers()
        runtime/mfinal.go:210 +0xf4 fp=0x8327ec sp=0x832790 pc=0x39184
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x8327ec sp=0x8327ec pc=0xa32dc
created by runtime.createfing in goroutine 1
        runtime/mfinal.go:172 +0x5c

goroutine 6 gp=0x802ea8 m=nil [cleanup wait]:
runtime.gopark(0x42c788, 0x68b2a8, 0x2e, 0xa, 0x1)
        runtime/proc.go:464 +0xd8 fp=0x83479c sp=0x834788 pc=0x9d2e8
runtime.goparkunlock(0x68b2a8, 0x2e, 0xa, 0x1)
        runtime/proc.go:470 +0x3c fp=0x8347b0 sp=0x83479c pc=0x63748
runtime.(*cleanupQueue).dequeue(0x68b248)
        runtime/mcleanup.go:439 +0x100 fp=0x8347c8 sp=0x8347b0 pc=0x34cf0
runtime.runCleanups()
        runtime/mcleanup.go:635 +0x78 fp=0x8347ec sp=0x8347c8 pc=0x355ec
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x8347ec sp=0x8347ec pc=0xa32dc
created by runtime.(*cleanupQueue).createGs in goroutine 1
        runtime/mcleanup.go:589 +0xd8

goroutine 7 gp=0x8030e8 m=nil [select, locked to thread]:
runtime.gopark(0x42c7b8, 0x0, 0x9, 0x3, 0x1)
        runtime/proc.go:464 +0xd8 fp=0x834ed0 sp=0x834ebc pc=0x9d2e8
runtime.selectgo(0x834fd8, 0x834fb8, 0x0, 0x0, 0x2, 0x1)
        runtime/select.go:351 +0xc9c fp=0x834f90 sp=0x834ed0 pc=0x791a4
runtime.ensureSigM.func1()
        runtime/signal_unix.go:1085 +0x144 fp=0x834fec sp=0x834f90 pc=0x981dc
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x834fec sp=0x834fec pc=0xa32dc
created by runtime.ensureSigM in goroutine 1
        runtime/signal_unix.go:1068 +0xf8

goroutine 9 gp=0x803568 m=nil [chan receive]:
runtime.gopark(0x42c5e8, 0x8538b8, 0xe, 0x7, 0x2)
        runtime/proc.go:464 +0xd8 fp=0x835f88 sp=0x835f74 pc=0x9d2e8
runtime.chanrecv(0x853880, 0x0, 0x1)
        runtime/chan.go:667 +0x3c4 fp=0x835fc4 sp=0x835f88 pc=0x25dec
runtime.chanrecv1(0x853880, 0x0)
        runtime/chan.go:509 +0x20 fp=0x835fd8 sp=0x835fc4 pc=0x259f8
github.com/u-root/u-root/cmds/core/gosh.runInteractive.func1(0x853880)
        github.com/u-root/u-root/cmds/core/gosh/completer.go:107 +0x24 fp=0x835fe4 sp=0x835fd8 pc=0x28f920
github.com/u-root/u-root/cmds/core/gosh.runInteractive.gowrap1()
        github.com/u-root/u-root/cmds/core/gosh/completer.go:109 +0x24 fp=0x835fec sp=0x835fe4 pc=0x28e368
runtime.goexit({})
        runtime/asm_arm.s:873 +0x4 fp=0x835fec sp=0x835fec pc=0xa32dc
created by github.com/u-root/u-root/cmds/core/gosh.runInteractive in goroutine 1
        github.com/u-root/u-root/cmds/core/gosh/completer.go:105 +0x19c

goroutine 10 gp=0x803688 m=nil [select]:
runtime.gopark(0x42c7b8, 0x0, 0x9, 0x3, 0x1)
        runtime/proc.go:464 +0xd8 fp=0x82e6dc sp=0x82e6c8 pc=0x9d2e8
runtime.selectgo(0x82e7d0, 0x82e7c0, 0x0, 0x0, 0x2, 0x1)
        runtime/select.go:351 +0xc9c fp=0x82e79c sp=0x82e6dc pc=0x791a4
github.com/knz/bubbline.(*Editor).GetLine.func1()
        github.com/knz/bubbline/getline.go:65 +0xa8 fp=0x82e7ec sp=0x82e79c pc=0x2408ec
runtime.goexitinit: 1970/04/09 16:51:20 Waiting for orphaned children
init: 1970/04/08 04:32:48 All commands exited
init: 1970/04/15 17:11:36 Syncing filesystems
init: 1970/04/15 17:11:36 Exiting...
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
CPU: 0 UID: 0 PID: 64 Comm: init Not tainted 6.12.27 #2
Hardware name: ARM-Versatile Express
Call trace:
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x54/0x68
 dump_stack_lvl from panic+0x10c/0x350
 panic from make_task_dead+0x0/0x16c
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SYSVIPC=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_CGROUPS=y
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_USER_NS=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
CONFIG_SLAB=y
CONFIG_ARCH_VIRT=y
CONFIG_ARCH_BCM=y
CONFIG_ARCH_BCM2835=y
CONFIG_ARM_THUMBEE=y
CONFIG_PL310_ERRATA_588369=y
CONFIG_PL310_ERRATA_727915=y
CONFIG_PL310_ERRATA_753970=y
CONFIG_PL310_ERRATA_769419=y
CONFIG_ARM_ERRATA_430973=y
CONFIG_ARM_ERRATA_720789=y
CONFIG_ARM_ERRATA_754322=y
CONFIG_ARM_ERRATA_775420=y
CONFIG_ARM_ERRATA_773022=y
CONFIG_ARM_ERRATA_818325_852422=y
CONFIG_ARM_ERRATA_821420=y
CONFIG_ARM_ERRATA_825619=y
CONFIG_ARM_ERRATA_852421=y
CONFIG_ARM_ERRATA_852423=y
CONFIG_OABI_COMPAT=y
CONFIG_DEPRECATED_PARAM_STRUCT=y
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_KEXEC=y
# CONFIG_ATAGS_PROC is not set
CONFIG_FPE_NWFPE=y
CONFIG_VFP=y
# CONFIG_STRICT_KERNEL_RWX is not set
# CONFIG_STRICT_MODULE_RWX is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_PARTITION_ADVANCED=y
# CONFIG_MSDOS_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
# CONFIG_WIRELESS is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_PHYSMAP_OF_VERSATILE=y
CONFIG_BLK_DEV_RAM=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_BLK_SCSI=y
CONFIG_NETDEVICES=y
CONFIG_VIRTIO_NET=y
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_AURORA is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_WLAN is not set
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_LEGACY_PTY_COUNT=16
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_AMBA_PL010=y
CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_SPI=y
CONFIG_SPI_PL022=y
CONFIG_GPIO_PL061=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_VERSATILE=y
# CONFIG_HWMON is not set
CONFIG_WATCHDOG=y
CONFIG_BCM2835_WDT=y
CONFIG_MFD_SYSCON=y
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
CONFIG_MMC_ARMMMCI=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_SYNC_FILE=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_MAILBOX=y
CONFIG_BCM2835_MBOX=y
CONFIG_9P_FS=y
CONFIG_9P_FS_POSIX_ACL=y
# CONFIG_CRYPTO_ECHAINIV is not set
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_UART_PHYS=0x101f1000
CONFIG_DEBUG_UART_VIRT=0xf11f1000
#!/bin/sh
export TOOLCHAIN=arm-linux-gnueabi
export ARCH=arm
export CROSS_COMPILE=${TOOLCHAIN}-
make $@
#!/bin/sh
set -xe
QEMU=qemu-system-arm
# qemu-system-arm -M help
MACHINE=raspi2b
MEM=1G
M="-M $MACHINE -m $MEM"
DIR=arch/arm/boot
KERNEL=$DIR/zImage
CMDLINE="console=ttyAMA0 loglevel=7"
DTB="-dtb $DIR/dts/bcm2836-rpi-2-b.dtb"
$QEMU $M -nographic $EXTRA -kernel $KERNEL $DTB -append \""$CMDLINE"\" -initrd $@
@orangecms
Copy link
Author

Turns out, I have to use internal/runtime/atomic instead of sync/atomic`` for the atomic.Bool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment