selfmade-os

view kernel.c @ 1:42ba76f77035

the kernel with output and mem alloc
author meillo@marmaro.de
date Sun, 01 Nov 2009 23:50:51 +0100
parents
children
line source
1 /* markus schnalke <meillo@marmaro.de> */
3 #include "io.h"
4 #include "mem.h"
6 void
7 kmain(void)
8 {
9 unsigned char* p;
11 cls();
12 printf("OS says: Hi!\n\n");
14 initmem(0x00400000); /* heap starts at 4MB */
16 printf("init done\n");
17 printf("\n");
19 p = malloc(28);
20 printf("allocated %d bytes at %p\n", 28, p);
21 p = malloc(15);
22 printf("allocated %d bytes at %p\n", 15, p);
24 printf("aa %d bb %c cc %s\n", 5, '@', "hallo");
25 printf("minmem: %p\n", 0x00400000);
27 setpos(24, 0);
28 printf("loop\n");
29 while (1) {
30 }
31 }