AquilaOS documentation
How it works, and its code
Toggle main menu visibility
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
10
struct
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. */
16
int
binfmt_load
(
struct
proc
*
proc
,
const
char
*path,
struct
proc
**
ref
);
17
18
/* sys/binfmt/elf.c: ELF executables */
19
int
binfmt_elf_check
(
struct
vnode
*
vnode
);
20
int
binfmt_elf_load
(
struct
proc
*
proc
,
const
char
*path,
struct
vnode
*
vnode
);
21
22
#endif
/* ! _SYS_BINFMT_H */
binfmt_elf_check
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
binfmt_elf_load
int binfmt_elf_load(struct proc *proc, const char *path, struct vnode *vnode)
Loads an ELF program into a process.
Definition
elf.c:227
binfmt_load
int binfmt_load(struct proc *proc, const char *path, struct proc **ref)
Loads a program into a process, for execve().
Definition
binfmt.c:124
system.h
proc.h
binfmt
A format of executable files: says whether a file is one, and loads it into a process (sys/binfmt/).
Definition
binfmt.h:10
binfmt::check
int(*) check(struct vnode *vnode)
Definition
binfmt.h:11
binfmt::load
int(*) load(struct proc *proc, const char *path, struct vnode *vnode)
Definition
binfmt.h:12
proc
A process.
Definition
proc.h:75
vnode
A file in memory (a vnode): what its inode says, and the kernel's own state.
Definition
vfs.h:113
vnode::ref
size_t ref
how many references there are to it
Definition
vfs.h:133
vfs.h
kernel
include
sys
binfmt.h
Generated by
1.18.0