Files
bob16/kernel/kernel.c
T
2026-10-08 01:02:30 +02:00

29 lines
830 B
C

#include "runtime.h"
#include "runtime.c"
#include "files.c"
#include "compiler.c"
#include "shell.c"
#include "input.c"
#include "nano.c"
int main(void) {
int length; char *sample;
println("bob!");
#ifdef BOBC_WIDE
println("bob32 OS: help COMMAND for usage; go bob.c runs the example.");
#else
println("bob16 OS: help COMMAND for usage; go bob.c runs the example.");
#endif
println("Files are in RAM; halt exits. Type help to get started.");
sample = "int main(void) { println(\"bob!\"); return 0; }";
file_write("bob.c", sample, strlen(sample), 0);
while (1) {
print("bob> ");
length = shell_read_line();
if (length == -2) { bob_putc('\n'); return 0; }
if (length < 0) println("Command too long.");
else shell_command(command_line);
}
return 0;
}