summaryrefslogtreecommitdiff
path: root/sys/kern/init.c
blob: 18feaa3b56bd8d797d635caffecc2605015b6cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <fdt.h>
#include <printf.h>
#include <stdint.h>
#include <mm/kalloc.h>

extern uint64_t HEAP_START;

void 
init(unsigned long hartid, struct fdt_header *fdt)
{
	printf("booting from hart #%d\n", hartid);
	if (fdt_uint32(fdt->magic) == FDT_HEADER_MAGIC) 
		printf("found flattened device tree at %p!\n", (uint64_t)fdt);
        
        printf("setting up the heap at %p\n", HEAP_START);
        kalloc_init();
        printf("done!\n");
        printf("printing free pages:\n");
        walkfree();
}