Mercurial > lcfOS
comparison cos/kernel/initrd.c @ 32:3a6a9b929db0
Added initial ramdisk and some virtual file system functions
author | windel |
---|---|
date | Fri, 13 Jan 2012 18:18:17 +0100 |
parents | |
children | 35cc54e078dd |
comparison
equal
deleted
inserted
replaced
31:88590c42320f | 32:3a6a9b929db0 |
---|---|
1 /* | |
2 * Initial ramdisk filesystem driver. | |
3 * */ | |
4 | |
5 #include "kernel.h" | |
6 | |
7 fs_node_t *initrd_root = 0; | |
8 | |
9 typedef struct | |
10 { | |
11 uint32_t magic; | |
12 uint32_t numfiles; | |
13 } initrd_header_t; | |
14 | |
15 fs_node_t* initialize_initrd(uint64_t location) | |
16 { | |
17 // We need a valid malloc here! | |
18 initrd_root = (fs_node_t*)kmalloc(sizeof(fs_node_t)); | |
19 | |
20 initrd_header_t *header = (initrd_header_t*)location; | |
21 initrd_root->length = header->numfiles; | |
22 | |
23 return initrd_root; | |
24 } | |
25 |