|
AquilaOS documentation
How it works, and its code
|
Go to the source code of this file.
Data Structures | |
| struct | binfmt |
| A format of executable files: says whether a file is one, and loads it into a process (sys/binfmt/). More... | |
Functions | |
| int | binfmt_load (struct proc *proc, const char *path, struct proc **ref) |
| Loads a program into a process, for execve(). | |
| int | binfmt_elf_check (struct vnode *vnode) |
| Says whether a file is an ELF program this kernel can run: its magic number, class and machine. | |
| int | binfmt_elf_load (struct proc *proc, const char *path, struct vnode *vnode) |
| Loads an ELF program into a process. | |
| int binfmt_elf_check | ( | struct vnode * | vnode | ) |
Says whether a file is an ELF program this kernel can run: its magic number, class and machine.
It is checked before the process's old program is destroyed.
| vnode | the file |
Definition at line 199 of file elf.c.
References binfmt_elf_check(), elf32_hdr::e_ident, elf32_hdr::e_machine, EI_CLASS, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, ELF_CLASS, ELF_MACHINE, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, and vfs_read().
Referenced by binfmt_elf_check().
Loads an ELF program into a process.
| proc | the process, whose address space is empty |
| path | not used |
| vnode | the program's file |
Definition at line 227 of file elf.c.
References binfmt_elf_load(), and binfmt_elf_load_segments().
Referenced by binfmt_elf_load().
Loads a program into a process, for execve().
The file must be a regular file that the process may execute, in a format the kernel knows.
| proc | the process, whose memory the program replaces |
| path | the program's path |
| ref | not used |
Definition at line 124 of file binfmt.c.
References binfmt_fmt_load(), binfmt_list, binfmt_load(), memset(), vnode::mode, NR_BINFMT, NULL, PROC_UIO, vfs_access(), vfs_close(), vfs_lookup(), and VFS_X.
Referenced by binfmt_load(), kmain(), and proc_execve().