view 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 source

/* 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) {
	}
}