aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/load.c
diff options
context:
space:
mode:
authorMarvin Borner2021-01-08 14:51:11 +0100
committerMarvin Borner2021-01-08 14:51:11 +0100
commit01c570789d7f9ccc1521b791903c8a499b0f6323 (patch)
treee5275dbbc207db6be843df918b3944cc822d0819 /kernel/features/load.c
parent52920b03e996cf60b2665772837bfa0f1661a430 (diff)
Kinda working VFS implementation
Diffstat (limited to 'kernel/features/load.c')
-rw-r--r--kernel/features/load.c6
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;