Add: PCI driver, lspci

This commit is contained in:
xamidev
2024-09-08 13:45:15 +02:00
parent 8826a7d873
commit df7187ca75
6 changed files with 146 additions and 1 deletions

29
src/drivers/pci.h Normal file
View File

@@ -0,0 +1,29 @@
// PCI bus driver implementation header
// Author: xamidev
// Licensed under the Unlicense. See the repo below.
// https://github.com/xamidev/blankos
#ifndef PCI_H
#define PCI_H
#include <stdint.h>
#define PCI_CONFIG_ADDRESS 0xCF8
#define PCI_CONFIG_DATA 0xCFC
typedef struct
{
uint16_t vendor_id;
uint16_t device_id;
uint8_t class_code;
uint8_t subclass;
uint8_t prog_if;
uint8_t revision_id;
uint8_t bus;
uint8_t device;
uint8_t function;
} pci_device_t;
void scan_pci_bus();
#endif