0.0.2d: Added BGA support, graphics!
This commit is contained in:
24
lib/stdio.c
24
lib/stdio.c
@ -1,7 +1,8 @@
|
||||
#include <drivers/ps2_keyboard.h>
|
||||
#include <types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <drivers/ps2_keyboard.h>
|
||||
#include <kernel/syscall.h>
|
||||
#include <tty.h>
|
||||
|
||||
@ -13,7 +14,7 @@ int write(uint32_t fd, void* data, size_t len)
|
||||
{
|
||||
if (fd == STDOUT)
|
||||
{
|
||||
print_uint((uint32_t) len);
|
||||
/*print_uint((uint32_t) len);*/
|
||||
terminal_write((char*) data, len);
|
||||
}
|
||||
else
|
||||
@ -30,8 +31,14 @@ int read(uint32_t fd, void* data, size_t max_len)
|
||||
|
||||
if (fd == STDIN)
|
||||
{
|
||||
char* sptr = (char*) data; /* this really shouldn't be needed... */
|
||||
sptr = gets_new(&rv);
|
||||
char* rd = gets_new(&rv);
|
||||
size_t sz = strlen(rd);
|
||||
memcpy(data, rd, (sz < max_len) ? sz : max_len);
|
||||
|
||||
if (!rd)
|
||||
{
|
||||
printf("rd is NULL!\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -45,12 +52,7 @@ extern bool ps2keyboard_initialized;
|
||||
|
||||
char getchar(void)
|
||||
{
|
||||
if (ps2keyboard_initialized)
|
||||
{
|
||||
return get_char();
|
||||
}
|
||||
|
||||
return '\0';
|
||||
return tty_get_char();
|
||||
}
|
||||
|
||||
char* getstring(void)
|
||||
@ -92,6 +94,8 @@ int getstr(char* dest)
|
||||
}
|
||||
|
||||
strcpy(dest, p);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void putc(char c)
|
||||
|
||||
Reference in New Issue
Block a user