Some gate handlers may invoke Go runtime code that clobbers the XMM registers that could be in use by the code that triggered the gate handler. One case where this happens is when a growing a slice and the new location for the slice data resides in a RO page with a CoW flag. In this scenario, runtime.growslice will invoke runtime.memmove which may take a code path that uses XMM registers for copying data around. During the copy, a page fault occurs and the kernel page fault handler will detect the CoW flag, allocate a new frame and copy the original data to the new frame before resuming execution. As the page copy is performed using the built-in copy function this will cause the XMM registers to be clobbered. To prevent this from happening, the asm gate code that gets executed when an exception occurs will now preserve the XMM regs on the stack before invoking the registered exception handler. In addition, for Go 1.9+ the gate code will also temporarily disable use of AVX instructions by runtime.memmove by setting runtime.useAVXmemmove to 0. This is required so the gate does not need to also preserve any AVX registers.
gopher-os 
Tests / Coverage | Go 1.7.x | Go 1.8.x | Go 1.9.x | Go 1.10.x | Go 1.x |
---|---|---|---|---|---|
The goal of this project is to build a 64-bit POSIX-compliant tick-less kernel with a Linux-compatible syscall implementation using Go.
This project is not about building yet another OS but rather exists to serve as proof that Go is indeed a suitable tool for writing low level code that runs at ring-0.
Note: This project is still in the early stages of development and is not yet
in a usable state. In fact, if you build the ISO and boot it, the kernel will
eventually panic with a Kmain returned
error.
To find out more about the current project status and feature roadmap take a look at the status page.
Building and running gopher-os
TLDR version: make run-qemu
or make run-vbox
.
A detailed guide about building, running and debugging gopher-os on Linux/OSX as well as the list of supported boot command line options are available here.
How does it look?
Contributing
gopher-os is Open Source. Feel free to contribute! To get started take a look at the contributing guide.
Licence
gopher-os is distributed under the MIT license.