adds some more io commnads; starts work on a PCI driver

This commit is contained in:
2025-06-08 18:22:22 -04:00
parent ac3dc4d48a
commit a776376403
5 changed files with 90 additions and 4 deletions

View File

@ -1,3 +1,5 @@
#include <stdint.h>
#ifndef ARCH_IO_H
#define ARCH_IO_H
@ -8,7 +10,9 @@
* @param port The I/O port to send the data to
* @param data The data to send to the I/O port
*/
void outb(unsigned short port, unsigned char data);
void outb(unsigned short port, uint8_t data);
void outb_16(unsigned short port, uint16_t data);
void outb_32(unsigned short port, uint32_t data);
/**
* inb:
@ -17,7 +21,9 @@ void outb(unsigned short port, unsigned char data);
* @param port The address of the I/O port
* @return The read byte
*/
unsigned char inb(unsigned short port);
uint8_t inb(unsigned short port);
uint16_t inb_16(unsigned short port);
uint32_t inb_32(unsigned short port);
/**
* io_wait:

View File

@ -0,0 +1,13 @@
#include <stdint.h>
#ifndef ARCH_PCI_H
#define ARCH_PCI_H
#define PCI_CONFIG_ADDRESS (0xCF8)
#define PCI_CONFIG_DATA (0xCFC)
uint16_t pci_config_read_word(uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset);
uint16_t pci_check_vendor(uint8_t bus, uint8_t slot);
#endif