ableos/sysdata/programs/svga_driver/src/device.hb

54 lines
1,014 B
Plaintext
Raw Normal View History

2024-09-17 12:08:19 -05:00
stn := @use("../../../libraries/stn/src/lib.hb");
.{string, memory, buffer, log} := stn
2024-09-14 03:51:57 -05:00
pci := @use("../../../libraries/pci/src/lib.hb");
.{PCIAddress} := pci
FIFO := struct {
reserved_size: u32,
using_bounce_buffer: u8,
2024-09-17 12:08:19 -05:00
//bounce_buffer: [u8; 1024 * 1024],
next_fence: u32,
}
new_fifo := fn(): FIFO {
2024-09-17 12:08:19 -05:00
//bounce_buffer := @as([u8; 1024 * 1024], idk)
/*bounce_buffer,*/
return FIFO.(0, 0, 0)
}
IRQ := struct {
pending: u32,
switchContext: u32,
//IntrContext oldContext;
//IntrContext newContext;
count: u32,
}
new_irq := fn(): IRQ {
return IRQ.(0, 0, 0)
}
2024-09-14 03:51:57 -05:00
SVGADevice := struct {
pciAddr: PCIAddress,
ioBase: u32,
fifoMem: ^u32,
fbMem: ^u8,
fifoSize: int,
fbSize: int,
vramSize: int,
deviceVersionId: int,
capabilities: int,
width: int,
height: int,
bpp: int,
pitch: int,
fifo: FIFO,
irq: IRQ,
2024-09-14 03:51:57 -05:00
}
svga_device := fn(): SVGADevice {
pci_addr := PCIAddress.(0, 0, 0)
fifo := new_fifo()
irq := new_irq()
return SVGADevice.(pci_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, fifo, irq)
}