diff options
-rw-r--r-- | README | 26 | ||||
-rw-r--r-- | elf.h | 3 | ||||
-rw-r--r-- | file.h | 3 | ||||
-rw-r--r-- | fs.c | 4 | ||||
-rw-r--r-- | kalloc.c | 1 | ||||
-rw-r--r-- | lapic.c | 2 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | mmu.h | 1 | ||||
-rw-r--r-- | proc.c | 4 | ||||
-rw-r--r-- | trap.c | 7 | ||||
-rw-r--r-- | vm.c | 3 |
11 files changed, 25 insertions, 33 deletions
@@ -34,22 +34,16 @@ Copyright 2006-2016 Frans Kaashoek, Robert Morris, and Russ Cox. ERROR REPORTS -If you spot errors or have suggestions for improvement, please send email to -Frans Kaashoek and Robert Morris (kaashoek,[email protected]). If you have -suggestions for improvements, please keep in mind that the main purpose of xv6 -is as a teaching operating system for MIT's 6.828. For example, we are in -particular interested in simplifications and clarifications, instead of -suggestions for new systems calls, more portability, etc. +Please send errors and suggestions to Frans Kaashoek and Robert Morris +(kaashoek,[email protected]). The main purpose of xv6 is as a teaching +operating system for MIT's 6.828, so we are more interested in +simplifications and clarifications than new features. BUILDING AND RUNNING XV6 -To build xv6 on an x86 ELF machine (like Linux or FreeBSD), run "make". -On non-x86 or non-ELF machines (like OS X, even on x86), you will -need to install a cross-compiler gcc suite capable of producing x86 ELF -binaries. See http://pdos.csail.mit.edu/6.828/2016/tools.html. -Then run "make TOOLPREFIX=i386-jos-elf-". - -To run xv6, install the QEMU PC simulators. To run in QEMU, run "make qemu". - -To create a typeset version of the code, run "make xv6.pdf". This -requires the "mpage" utility. See http://www.mesa.nl/pub/mpage/. +To build xv6 on an x86 ELF machine (like Linux or FreeBSD), run +"make". On non-x86 or non-ELF machines (like OS X, even on x86), you +will need to install a cross-compiler gcc suite capable of producing +x86 ELF binaries. See http://pdos.csail.mit.edu/6.828/2016/tools.html. +Then run "make TOOLPREFIX=i386-jos-elf-". Now install the QEMU PC +simulator and run "make qemu". @@ -40,6 +40,3 @@ struct proghdr { #define ELF_PROG_FLAG_EXEC 1 #define ELF_PROG_FLAG_WRITE 2 #define ELF_PROG_FLAG_READ 4 - -//PAGEBREAK! -// Blank page. @@ -35,6 +35,3 @@ struct devsw { extern struct devsw devsw[]; #define CONSOLE 1 - -//PAGEBREAK! -// Blank page. @@ -155,12 +155,12 @@ bfree(int dev, uint b) // have locked the inodes involved; this lets callers create // multi-step atomic operations. // -// The icache.lock spin-lock defends the allocation of icache +// The icache.lock spin-lock protects the allocation of icache // entries. Since ip->ref indicates whether an entry is free, // and ip->dev and ip->inum indicate which i-node an entry // holds, one must hold icache.lock while using any of those fields. // -// An ip->lock sleep-lock defends all ip-> fields other than ref, +// An ip->lock sleep-lock protects all ip-> fields other than ref, // dev, and inum. One must hold ip->lock in order to // read or write that inode's ip->valid, ip->size, ip->type, &c. @@ -51,7 +51,6 @@ freerange(void *vstart, void *vend) for(; p + PGSIZE <= (char*)vend; p += PGSIZE) kfree(p); } - //PAGEBREAK: 21 // Free the page of physical memory pointed at by v, // which normally should have been returned by a @@ -43,13 +43,13 @@ volatile uint *lapic; // Initialized in mp.c +//PAGEBREAK! static void lapicw(int index, int value) { lapic[index] = value; lapic[ID]; // wait for write to finish, by reading } -//PAGEBREAK! void lapicinit(void) @@ -110,3 +110,7 @@ pde_t entrypgdir[NPDENTRIES] = { //PAGEBREAK! // Blank page. //PAGEBREAK! +// Blank page. +//PAGEBREAK! +// Blank page. + @@ -49,7 +49,6 @@ // cpu->gdt[NSEGS] holds the above segments. #define NSEGS 6 -//PAGEBREAK! #ifndef __ASSEMBLER__ // Segment Descriptor struct segdesc { @@ -32,8 +32,8 @@ cpuid() { return mycpu()-cpus; } -// Must be called with interrupts disabled to avoid the caller being rescheduled -// between reading lapicid and running through the loop. +// Must be called with interrupts disabled to avoid the caller being +// rescheduled between reading lapicid and running through the loop. struct cpu* mycpu(void) { @@ -89,8 +89,8 @@ trap(struct trapframe *tf) // In user space, assume process misbehaved. cprintf("pid %d %s: trap %d err %d on cpu %d " "eip 0x%x addr 0x%x--kill proc\n", - myproc()->pid, myproc()->name, tf->trapno, tf->err, cpuid(), tf->eip, - rcr2()); + myproc()->pid, myproc()->name, tf->trapno, + tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; } @@ -102,7 +102,8 @@ trap(struct trapframe *tf) // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. - if(myproc() && myproc()->state == RUNNING && tf->trapno == T_IRQ0+IRQ_TIMER) + if(myproc() && myproc()->state == RUNNING && + tf->trapno == T_IRQ0+IRQ_TIMER) yield(); // Check if the process has been killed since we yielded @@ -164,7 +164,8 @@ switchuvm(struct proc *p) panic("switchuvm: no pgdir"); pushcli(); - mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, sizeof(mycpu()->ts)-1, 0); + mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, + sizeof(mycpu()->ts)-1, 0); mycpu()->gdt[SEG_TSS].s = 0; mycpu()->ts.ss0 = SEG_KDATA << 3; mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; |