diff options
Diffstat (limited to '')
-rw-r--r-- | kernel/old/drivers/serial.c (renamed from kernel/sio.c) | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/kernel/sio.c b/kernel/old/drivers/serial.c index 8bcc8a1..d6572e5 100644 --- a/kernel/sio.c +++ b/kernel/old/drivers/serial.c @@ -1,64 +1,3 @@ -/** -** @file sio.c -** -** @author Warren R. Carithers -** -** @brief SIO module -** -** For maximum compatibility from semester to semester, this code uses -** several "stand-in" type names and macros which should be defined -** in the accompanying "compat.h" header file if they're not part of -** the baseline system: -** -** standard-sized integer types: intN_t, uintN_t -** other types: PCBTYPE, QTYPE -** scheduler functions: SCHED, DISPATCH -** queue functions: QCREATE, QLENGTH, QDEQUE -** other functions: SLENGTH -** sio read queue: QNAME -** -** Our SIO scheme is very simple: -** -** Input: We maintain a buffer of incoming characters that haven't -** yet been read by processes. When a character comes in, if -** there is no process waiting for it, it goes in the buffer; -** otherwise, the first waiting process is awakeneda and it -** gets the character. -** -** When a process invokes readch(), if there is a character in -** the input buffer, the process gets it; otherwise, it is -** blocked until input appears -** -** Communication with system calls is via two routines. -** sio_readc() returns the first available character (if -** there is one), resetting the input variables if this was -** the last character in the buffer. If there are no -** characters in the buffer, sio_read() returns a -1 -** (presumably so the requesting process can be blocked). -** -** sio_read() copies the contents of the input buffer into -** a user-supplied buffer. It returns the number of characters -** copied. If there are no characters available, return a -1. -** -** Output: We maintain a buffer of outgoing characters that haven't -** yet been sent to the device, and an indication of whether -** or not we are in the middle of a transmit sequence. When -** an interrupt comes in, if there is another character to -** send we copy it to the transmitter buffer; otherwise, we -** end the transmit sequence. -** -** Communication with user processes is via three functions. -** sio_writec() writes a single character; sio_write() -** writes a sized buffer full of characters; sio_puts() -** prints a NUL-terminated string. If we are in the middle -** of a transmit sequence, all characters will be added -** to the output buffer (from where they will be sent -** automatically); otherwise, we send the first character -** directly, add the rest of the characters (if there are -** any) to the output buffer, and set the "sending" flag -** to indicate that we're expecting a transmitter interrupt. -*/ - #define KERNEL_SRC // this should do all includes required for this OS |