mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Install exception handlers for page faults/GPFs and provide kernel.Panic
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package kmain
|
||||
|
||||
import (
|
||||
"github.com/achilleasa/gopher-os/kernel"
|
||||
"github.com/achilleasa/gopher-os/kernel/hal"
|
||||
"github.com/achilleasa/gopher-os/kernel/hal/multiboot"
|
||||
"github.com/achilleasa/gopher-os/kernel/kfmt/early"
|
||||
"github.com/achilleasa/gopher-os/kernel/mem/pmm/allocator"
|
||||
"github.com/achilleasa/gopher-os/kernel/mem/vmm"
|
||||
)
|
||||
|
||||
// Kmain is the only Go symbol that is visible (exported) from the rt0 initialization
|
||||
@@ -24,7 +25,10 @@ func Kmain(multibootInfoPtr, kernelStart, kernelEnd uintptr) {
|
||||
hal.InitTerminal()
|
||||
hal.ActiveTerminal.Clear()
|
||||
|
||||
if err := allocator.Init(kernelStart, kernelEnd); err != nil {
|
||||
early.Printf("[%s] error: %s\n", err.Module, err.Message)
|
||||
var err *kernel.Error
|
||||
if err = allocator.Init(kernelStart, kernelEnd); err != nil {
|
||||
kernel.Panic(err)
|
||||
} else if err = vmm.Init(); err != nil {
|
||||
kernel.Panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user