1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/src/console.c

30 lines
632 B
C
Raw Normal View History

2020-11-30 06:32:12 -05:00
#ifdef ARCH_X86
#include <kernaux/arch/x86.h>
#endif
#include <kernaux/console.h>
#include <kernaux/stdlib.h>
void kernaux_console_print(const char *const s)
{
kernaux_console_write(s, kernaux_strlen(s));
}
void kernaux_console_putc(const char c __attribute__((unused))) {
#ifdef ARCH_X86
kernaux_arch_x86_outportb(0x3F8, c);
#endif
}
void kernaux_console_puts(const char *const s)
{
kernaux_console_print(s);
kernaux_console_putc('\n');
}
void kernaux_console_write(const char *const data, const unsigned int size) {
for (unsigned int i = 0; i < size; i++) {
kernaux_console_putc(data[i]);
}
}