diff --git a/fs/initrd.c b/fs/initrd.c index f763f5b..8623ded 100644 --- a/fs/initrd.c +++ b/fs/initrd.c @@ -224,8 +224,7 @@ static int initrd_open(fildes_t* file, const char* name) /* the first blist pointer have do remain valid. */ for(i=0; idata[i]) { - kfree(blist->data[i], - sizeof(data_block_t)); + kfree(blist->data[i]); } } if (blist->next) { @@ -237,12 +236,12 @@ static int initrd_open(fildes_t* file, const char* name) do { for(i=0; idata[i]) { - kfree(blist->data[i], sizeof(data_block_t)); + kfree(blist->data[i]); } } lastblist = blist; blist = blist->next; - kfree(lastblist, sizeof(block_list_t)); + kfree(lastblist); } while(blist); } @@ -428,9 +427,9 @@ static vfs_node_t* initrd_mkdir(vfs_node_t* node, const char* name) blist = blist->next; } while(blist); - kfree(dir_block, sizeof(dir_block_t)); + kfree(dir_block); out: - kfree(new_node, sizeof(vfs_node_t)); + kfree(new_node); return NULL; } diff --git a/include/eduos/fs.h b/include/eduos/fs.h index 4315109..b67a7c2 100644 --- a/include/eduos/fs.h +++ b/include/eduos/fs.h @@ -246,6 +246,7 @@ ssize_t write_fs(fildes_t* file, uint8_t* buffer, size_t size); /** @brief Yet to be documented */ int open_fs(fildes_t* file, const char* fname); + /** @brief Yet to be documented */ int close_fs(fildes_t * file); diff --git a/include/eduos/stdio.h b/include/eduos/stdio.h index 73835a9..8e813ae 100644 --- a/include/eduos/stdio.h +++ b/include/eduos/stdio.h @@ -77,6 +77,12 @@ int ksnprintf(char *str, size_t size, const char *format, ...); */ int kvprintf(char const *fmt, void (*func) (int, void *), void *arg, int radix, va_list ap); +struct vfs_node; +/** + * Init function to create a character device which represents all kernel messages + */ +int kmsg_init(struct vfs_node* node, const char *name); + /** * Add UART device to dump kernel messages */ diff --git a/kernel/main.c b/kernel/main.c index ffa351c..bc89fd4 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/libkern/stdio.c b/libkern/stdio.c index 5579c4b..c6ea8e0 100644 --- a/libkern/stdio.c +++ b/libkern/stdio.c @@ -145,7 +145,7 @@ int kmsg_init(vfs_node_t * node, const char *name) } } while (blist); - kfree(new_node, sizeof(vfs_node_t)); + kfree(new_node); return -ENOMEM; }