diff options
Diffstat (limited to 'driver')
| -rw-r--r-- | driver/keyboard.c | 9 | ||||
| -rw-r--r-- | driver/keyboard.h | 2 | ||||
| -rw-r--r-- | driver/mouse.c | 3 | ||||
| -rw-r--r-- | driver/serial.c | 4 | ||||
| -rw-r--r-- | driver/timer.c | 8 | ||||
| -rw-r--r-- | driver/vesa.c | 1 |
6 files changed, 10 insertions, 17 deletions
diff --git a/driver/keyboard.c b/driver/keyboard.c index cc060c7..2be9c12 100644 --- a/driver/keyboard.c +++ b/driver/keyboard.c @@ -17,7 +17,6 @@ static bool shift_l=false; static bool shift_r=false; static bool capslock=false; -static uint32_t kb_stream; static char num_syms[]={')','!','@','#','$','%','^','&','*','('}; int hex_to_dec(char c) @@ -30,13 +29,12 @@ int hex_to_dec(char c) extern struct netdev e1000_dev; static void put(uint8_t c) { - syscall_generic(SYSCALL_WRITE,kb_stream, (char *)&c , 1, 0); +// syscall_generic(SYSCALL_WRITE,kb_stream, (char *)&c , 1, 0); } uint32_t keyboard_interrupt(uint32_t esp) { - - ringbuffer_put(&kb_in,x86_inb(0x60)); + if(!ringbuffer_put(&kb_in,x86_inb(0x60))) kpanic("full"); return esp; } @@ -51,11 +49,10 @@ bool keyboard_worker() } -void keyboard_init(uint32_t s) +void keyboard_init() { kb_in=ringbuffer_init(1);// 4096 bytes ringbuffer; interrupt_register(INTERRUPT_KEYBOARD,&keyboard_interrupt); - kb_stream=s; } void keyboard_handle(uint8_t in) diff --git a/driver/keyboard.h b/driver/keyboard.h index 98f1f4e..007f1d1 100644 --- a/driver/keyboard.h +++ b/driver/keyboard.h @@ -8,6 +8,6 @@ #include <stdbool.h> -void keyboard_init(uint32_t s); +void keyboard_init(); void keyboard_handle(uint8_t in); bool keyboard_worker(); diff --git a/driver/mouse.c b/driver/mouse.c index 810cb83..274c9a5 100644 --- a/driver/mouse.c +++ b/driver/mouse.c @@ -81,8 +81,7 @@ static void mouse_write(uint8_t a_write) uint32_t mouse_interrupt(uint32_t esp) { - uint8_t b=x86_inb(0x60); - ringbuffer_put(&mouse_in,b); + if(!ringbuffer_put(&mouse_in,x86_inb(0x60)))kpanic("full"); return esp; } diff --git a/driver/serial.c b/driver/serial.c index 16b3b6c..4e43251 100644 --- a/driver/serial.c +++ b/driver/serial.c @@ -1,5 +1,3 @@ -#ifndef FOOLOS_LOG_OFF - #include "serial.h" #include "asm_x86.h" // provides x86_inb() and x86_outb() @@ -38,5 +36,3 @@ void serial_write(uint8_t a) while (is_transmit_empty() == 0); x86_outb(PORT,a); } - -#endif diff --git a/driver/timer.c b/driver/timer.c index 1a97ad8..0d9b11e 100644 --- a/driver/timer.c +++ b/driver/timer.c @@ -160,8 +160,8 @@ uint64_t timer_init() { uint64_t epoch_time=get_rtc_time(); - task_system_clock_start=epoch_time*100; // since pit ticks 100 times a second - asm_pit_rate_50ms(); //tick at 100hz + task_system_clock_start=epoch_time*20; // clock ticks 20 times a second + asm_pit_rate_50ms(); //tick at 20hz interrupt_register(INTERRUPT_PIT_TIMER,&timer_interrupt); @@ -170,10 +170,10 @@ uint64_t timer_init() uint64_t timer_get_ms() { - return (asm_pit_get_ticks()+task_system_clock_start)*50; + return (asm_pit_get_ticks()+task_system_clock_start)*50; // 50ms passed on each tick } uint64_t timer_get_uptime_ms() { - return asm_pit_get_ticks()*50; + return asm_pit_get_ticks()*50; // 50ms passed on each tick } diff --git a/driver/vesa.c b/driver/vesa.c index 7405422..bd5c53d 100644 --- a/driver/vesa.c +++ b/driver/vesa.c @@ -152,6 +152,7 @@ uint32_t vesa_init(multiboot_information *inf, foolfont *rawfont) int line_height=12; int col_width=10; + console_lines=vesaYres/line_height; console_cols=vesaXres/col_width; |
