diff options
| author | Miguel <m.i@gmx.at> | 2018-08-19 19:39:47 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-19 19:39:47 +0200 |
| commit | 5055dc85c8a74fcd2ec24fbc51eba2a2da68debe (patch) | |
| tree | 6b9589c5c89c8bc5c90771ff9d630c15e670f024 /driver/serial.h | |
| parent | 575c725f998b166f1d286a2664aa3d6061d337fe (diff) | |
cleaning up asm stuff and improving docs
Diffstat (limited to 'driver/serial.h')
| -rw-r--r-- | driver/serial.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/driver/serial.h b/driver/serial.h index 2e10af8..c6841f2 100644 --- a/driver/serial.h +++ b/driver/serial.h @@ -1,18 +1,38 @@ +#ifndef FOOLOS_SERIAL_H +#define FOOLOS_SERIAL_H /** * @file - * Serial Port Driver for COM1 + * MINIMALISTIC SERIAL PORT DRIVER for COM1 + * ======================================== + * Call serial_init() **once** before _reading_ or _writing_ with + * serial_read() or serial_write(). * - * https://wiki.osdev.org/Serial_Ports + * Blocking + * -------- + * Please note that the calls will block if the buffers + * are full (and not read on the other end) _or_ no data is available + * for reading. * - * Call serial_init() once before reading and writing with serial_read() - * and serial_write(). Note that reading and writing might block. + * Dependencies + * ------------ + * The implmentation relies on x86_inb() and x86_outb() + * to be defined in _asm/x86.h_. + * + * Reference + * --------- + * The implementation was ruthlessly copied from here: https://wiki.osdev.org/Serial_Ports */ +// We need uint8_t and uint_32t // +#include <stdint.h> + /** Initialize COM1 **/ void serial_init(); /** read one byte from COM1 (blocking) **/ -char serial_read(); +uint8_t serial_read(); /** write one byte from COM1 (blocking) **/ -void serial_write(char a); +void serial_write(uint8_t a); + +#endif |
