mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Update the Driver.DriverInit method signature to accept an io.Writer
Drivers can use the writer as an argument to kfmt.Fprintf to log additional output during their initialization.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"gopheros/kernel/cpu"
|
||||
"gopheros/kernel/hal/multiboot"
|
||||
"image/color"
|
||||
"io"
|
||||
"reflect"
|
||||
"unsafe"
|
||||
)
|
||||
@@ -197,7 +198,7 @@ func (cons *VgaTextConsole) DriverVersion() (uint16, uint16, uint16) {
|
||||
}
|
||||
|
||||
// DriverInit initializes this driver.
|
||||
func (cons *VgaTextConsole) DriverInit() *kernel.Error { return nil }
|
||||
func (cons *VgaTextConsole) DriverInit(_ io.Writer) *kernel.Error { return nil }
|
||||
|
||||
// probeForVgaTextConsole checks for the presence of a vga text console.
|
||||
func probeForVgaTextConsole() device.Driver {
|
||||
|
||||
@@ -311,7 +311,7 @@ func TestVgaTextSetPaletteColor(t *testing.T) {
|
||||
func TestVgaTextDriverInterface(t *testing.T) {
|
||||
var dev device.Driver = NewVgaTextConsole(80, 25, 0)
|
||||
|
||||
if err := dev.DriverInit(); err != nil {
|
||||
if err := dev.DriverInit(nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user