mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Move Kmain into its own package
This allows us to keep the error definition in the kernel package without causing circular import errors
This commit is contained in:
parent
d5a4c43406
commit
ec6ce4b70e
2
Makefile
2
Makefile
@ -52,7 +52,7 @@ go.o:
|
|||||||
@# with slashes we create a global symbol alias for kernel.Kmain
|
@# with slashes we create a global symbol alias for kernel.Kmain
|
||||||
@echo "[objcopy] creating global symbol alias 'kernel.Kmain' for 'github.com/achilleasa/gopher-os/kernel.Kmain' in go.o"
|
@echo "[objcopy] creating global symbol alias 'kernel.Kmain' for 'github.com/achilleasa/gopher-os/kernel.Kmain' in go.o"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
--add-symbol kernel.Kmain=.text:0x`nm $(BUILD_DIR)/go.o | grep "kernel.Kmain$$" | cut -d' ' -f1` \
|
--add-symbol kernel.Kmain=.text:0x`nm $(BUILD_DIR)/go.o | grep "kmain.Kmain$$" | cut -d' ' -f1` \
|
||||||
$(BUILD_DIR)/go.o $(BUILD_DIR)/go.o
|
$(BUILD_DIR)/go.o $(BUILD_DIR)/go.o
|
||||||
|
|
||||||
binutils_version_check:
|
binutils_version_check:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package kernel
|
package kmain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/achilleasa/gopher-os/kernel/hal"
|
"github.com/achilleasa/gopher-os/kernel/hal"
|
4
stub.go
4
stub.go
@ -1,6 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "github.com/achilleasa/gopher-os/kernel"
|
import "github.com/achilleasa/gopher-os/kernel/kmain"
|
||||||
|
|
||||||
var multibootInfoPtr uintptr
|
var multibootInfoPtr uintptr
|
||||||
|
|
||||||
@ -11,5 +11,5 @@ var multibootInfoPtr uintptr
|
|||||||
// A global variable is passed as an argument to Kmain to prevent the compiler
|
// 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.
|
// from inlining the actual call and removing Kmain from the generated .o file.
|
||||||
func main() {
|
func main() {
|
||||||
kernel.Kmain(multibootInfoPtr)
|
kmain.Kmain(multibootInfoPtr)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user