0.0.2d: Added BGA support, graphics!
This commit is contained in:
@ -4,11 +4,14 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
#include <fs/vfs.h>
|
||||
|
||||
#include <processes.h>
|
||||
#include <sync.h>
|
||||
|
||||
|
||||
#define TTY_BUFFER_SIZE 4096
|
||||
#define TTY_RAW_BUFFER_SIZE 16
|
||||
#define MAX_TTYS 8 /* to make things easy, might change later */
|
||||
|
||||
#define TTY_ECHO 0x10 /* 0b00010000 */
|
||||
@ -16,7 +19,9 @@
|
||||
#define TTY_ACTIVE 0x01 /* 0b00000001 */
|
||||
|
||||
#define TTY_CANONICAL 0x40 /* 0b01000000 */
|
||||
#define TTY_RAW 0x04 /* 0b00000100 */
|
||||
|
||||
#define TTY_ADDCHAR_ALWAYS 0x02 /* 0b00000010 */
|
||||
|
||||
#define TTY_NULL 0x80 /* 0b10000000 --- used to end the list of tty_t structs in the ttys array */
|
||||
|
||||
@ -44,7 +49,17 @@ typedef struct tty_t {
|
||||
bool canonical;
|
||||
bool line_ready;
|
||||
|
||||
/* for raw mode */
|
||||
char raw_buf[TTY_RAW_BUFFER_SIZE];
|
||||
size_t raw_head;
|
||||
size_t raw_tail;
|
||||
|
||||
spinlock_t lock;
|
||||
|
||||
size_t user_input_start;
|
||||
size_t user_input_end;
|
||||
|
||||
struct file_ops f_ops;
|
||||
|
||||
pid_t foreground_pgid; /* not used yet */
|
||||
} tty_t;
|
||||
@ -60,9 +75,14 @@ int init_tty(void);
|
||||
ssize_t tty_read(tty_t* tty, char* buf, size_t count);
|
||||
ssize_t tty_read_active(char* buf, size_t count);
|
||||
|
||||
char tty_get_char(void);
|
||||
|
||||
tty_t* get_active_tty(void);
|
||||
tty_t* tty_get_active(void);
|
||||
|
||||
void tty_and_flags(tty_t* tty, uint32_t flags);
|
||||
uint32_t tty_get_flags(tty_t* tty);
|
||||
|
||||
tty_t* make_tty(uint32_t flags);
|
||||
|
||||
void tty_receive_char(char c, uint32_t kbd_mod);
|
||||
|
||||
Reference in New Issue
Block a user