The VM.execBlock method has been converted to a standalone function. Access to the vm is facilitated via the ctx argument. The VM will calculate the start and end instruction pointer offsets for all scoped blocks in a pre-processing pass which is initiated by the VM.checkEntities call when it encounters a Method entity. As opcodes may trigger the execution of multiple opcodes (e.g. if/else) or even mutate the execution flow (e.g. a break inside a while loop) we need to keep track of the IP offsets in all scoped blocks so the VM can provide accurate IP values for stack traces. The stack trace is included as part of the *Error struct and is populated automatically by execBlock whenever an error occurs. A convenience Error.StackTrace() method is provided for obtaining a formatted version of the stack trace as a string. Each stack trace entry contains information about the method name inside which an error executed, the table name where the method was defined as well as the opcode type and IP offset (relative to the method start) where the error occured. Stack traces are also preserved across method invocations. An example flow that generates a fatal error is included in the vm-testsuite-DSDT.dsl file (method \NST2). Calling this method with the appropriate arguments generates a stack trace that looks like this: Stack trace: [000] [DSDT] [NST2():0x2] opcode: Store [001] [DSDT] [NST3():0x1] opcode: Add [002] [DSDT] [NST4():0x8] opcode: If [003] [DSDT] [NST4():0x9] opcode: Fatal
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.