1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

Update device drivers to use the device.RegisterDriver

This commit is contained in:
Achilleas Anagnostopoulos 2017-07-18 08:26:56 +01:00
parent d180348116
commit 1ef27b3226
6 changed files with 21 additions and 33 deletions

View File

@ -1,11 +0,0 @@
package tty
import "gopheros/device"
var (
// ProbeFuncs is a slice of device probe functions
// that is used by the hal package to probe for TTY
// hardware. Each driver should use an init() block
// to append its probe function to this list.
ProbeFuncs []device.ProbeFn
)

View File

@ -265,5 +265,8 @@ func probeForVT() device.Driver {
}
func init() {
ProbeFuncs = append(ProbeFuncs, probeForVT)
device.RegisterDriver(&device.DriverInfo{
Order: device.DetectOrderEarly,
Probe: probeForVT,
})
}

View File

@ -3,9 +3,18 @@ package console
import (
"gopheros/device/video/console/font"
"gopheros/device/video/console/logo"
"gopheros/kernel/cpu"
"gopheros/kernel/hal/multiboot"
"gopheros/kernel/mem/vmm"
"image/color"
)
var (
mapRegionFn = vmm.MapRegion
portWriteByteFn = cpu.PortWriteByte
getFramebufferInfoFn = multiboot.GetFramebufferInfo
)
// ScrollDir defines a scroll direction.
type ScrollDir uint8

View File

@ -1,19 +0,0 @@
package console
import (
"gopheros/device"
"gopheros/kernel/cpu"
"gopheros/kernel/hal/multiboot"
"gopheros/kernel/mem/vmm"
)
var (
mapRegionFn = vmm.MapRegion
portWriteByteFn = cpu.PortWriteByte
getFramebufferInfoFn = multiboot.GetFramebufferInfo
// ProbeFuncs is a slice of device probe functions that is used by
// the hal package to probe for console device hardware. Each driver
// should use an init() block to append its probe function to this list.
ProbeFuncs []device.ProbeFn
)

View File

@ -603,5 +603,8 @@ func probeForVesaFbConsole() device.Driver {
}
func init() {
ProbeFuncs = append(ProbeFuncs, probeForVesaFbConsole)
device.RegisterDriver(&device.DriverInfo{
Order: device.DetectOrderEarly,
Probe: probeForVesaFbConsole,
})
}

View File

@ -236,5 +236,8 @@ func probeForVgaTextConsole() device.Driver {
}
func init() {
ProbeFuncs = append(ProbeFuncs, probeForVgaTextConsole)
device.RegisterDriver(&device.DriverInfo{
Order: device.DetectOrderEarly,
Probe: probeForVgaTextConsole,
})
}