1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00
gopher-os/stub.go
Achilleas Anagnostopoulos c15f27235c Update rt0 code to check for multiboot support and call kernel.Kmain
We still keep the required main func in stub.go to prevent the compiler
from optimizing the code out. We also force the compiler not to inline
the call to kernel.Kmain so we can find the symbol in the generated .o
file.
2017-03-29 07:54:23 +01:00

16 lines
480 B
Go

package main
import "github.com/achilleasa/gopher-os/kernel"
var multibootInfoPtr uint32
// main makes a dummy call to the actual kernel main entrypoint function. It
// is intentionally defined to prevent the Go compiler from optimizing away the
// real kernel code.
//
// A global variable is passed as an argument to Kmain to prevent the compiler
// from inlining the actual call and removing Kmain from the generated .o file.
func main() {
kernel.Kmain(multibootInfoPtr)
}