forked from KolibriOS/kolibrios
36 lines
740 B
C
36 lines
740 B
C
#include <shell_api.h>
|
|
#include <conio.h>
|
|
#include <stdlib.h>
|
|
|
|
int console_read()
|
|
{
|
|
}
|
|
|
|
void console_write(char* ptr, size_t len)
|
|
{
|
|
if (__shell_is_init < __SHELL_INIT_FAILED) {
|
|
shell_write_string(ptr, len);
|
|
}
|
|
if(__shell_is_init == __SHELL_INIT_FAILED) {
|
|
_ksys_debug_puts("console\n");
|
|
con_init();
|
|
con_write_string((char*)ptr, len);
|
|
}
|
|
}
|
|
|
|
void console_exit()
|
|
{
|
|
_ksys_debug_puts("console exit\n");
|
|
if (__shell_is_init < __SHELL_INIT_FAILED) {
|
|
_ksys_debug_puts("shell_exit\n");
|
|
shell_exit();
|
|
}
|
|
if(__shell_is_init == __SHELL_INIT_FAILED) {
|
|
|
|
if (__con_is_load) {
|
|
_ksys_debug_puts("con_exit\n");
|
|
con_exit(0);
|
|
}
|
|
}
|
|
}
|