// installation check static void handle_1ab101(struct bregs *regs) { regs->al = 0x01; // Flags - "Config Mechanism #1" supported. regs->bx = 0x0210; // PCI version 2.10 regs->cl = GET_GLOBAL(MaxPCIBus); regs->edx = 0x20494350; // "PCI " regs->edi = (u32)entry_pcibios32 + BUILD_BIOS_ADDR; set_code_success(regs); }
void __disk_ret(struct bregs *regs, u32 linecode, const char *fname) { u8 code = linecode; if (regs->dl < EXTSTART_HD) SET_BDA(floppy_last_status, code); else SET_BDA(disk_last_status, code); if (code) __set_code_invalid(regs, linecode, fname); else set_code_success(regs); }
// find pci device static void handle_1ab102(struct bregs *regs) { u32 id = (regs->cx << 16) | regs->dx; int count = regs->si; int bdf, max; foreachpci(bdf, max) { u32 v = pci_config_readl(bdf, PCI_VENDOR_ID); if (v != id) continue; if (count--) continue; regs->bx = bdf; set_code_success(regs); return; }
// installation check static void handle_1ab101(struct bregs *regs) { // Find max bus. int bdf, max; foreachpci(bdf, max) { } regs->al = 0x01; // Flags - "Config Mechanism #1" supported. regs->bx = 0x0210; // PCI version 2.10 regs->cl = pci_bdf_to_bus(max - 1); regs->edx = 0x20494350; // "PCI " // XXX - bochs bios code sets edi to point to 32bit code - but no // reference to this in spec. set_code_success(regs); }
// find pci device static void handle_1ab102(struct bregs *regs) { u32 id = (regs->cx << 16) | regs->dx; int count = regs->si; int bus = -1; while (bus < GET_GLOBAL(MaxPCIBus)) { bus++; int bdf; foreachbdf(bdf, bus) { u32 v = pci_config_readl(bdf, PCI_VENDOR_ID); if (v != id) continue; if (count--) continue; regs->bx = bdf; set_code_success(regs); return; } }