Mercurial > lcfOS
view cos/kernel/initrd.c @ 34:8012221dd740
Fixes for uninitialized data. This causes problems on real machines
author | windel |
---|---|
date | Mon, 16 Jan 2012 13:46:06 +0100 |
parents | 3a6a9b929db0 |
children | 35cc54e078dd |
line wrap: on
line source
/* * Initial ramdisk filesystem driver. * */ #include "kernel.h" fs_node_t *initrd_root = 0; typedef struct { uint32_t magic; uint32_t numfiles; } initrd_header_t; fs_node_t* initialize_initrd(uint64_t location) { // We need a valid malloc here! initrd_root = (fs_node_t*)kmalloc(sizeof(fs_node_t)); initrd_header_t *header = (initrd_header_t*)location; initrd_root->length = header->numfiles; return initrd_root; }