The code responsible for mapping the kernel sections worked under the assumption that the linker would align all sections on a page boundary. To figure out the page extents for a particular section, the implementation would round the section VMA down to the nearest page and add to that the section length rounded up to the nearest page size. However, some sections (e.g. noptrbss) use 32 byte alignment. Depending on the section length, the original implementation could in some cases skip mapping of the last page in the section which would cause a page fault when its contents were accessed. The fix for this issue is quite simple: calculate the end page by rounding up (section start addr + section length) to the next page.
gopher-os
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.