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:
parent
d180348116
commit
1ef27b3226
@ -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
|
|
||||||
)
|
|
@ -265,5 +265,8 @@ func probeForVT() device.Driver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ProbeFuncs = append(ProbeFuncs, probeForVT)
|
device.RegisterDriver(&device.DriverInfo{
|
||||||
|
Order: device.DetectOrderEarly,
|
||||||
|
Probe: probeForVT,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,18 @@ package console
|
|||||||
import (
|
import (
|
||||||
"gopheros/device/video/console/font"
|
"gopheros/device/video/console/font"
|
||||||
"gopheros/device/video/console/logo"
|
"gopheros/device/video/console/logo"
|
||||||
|
"gopheros/kernel/cpu"
|
||||||
|
"gopheros/kernel/hal/multiboot"
|
||||||
|
"gopheros/kernel/mem/vmm"
|
||||||
"image/color"
|
"image/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
mapRegionFn = vmm.MapRegion
|
||||||
|
portWriteByteFn = cpu.PortWriteByte
|
||||||
|
getFramebufferInfoFn = multiboot.GetFramebufferInfo
|
||||||
|
)
|
||||||
|
|
||||||
// ScrollDir defines a scroll direction.
|
// ScrollDir defines a scroll direction.
|
||||||
type ScrollDir uint8
|
type ScrollDir uint8
|
||||||
|
|
||||||
|
@ -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
|
|
||||||
)
|
|
@ -603,5 +603,8 @@ func probeForVesaFbConsole() device.Driver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ProbeFuncs = append(ProbeFuncs, probeForVesaFbConsole)
|
device.RegisterDriver(&device.DriverInfo{
|
||||||
|
Order: device.DetectOrderEarly,
|
||||||
|
Probe: probeForVesaFbConsole,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
@ -236,5 +236,8 @@ func probeForVgaTextConsole() device.Driver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ProbeFuncs = append(ProbeFuncs, probeForVgaTextConsole)
|
device.RegisterDriver(&device.DriverInfo{
|
||||||
|
Order: device.DetectOrderEarly,
|
||||||
|
Probe: probeForVgaTextConsole,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user