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