Add beginning basic serial driver

This commit is contained in:
Justin C. Miller
2018-05-03 00:08:22 -07:00
parent 59700b07db
commit d9fe457b44
6 changed files with 128 additions and 38 deletions

25
src/kernel/serial.h Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
/// \file serial.h
/// Declarations related to serial ports.
#include <stdint.h>
class serial_port
{
public:
/// Constructor.
/// \arg port The IO address of the serial port
serial_port(uint16_t port);
serial_port();
void write(char c);
char read();
private:
uint16_t m_port;
bool read_ready();
bool write_ready();
};
extern serial_port g_com1;