1
0
mirror of https://github.com/taigrr/gopher-os synced 2026-04-01 11:48:41 -07:00

Detect hw and wire active console and TTY

This commit is contained in:
Achilleas Anagnostopoulos
2017-07-06 09:24:41 +01:00
parent eca1f6c26e
commit 562fae2028
10 changed files with 186 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ import (
"gopheros/kernel/goruntime"
"gopheros/kernel/hal"
"gopheros/kernel/hal/multiboot"
"gopheros/kernel/kfmt"
"gopheros/kernel/mem/pmm/allocator"
"gopheros/kernel/mem/vmm"
)
@@ -27,9 +28,6 @@ var (
func Kmain(multibootInfoPtr, kernelStart, kernelEnd uintptr) {
multiboot.SetInfoPtr(multibootInfoPtr)
hal.InitTerminal()
hal.ActiveTerminal.Clear()
var err *kernel.Error
if err = allocator.Init(kernelStart, kernelEnd); err != nil {
panic(err)
@@ -39,7 +37,10 @@ func Kmain(multibootInfoPtr, kernelStart, kernelEnd uintptr) {
panic(err)
}
// Use kernel.Panic instead of panic to prevent the compiler from
// Detect and initialize hardware
hal.DetectHardware()
// Use kfmt.Panic instead of panic to prevent the compiler from
// treating kernel.Panic as dead-code and eliminating it.
kernel.Panic(errKmainReturned)
kfmt.Panic(errKmainReturned)
}