diff options
author | Marvin Borner | 2021-01-08 14:51:11 +0100 |
---|---|---|
committer | Marvin Borner | 2021-01-08 14:51:11 +0100 |
commit | 01c570789d7f9ccc1521b791903c8a499b0f6323 (patch) | |
tree | e5275dbbc207db6be843df918b3944cc822d0819 /kernel/features/load.c | |
parent | 52920b03e996cf60b2665772837bfa0f1661a430 (diff) |
Kinda working VFS implementation
Diffstat (limited to 'kernel/features/load.c')
-rw-r--r-- | kernel/features/load.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/features/load.c b/kernel/features/load.c index e5b6903..1eb34d3 100644 --- a/kernel/features/load.c +++ b/kernel/features/load.c @@ -12,8 +12,10 @@ int bin_load(char *path, struct proc *proc) { // TODO: Remove hardcoded filesize - char *data = malloc(0xffff); - vfs_read(path, data, 0, 0xffff); + struct stat s = { 0 }; + vfs_stat(path, &s); + char *data = malloc(s.size); + vfs_read(path, data, 0, s.size); u32 stack = (u32)malloc(0x2000) + 0x1000; |