
* Implementing some serial port control in preparation to do debugging with bochs * Changed naming of io to fb_ports to finally[tm] ports
27 lines
775 B
C
27 lines
775 B
C
#include "types.h"
|
|
#include "ports.h"
|
|
|
|
// Serial driver interface
|
|
|
|
#define SERIAL_COM1_BASE 0x3F8
|
|
|
|
#define SERIAL_DATA_PORT(base) (base)
|
|
#define SERIAL_FIFO_COMMAND_PORT(base) (base+2)
|
|
#define SERIAL_LINE_COMMAND_PORT(base) (base+3)
|
|
#define SERIAL_MODEM_COMMAND_PORT(base) (base+4)
|
|
#define SERIAL_LINE_STATUS_PORT(base) (base+5)
|
|
|
|
#define SERIAL_LINE_ENABLE 0x80
|
|
|
|
// Default configurations for serial ports/lines/buffers etc.
|
|
// Rational can be found here: https://littleosbook.github.io/#configuring-the-buffers
|
|
#define SERIAL_DEFAULT_LINE_CFG 0X03
|
|
#define SERIAL_DEFAULT_BUFFER_CFG 0xc7
|
|
#define SERIAL_DEFAULT_MODEM_CFG 0x03
|
|
|
|
void serial_set_buad_rate(const u16, const u16);
|
|
|
|
void serial_configure_line(const u16, const u8);
|
|
|
|
u8 serial_fifo_empty(const u16);
|