Mercurial > selfmade-os
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:99db6262c157 | 1:42ba76f77035 |
---|---|
1 /* markus schnalke <meillo@marmaro.de> */ | |
2 | |
3 #include "io.h" | |
4 #include "mem.h" | |
5 | |
6 void | |
7 kmain(void) | |
8 { | |
9 unsigned char* p; | |
10 | |
11 cls(); | |
12 printf("OS says: Hi!\n\n"); | |
13 | |
14 initmem(0x00400000); /* heap starts at 4MB */ | |
15 | |
16 printf("init done\n"); | |
17 printf("\n"); | |
18 | |
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); | |
23 | |
24 printf("aa %d bb %c cc %s\n", 5, '@', "hallo"); | |
25 printf("minmem: %p\n", 0x00400000); | |
26 | |
27 setpos(24, 0); | |
28 printf("loop\n"); | |
29 while (1) { | |
30 } | |
31 } |