aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/load.c
diff options
context:
space:
mode:
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;