more sanity checking. sanity checking disabled by default.

give every process a full pagetable by default now.

first step to disabling kernel page table code (processes
might not have page tables -> no address translation).
This commit is contained in:
Ben Gras
2009-05-12 11:35:01 +00:00
parent ebe050dbe2
commit e3ca89c0be
7 changed files with 87 additions and 40 deletions

View File

@@ -20,14 +20,14 @@ check_runqueues_f(char *file, int line)
{
int q, l = 0;
register struct proc *xp;
if(!intr_disabled()) {
minix_panic("check_runqueues called with interrupts enabled", NO_NUM);
}
#define MYPANIC(msg) { \
static char buf[100]; \
strcpy(buf, file); \
strcat(buf, ": "); \
util_nstrcat(buf, line);\
strcat(buf, ": "); \
strcat(buf, msg); \
minix_panic(buf, NO_NUM); \
kprintf("check_runqueues:%s:%d: %s\n", file, line, msg); \
minix_panic("check_runqueues failed", NO_NUM); \
}
for (xp = BEG_PROC_ADDR; xp < END_PROC_ADDR; ++xp) {
@@ -49,14 +49,30 @@ check_runqueues_f(char *file, int line)
MYPANIC("scheduling error");
}
for(xp = rdy_head[q]; xp != NIL_PROC; xp = xp->p_nextready) {
vir_bytes vxp = (vir_bytes) xp, dxp;
if(vxp < (vir_bytes) BEG_PROC_ADDR || vxp >= (vir_bytes) END_PROC_ADDR) {
MYPANIC("xp out of range");
}
dxp = vxp - (vir_bytes) BEG_PROC_ADDR;
if(dxp % sizeof(struct proc)) {
MYPANIC("xp not a real pointer");
}
if(xp->p_magic != PMAGIC) {
MYPANIC("magic wrong in xp");
}
if (RTS_ISSET(xp, SLOT_FREE)) {
kprintf("scheduling error: dead proc q %d %d\n",
q, xp->p_endpoint);
MYPANIC("dead proc on run queue");
}
if (!xp->p_ready) {
kprintf("scheduling error: unready on runq %d proc %d\n",
q, xp->p_nr);
MYPANIC("found unready process on run queue");
}
if (xp->p_priority != q) {
kprintf("scheduling error: wrong priority q %d proc %d\n",
q, xp->p_nr);
kprintf("scheduling error: wrong priority q %d proc %d ep %d name %s\n",
q, xp->p_nr, xp->p_endpoint, xp->p_name);
MYPANIC("wrong priority");
}
if (xp->p_found) {
@@ -76,6 +92,8 @@ check_runqueues_f(char *file, int line)
l = 0;
for (xp = BEG_PROC_ADDR; xp < END_PROC_ADDR; ++xp) {
if(xp->p_magic != PMAGIC)
MYPANIC("p_magic wrong in proc table");
if (! isemptyp(xp) && xp->p_ready && ! xp->p_found) {
kprintf("sched error: ready proc %d not on queue\n", xp->p_nr);
MYPANIC("ready proc not on scheduling queue");