Modestus Moon OS  R4
CS 450 project
serial.h
Go to the documentation of this file.
1 #ifndef _SERIAL_H
2 #define _SERIAL_H
3 
4 #include <input.h>
5 
6 #define COM1 0x3f8
7 #define COM2 0x2f8
8 #define COM3 0x3e8
9 #define COM4 0x2e8
10 
11 /*
12  Procedure..: init_serial
13  Description..: Initializes devices for user interaction, logging, ...
14 */
15 int init_serial(int device);
16 
17 /*
18  Procedure..: serial_println
19  Description..: Writes a message to the active serial output device.
20  Appends a newline character.
21 */
22 int serial_println(const char *msg);
23 
24 /*
25  Procedure..: serial_print
26  Description..: Writes a message to the active serial output device.
27 */
28 int serial_print(const char *msg);
29 
30 /*
31  Procedure..: set_serial_out
32  Description..: Sets serial_port_out to the given device address.
33  All serial output, such as that from serial_println, will be
34  directed to this device.
35 */
36 int set_serial_out(int device);
37 
38 /*
39  Procedure..: set_serial_in
40  Description..: Sets serial_port_in to the given device address.
41  All serial input, such as console input via a virtual machine,
42  QEMU/Bochs/etc, will be directed to this device.
43 */
44 int set_serial_in(int device);
45 
46 /*
47  I might document this eventually
48 
49  MIGHT
50 */
51 char *serial_poll(char in_string[MAX_LENGTH]);
52 
53 #endif
#define MAX_LENGTH
Definition: input.h:6
int set_serial_out(int device)
Definition: serial.c:75
int serial_print(const char *msg)
Definition: serial.c:59
char in_string[MAX_LENGTH]
Definition: commhand.c:10
int init_serial(int device)
Definition: serial.c:26
int set_serial_in(int device)
Definition: serial.c:87
int serial_println(const char *msg)
Definition: serial.c:44
char * serial_poll(char in_string[MAX_LENGTH])
Definition: serial.c:114