Skip to content

Commit

Permalink
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6…
Browse files Browse the repository at this point in the history
….828/xv6
  • Loading branch information
Robert Morris committed Aug 28, 2012
2 parents 8960f60 + 951b77f commit c1ee7eb
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 16 deletions.
4 changes: 2 additions & 2 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void kbdintr(void);
int cpunum(void);
extern volatile uint* lapic;
void lapiceoi(void);
void lapicinit(int);
void lapicinit(void);
void lapicstartap(uchar, uint);
void microdelay(int);

Expand Down Expand Up @@ -164,7 +164,7 @@ void uartputc(int);
void seginit(void);
void kvmalloc(void);
void vmenable(void);
pde_t* setupkvm();
pde_t* setupkvm(void);
char* uva2ka(pde_t*, char*);
int allocuvm(pde_t*, uint, uint);
int deallocuvm(pde_t*, uint, uint);
Expand Down
2 changes: 1 addition & 1 deletion exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exec(char *path, char **argv)
if(elf.magic != ELF_MAGIC)
goto bad;

if((pgdir = setupkvm(kalloc)) == 0)
if((pgdir = setupkvm()) == 0)
goto bad;

// Load program into memory.
Expand Down
2 changes: 1 addition & 1 deletion lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ lapicw(int index, int value)
//PAGEBREAK!

void
lapicinit(int c)
lapicinit(void)
{
if(!lapic)
return;
Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ main(void)
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // collect info about this machine
lapicinit(mpbcpu());
lapicinit();
seginit(); // set up segments
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
picinit(); // interrupt controller
Expand Down Expand Up @@ -48,7 +48,7 @@ mpenter(void)
{
switchkvm();
seginit();
lapicinit(cpunum());
lapicinit();
mpmain();
}

Expand Down
14 changes: 14 additions & 0 deletions printpcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# Decode the symbols from a panic EIP list

# Find a working addr2line
for p in i386-jos-elf-addr2line addr2line; do
if which $p 2>&1 >/dev/null && \
$p -h 2>&1 | grep -q '\belf32-i386\b'; then
break
fi
done

# Enable as much pretty-printing as this addr2line can do
$p $($p -h | grep ' -[aipsf] ' | awk '{print $1}') -e kernel "$@"
2 changes: 1 addition & 1 deletion proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ userinit(void)

p = allocproc();
initproc = p;
if((p->pgdir = setupkvm(kalloc)) == 0)
if((p->pgdir = setupkvm()) == 0)
panic("userinit: out of memory?");
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
p->sz = PGSIZE;
Expand Down
4 changes: 1 addition & 3 deletions syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ syscall(void)
int num;

num = proc->tf->eax;
if(num >= 0 && num < SYS_open && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else if (num >= SYS_open && num < NELEM(syscalls) && syscalls[num]) {
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
Expand Down
1 change: 0 additions & 1 deletion syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#define SYS_sbrk 12
#define SYS_sleep 13
#define SYS_uptime 14

#define SYS_open 15
#define SYS_write 16
#define SYS_mknod 17
Expand Down
10 changes: 5 additions & 5 deletions vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ static struct kmap {
uint phys_end;
int perm;
} kmap[] = {
{ (void*) KERNBASE, 0, EXTMEM, PTE_W}, // I/O space
{ (void*) KERNLINK, V2P(KERNLINK), V2P(data), 0}, // kernel text+rodata
{ (void*) data, V2P(data), PHYSTOP, PTE_W}, // kernel data, memory
{ (void*) DEVSPACE, DEVSPACE, 0, PTE_W}, // more devices
{ (void*)KERNBASE, 0, EXTMEM, PTE_W}, // I/O space
{ (void*)KERNLINK, V2P(KERNLINK), V2P(data), 0}, // kernel text+rodata
{ (void*)data, V2P(data), PHYSTOP, PTE_W}, // kernel data+memory
{ (void*)DEVSPACE, DEVSPACE, 0, PTE_W}, // more devices
};

// Set up kernel part of a page table.
pde_t*
setupkvm()
setupkvm(void)
{
pde_t *pgdir;
struct kmap *k;
Expand Down

0 comments on commit c1ee7eb

Please sign in to comment.