Mente

riscv_xv6.htm

Notes on XV6 Risc-V

Key Terms

RISCV System Overview

Features of xv6

It contains the main Unix sys calls: grep, ls, grep, echo, kill, ln...

What is missing?

General Features

"SMP": shared memory multiprocessor

Memory Management

Scheduler

Boot sequence

Locking

"param.h"

Address Space

RISC Architecture

Anatomy of a system call

User space

Process:

System Calls

Exec()

Video

ELF File Format (contained in elf.h file)

sys_exec

exec()

We now deal with argument strings

We then push the array of argv[] pointers

loadseg(pagetable_t pagetable, uint64 va, struct inode *ip, uint offset, uint sz)

Load a program segment into pagetable at virtual address va. va must be page-aligned and the pages from va to va+sz must already be mapped. Returns 0 on success, -1 on failure.

uvmalloc(pagetable_t pagetable, uint64 oldsz, uint64 newsz, int xperm)

Allocate PTEs and physical memory to grow process from oldsz to newsz, which need not be page aligned. Returns new size or 0 on error.

TO REVIEW

Fork()

Child Process: