00001
00010 #ifndef __KERN_IO_H__
00011 #define __KERN_IO_H__
00012
00013
00014
00015 #include <x86/seg.h>
00016 #include <x86/pic.h>
00017 #include <x86/base_irq.h>
00018 #include <x86/irq_list.h>
00019 #include <x86/proc_reg.h>
00020 #include <keyhelp.h>
00021 #include <interrupt.h>
00022 #include <interrupts.h>
00023 #include <list.h>
00024 #include <register.h>
00025 #include <syscall_int.h>
00026 #include <keyhelp.h>
00027 #include <vm.h>
00028 #include <thread.h>
00029 #include <scheduler.h>
00030 #include <console.h>
00031 #include <stdio.h>
00032 #include <string.h>
00033
00034
00035 #define KEYBOARD_INT INTERRUPT_VECTOR_INTERRUPTS+IRQ_KEYBOARD
00036
00037
00038 #define KEYBOARD_BUFFER_SIZE 4096
00039
00040
00041 struct rl{
00042
00043 int len;
00044
00045 char* buf;
00046 };
00047
00048
00049 struct sc{
00050
00051 int row;
00052
00053 int col;
00054 };
00055
00056
00057 struct gc{
00058
00059 int *row;
00060
00061 int *col;
00062 };
00063
00064
00073 int io_initialize();
00074
00075
00085 void keyboard_handler(InterruptVector vector, Registers *registers);
00086
00087
00088
00098 void getchar_handler(InterruptVector vector, Registers *registers);
00099
00100
00110 void readline_handler(InterruptVector vector, Registers *registers);
00111
00112
00122 void termcolor_handler(InterruptVector vector, Registers *registers);
00123
00124
00134 void getcursor_handler(InterruptVector vector, Registers *registers);
00135
00136
00146 void setcursor_handler(InterruptVector vector, Registers *registers);
00147
00157 void print_handler(InterruptVector vector, Registers *registers);
00158
00159
00168 int process_scode(void);
00169
00170
00180 void getchar_wake_handler(Thread* thread, void *data);
00181
00182
00192 void readline_wake_handler(Thread* thread, void *data);
00193
00202 void insert(int c);
00203
00204
00205 #endif