diff options
author | Marvin Borner | 2020-05-01 14:10:57 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-01 14:10:57 +0200 |
commit | f0439a5dbfe2cfed3d629027d4b54b5f77f4e6de (patch) | |
tree | 6f5897314c3fe545e0fbe98dab85d24d245e2ccd /src/kernel/kernel.c | |
parent | 6b48e277cd249d0b5f7b5c7032457bb60dda46d6 (diff) |
Working vfs mount and read
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r-- | src/kernel/kernel.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index fb1a37e..08018c2 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -66,7 +66,16 @@ void kernel_main(uint32_t magic, uint32_t multiboot_address, uint32_t esp) load_binaries(); set_optimal_resolution(); - log("Content of /etc/test: %s", read_file("/etc/test")); + + struct fs_node *test = (struct fs_node *)kmalloc(sizeof(struct fs_node)); + strcpy(test->name, "/etc/test"); + ext2_root->open(test); + uint32_t size = ((struct ext2_file *)test->impl)->inode.size; + char buf[size]; + ext2_root->read(test, 0, size, buf); + buf[size - 1] = '\0'; + log("Content of /etc/test: %s", buf); + ext2_root->close(test); syscalls_install(); kexec("/bin/init"); |