A long overdue cleanup of the src/ tree. - Moved src/drivers to src/user because it contains more than drivers - Removed src/drivers/ahci because it's unused - will restore it when I make a real AHCI driver - Removed unused src/tools - Moved kernel.ld (the only used file under src/arch) to src/kernel for now, if/when there's a multi-platform effort that should be figured out as part of it - Removed the rest of the unused src/arch - Renamed 'fb' to 'drv.uefi_fb' and 'nulldrv' to 'testapp'
25 lines
543 B
C++
25 lines
543 B
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
extern "C" {
|
|
|
|
/// Read a byte from an IO port.
|
|
/// \arg port The address of the IO port
|
|
/// \returns One byte read from the port
|
|
uint8_t inb(uint16_t port);
|
|
|
|
/// Write a byte to an IO port.
|
|
/// \arg port The addres of the IO port
|
|
/// \arg val The byte to write
|
|
void outb(uint16_t port, uint8_t val);
|
|
|
|
/// Pause briefly by doing IO to port 0x80
|
|
/// \arg times Number of times to delay by writing
|
|
void io_wait(unsigned times = 1);
|
|
|
|
}
|
|
|
|
constexpr uint16_t COM1 = 0x03f8;
|
|
constexpr uint16_t COM2 = 0x02f8;
|