From 3cfa9290c155fdfafd18f8fd4465e9aeb23c5f10 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 14 Oct 2024 23:09:17 +0200 Subject: [PATCH] Mon 14 Oct 23:06:38 CEST 2024 --- kernel/elf.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 kernel/elf.h diff --git a/kernel/elf.h b/kernel/elf.h new file mode 100644 index 0000000..8fd47b5 --- /dev/null +++ b/kernel/elf.h @@ -0,0 +1,23 @@ +/* +Copyright (C) 2015-2019 The University of Notre Dame +This software is distributed under the GNU General Public License. +See the file LICENSE for details. +*/ + +#ifndef ELF_H +#define ELF_H + +#include "kernel/types.h" +#include "process.h" +#include "fs.h" + +/* +elf_load opens the given filename, and if it contains a valid +ELF executable, allocates space in the current process' pagetable, +loads the text, data, and bss into memory, and updates the +entry point value in the current process structure. +*/ + +int elf_load(struct process *p, struct fs_dirent *d, addr_t * entry); + +#endif