#ifndef FOOLOS_SERIAL_H #define FOOLOS_SERIAL_H /** * @file * MINIMALISTIC SERIAL PORT DRIVER for COM1 * ======================================== * Call serial_init() **once** before _reading_ or _writing_ with * serial_read() or serial_write(). * * 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. * * 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 /** Initialize COM1 **/ void serial_init(); /** read one byte from COM1 (blocking) **/ uint8_t serial_read(); /** write one byte from COM1 (blocking) **/ void serial_write(uint8_t a); #endif