UnnamedOS
elf.h
Go to the documentation of this file.
1 
7 #ifndef TASKS_ELF_H
8 #define TASKS_ELF_H
9 
10 #include <stdint.h>
11 #include <mem/vmm.h>
12 #include <tasks/task.h>
13 
15 typedef struct {
16  struct {
17  uint8_t EI_MAG0,
18  EI_MAG1,
19  EI_MAG2,
20  EI_MAG3,
21  EI_CLASS,
22  EI_DATA,
23  EI_VERSION,
24  EI_OSABI;
25  uint32_t : 32,
26  : 32;
27  } __attribute__((packed)) e_ident;
28  uint16_t e_type;
29  uint16_t e_machine;
30  uint32_t e_version;
31  void* e_entry;
32  uint32_t e_phoff;
33  uint32_t e_shoff;
34  uint32_t e_flags;
35  uint16_t e_ehsize;
36  uint16_t e_phentsize;
37  uint16_t e_phnum;
38  uint16_t e_shentsize;
39  uint16_t e_shnum;
40  uint16_t e_shstrndx;
41 } __attribute__((packed)) elf_header_t;
42 
43 typedef elf_header_t elf_t;
44 
45 task_pid_t elf_create_task(elf_t* elf, size_t kernel_stack_len, size_t user_stack_len);
47 
48 #endif
49 
void elf_destroy_task(task_pid_t pid)
Destroys a user task running the code of an ELF file.
Definition: elf.c:166
task_pid_t elf_create_task(elf_t *elf, size_t kernel_stack_len, size_t user_stack_len)
Creates a user task running the code of an ELF file.
Definition: elf.c:148
uint32_t task_pid_t
unique process ID
Definition: task.h:17
uint8_t EI_VERSION
ELF version.
Definition: elf.h:17
The ELF header at the start of every ELF file.
Definition: elf.h:15