Mercurial > selfmade-os
diff kernel.c @ 1:42ba76f77035 default tip
the kernel with output and mem alloc
author | meillo@marmaro.de |
---|---|
date | Sun, 01 Nov 2009 23:50:51 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kernel.c Sun Nov 01 23:50:51 2009 +0100 @@ -0,0 +1,31 @@ +/* markus schnalke <meillo@marmaro.de> */ + +#include "io.h" +#include "mem.h" + +void +kmain(void) +{ + unsigned char* p; + + cls(); + printf("OS says: Hi!\n\n"); + + initmem(0x00400000); /* heap starts at 4MB */ + + printf("init done\n"); + printf("\n"); + + p = malloc(28); + printf("allocated %d bytes at %p\n", 28, p); + p = malloc(15); + printf("allocated %d bytes at %p\n", 15, p); + + printf("aa %d bb %c cc %s\n", 5, '@', "hallo"); + printf("minmem: %p\n", 0x00400000); + + setpos(24, 0); + printf("loop\n"); + while (1) { + } +}