mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Created the framework for using different loadable panic handlers, loaded by the bootloader. Initial panic handler is panic.serial, which contains its own serial driver and stacktrace code. Other related changes: - Asserts are now based on the NMI handler - panic handlers get installed as the NMI interrupt handler - Changed symbol table generation: now use nm's own demangling and sorting, and include symbol size in the table - Move the linker script argument out of the kernel target, and into the kernel's specific module, so that other programs (ie, panic handlers) can use the kernel target as well - Some asm changes to boot.s to help GDB see stack frames - but this might not actually be all that useful - Renamed user_rsp to just rsp in cpu_state - everything in there is describing the 'user' state
24 lines
509 B
C++
24 lines
509 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;
|