From f64f654610f79e49620710cbce80d43d4e583ea7 Mon Sep 17 00:00:00 2001 From: Able Date: Sat, 21 Sep 2024 19:20:38 -0500 Subject: [PATCH] Device work --- sysdata/programs/svga_driver/src/device.hb | 10 ++++------ sysdata/system_config.toml | 14 +++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/sysdata/programs/svga_driver/src/device.hb b/sysdata/programs/svga_driver/src/device.hb index 954105b..daf98e4 100644 --- a/sysdata/programs/svga_driver/src/device.hb +++ b/sysdata/programs/svga_driver/src/device.hb @@ -89,19 +89,17 @@ GetBARAddr := fn(addr: PCIAddress, index: int): u32 { } setup_device := fn(svga_dev: ^SVGADevice): void { - // TODO: Fix this + // TODO: Fix this // refer to https://git.ablecorp.us/able/vmware-svga/src/commit/eea7ddcd0d34702f8f0a33c1933718706c6318c5/lib/refdriver/svga.c#L55 - svga_dev.pciAddr = PCIAddress.(0, 3, 0) - /* - pci_id := get_ids(svga_dev.pciAddr.bus, svga_dev.pciAddr.device, svga_dev.pciAddr.function) + pci_dev := pci.check_device(0, 3) - if pci_id.vendor != PCI_VENDOR_ID_VMWARE | pci_id.device != PCI_DEVICE_ID_VMWARE_SVGA2 { + if pci_dev.device_id.vendor != PCI_VENDOR_ID_VMWARE { log.error("SVGA device not found\0") return } - */ + //| pci_dev.device_id.device != PCI_DEVICE_ID_VMWARE_SVGA2 { svga_dev.ioBase = config_read32(svga_dev.pciAddr.bus, svga_dev.pciAddr.device, svga_dev.pciAddr.function, 0x10) & 0xFFFFFFF0 write_reg(svga_dev, reg.SVGA_REG_ENABLE, reg.SVGA_REG_ENABLE_ENABLE) diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 86b0ad8..82e2aa3 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -20,14 +20,14 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.tests] # path = "boot:///tests.hbf" -# [boot.limine.ableos.modules.0serial_driver] +# [boot.limine.ableos.modules.serial_driver] # path = "boot:///serial_driver.hbf" # [boot.limine.ableos.modules.diskio_driver] # path = "boot:///diskio_driver.hbf" -# [boot.limine.ableos.modules.render_example] -# path = "boot:///render_example.hbf" +[boot.limine.ableos.modules.render_example] +path = "boot:///render_example.hbf" # [boot.limine.ableos.modules.serial_driver_test] # path = "boot:///serial_driver_test.hbf" @@ -41,11 +41,11 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.dt_buffer_test] # path = "boot:///dt_buffer_test.hbf" -[boot.limine.ableos.modules.svga_driver] -path = "boot:///svga_driver.hbf" +# [boot.limine.ableos.modules.svga_driver] +# path = "boot:///svga_driver.hbf" -# [boot.limine.ableos.modules.ps2_driver] -# path = "boot:///ps2_driver.hbf" +[boot.limine.ableos.modules.ps2_driver] +path = "boot:///ps2_driver.hbf" # [boot.limine.ableos.modules.filesystem_fat32] # path = "boot:///filesystem_fat32.hbf"