53 const char *root =
NULL, *rootfstype =
NULL;
60 printk(
"kernel: can't mount %s: error %d\n", root, -err);
61 panic(
"could not mount the root filesystem");
66 panic(
"No modules loaded: unable to load ramdisk");
71 struct uio uio = {.mask = 022};
76 printk(
"kernel: loading init process\n");
81 panic(
"failed to allocate process structure for init");
91 const char *init_p =
"/init";
94 printk(
"kernel: failed to load %s: error: %d\n", init_p, -err);
95 panic(
"could not load init process");
103 char *argp[] = {cmdline, 0};
108#if EARLYCON_DISABLE_ON_INIT
114 panic(
"Scheduler failed to spawn init");
void arch_proc_init(struct proc *proc)
Sets up the architecture's part of a new process's thread (init's, at boot): its kernel stack,...
int binfmt_load(struct proc *proc, const char *path, struct proc **ref)
Loads a program into a process, for execve().
#define DEV(major, minor)
int load_ramdisk(module_t *module)
Mounts the RAM disk as the root filesystem.
int kargs_get(const char *key, const char **value)
Looks up an argument of the kernel's command line.
void kdev_init()
Starts the device layer, at boot.
void kmain(struct boot *boot)
Starts the kernel's generic part, once the architecture has set up the CPU, memory and the platform.
int vfs_mknod(const char *path, mode_t mode, dev_t dev, struct uio *uio, struct vnode **ref)
Makes a node at a path.
int modules_init(void)
Runs the init function of every built-in module, at boot.
int vfs_mount_root_dev(const char *name, const char *type)
Mounts the root filesystem from a disk partition (the root=/dev/hda2 kernel argument).
int vfs_mount(const char *type, const char *dir, int flags, void *data, struct uio *uio)
Mounts a filesystem of a type on a directory, for mount().
struct pmap * pmap_switch(struct pmap *pmap)
Switches this CPU to an address space's page tables.
void earlycon_disable()
Stops sending the kernel's messages to the early console, once a real console has taken over.
int printk(const char *fmt,...)
Writes a kernel message, to the message buffer and the consoles.
int proc_new(struct proc **ref)
Makes a new process structure, with one thread and an empty address space, on the list of every proce...
void init_execve(struct proc *proc, int argc, char *const argv[], int envc, char *const envp[])
Sets up init, the first process, to start its program: its initial stack with its arguments and envir...
void sched_init_spawn(struct proc *init)
Starts the scheduler with the first process, init, and runs it.
struct vm_space vm_space
its address space
struct queue threads
its threads
Who does a filesystem operation: where its paths start, and its credentials and umask.
struct pmap * pmap
its page tables (the architecture's)
void vfs_init(void)
Sets up the VFS at boot.
void kvmem_selftest(void)
Runs the allocator's self-test, for the kvmem.test kernel argument, and prints whether it passed.
void kvmem_guardtest(void)
Writes one byte past the end of an object, for the kvmem.guard kernel argument: the guard page should...