AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
binfmt.h
Go to the documentation of this file.
1#ifndef _SYS_BINFMT_H
2#define _SYS_BINFMT_H
3
4#include <core/system.h>
5#include <fs/vfs.h>
6#include <sys/proc.h>
7
10struct binfmt {
11 int (*check)(struct vnode *vnode);
12 int (*load)(struct proc *proc, const char *path, struct vnode *vnode);
13};
14
15/* Loads a program into a process, whatever its format. */
16int binfmt_load(struct proc *proc, const char *path, struct proc **ref);
17
18/* sys/binfmt/elf.c: ELF executables */
19int binfmt_elf_check(struct vnode *vnode);
20int binfmt_elf_load(struct proc *proc, const char *path, struct vnode *vnode);
21
22#endif /* ! _SYS_BINFMT_H */
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.
Definition elf.c:199
int binfmt_elf_load(struct proc *proc, const char *path, struct vnode *vnode)
Loads an ELF program into a process.
Definition elf.c:227
int binfmt_load(struct proc *proc, const char *path, struct proc **ref)
Loads a program into a process, for execve().
Definition binfmt.c:124
A format of executable files: says whether a file is one, and loads it into a process (sys/binfmt/).
Definition binfmt.h:10
int(*) check(struct vnode *vnode)
Definition binfmt.h:11
int(*) load(struct proc *proc, const char *path, struct vnode *vnode)
Definition binfmt.h:12
A process.
Definition proc.h:75
A file in memory (a vnode): what its inode says, and the kernel's own state.
Definition vfs.h:113
size_t ref
how many references there are to it
Definition vfs.h:133