Skip to content
Snippets Groups Projects
Commit c1ee7eb4 authored by Robert Morris's avatar Robert Morris
Browse files
parents 8960f60b 951b77f7
Branches
No related tags found
No related merge requests found
......@@ -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);
......@@ -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);
......
......@@ -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.
......
......@@ -50,7 +50,7 @@ lapicw(int index, int value)
//PAGEBREAK!
void
lapicinit(int c)
lapicinit(void)
{
if(!lapic)
return;
......
......@@ -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
......@@ -48,7 +48,7 @@ mpenter(void)
{
switchkvm();
seginit();
lapicinit(cpunum());
lapicinit();
mpmain();
}
......
printpcs 0 → 100755
#!/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 "$@"
......@@ -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;
......
......@@ -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",
......
......@@ -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
......
......@@ -120,13 +120,13 @@ static struct kmap {
} 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*)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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment