2017-11-01 01:01:29 -04:00
|
|
|
#include "console.h"
|
|
|
|
|
2017-11-09 11:00:36 -05:00
|
|
|
#include "stdlib.h"
|
2017-11-09 11:12:25 -05:00
|
|
|
#include "asm.h"
|
2017-11-01 01:01:29 -04:00
|
|
|
|
|
|
|
void console_print(const char *const s)
|
|
|
|
{
|
2017-11-04 03:33:31 -04:00
|
|
|
console_write(s, kstrlen(s));
|
2017-11-01 01:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void console_putc(const char c) {
|
2017-11-09 11:12:25 -05:00
|
|
|
outportb(0x3F8, c);
|
2017-11-01 01:01:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void console_puts(const char *const s)
|
|
|
|
{
|
|
|
|
console_print(s);
|
|
|
|
console_putc('\n');
|
|
|
|
}
|
|
|
|
|
2017-11-01 06:08:09 -04:00
|
|
|
void console_write(const char *const data, const unsigned int size) {
|
|
|
|
for (unsigned int i = 0; i < size; i++) {
|
2017-11-01 01:01:29 -04:00
|
|
|
console_putc(data[i]);
|
|
|
|
}
|
|
|
|
}
|