Initial commit
This commit is contained in:
commit
bae9ffa930
11 changed files with 847 additions and 0 deletions
32
init/main.c
Normal file
32
init/main.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include <limine/limine.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <dev/serial.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void done(void)
|
||||
{
|
||||
for (;;) {
|
||||
__asm__("hlt");
|
||||
}
|
||||
}
|
||||
|
||||
void write(char *s)
|
||||
{
|
||||
char c;
|
||||
while ((c = *s++)) {
|
||||
serial_write(c);
|
||||
}
|
||||
}
|
||||
|
||||
// The following will be our kernel's entry point.
|
||||
void _start(void)
|
||||
{
|
||||
// Ensure we got a terminal
|
||||
serial_init();
|
||||
int test = printf("test %d", -304);
|
||||
printf("\nExpect: 9, actual: %d\n", test);
|
||||
// We're done, just hang...
|
||||
done();
|
||||
}
|
||||
Loading…
Reference in a new issue