1
0
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:
Achilleas Anagnostopoulos
2017-07-08 20:19:28 +01:00
parent da279cf3ff
commit 3485523cdc
5 changed files with 13 additions and 7 deletions

View File

@@ -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 {

View File

@@ -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)
}