From ce19b7e20dac579f230f694615b1ef4df3e0b1ff Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 14 Oct 2024 23:14:26 +0200 Subject: [PATCH] Mon 14 Oct 23:14:00 CEST 2024 --- library/user-start.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 library/user-start.c diff --git a/library/user-start.c b/library/user-start.c new file mode 100644 index 0000000..3358d15 --- /dev/null +++ b/library/user-start.c @@ -0,0 +1,23 @@ +/* +Copyright (C) 2016-2019 The University of Notre Dame +This software is distributed under the GNU General Public License. +See the file LICENSE for details. +*/ + +/* +This module is the runtime start of every user-level program. +The very first symbol in this module must be _start() because +the kernel simply jumps to the very first location of the executable. +_start() sets up any necessary runtime environment and invokes +the main function. Note that this function cannot exit, but +must invoke the syscall_process_exit() system call to terminate the process. +*/ + +#include "library/syscalls.h" + +int main(int argc, const char *argv[]); + +void _start(int argc, const char **argv) +{ + syscall_process_exit(main(argc, argv)); +}