Browse Source

This is a temporary patch.

TODO: remove most of it when we figure out what's wrong in trap.

But it will allow you to debug trap() with gdb.

Don't know how to use gdb with harvey yet? This is a great time to learn!

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 9 years ago
parent
commit
d404768871
4 changed files with 5 additions and 7 deletions
  1. 1 1
      sys/src/9/k10/l64idt.S
  2. 2 2
      sys/src/9/k10/trap.c
  3. 2 2
      sys/src/9/port/portclock.c
  4. 0 2
      sys/src/9/port/proc.c

+ 1 - 1
sys/src/9/k10/l64idt.S

@@ -17,7 +17,7 @@ _intre:
 	XCHGQ	%rax, (%rsp)
 _intrcommon:
 	//MOVBQZX	(%rax), %rAX
-	MOVQ	(%rax), %rAX
+	MOVL	%eax, %eax
 	XCHGQ	%rax, (%rsp)
 
 	SUBQ	$24, %rsp				/* R1[45], [DEFG]S */

+ 2 - 2
sys/src/9/k10/trap.c

@@ -322,7 +322,6 @@ _trap(Ureg *ureg)
 	 * and then call trap().
 	 * If we do this in trap(), we would overwrite that with our own cr2.
 	 */
-hi("TRAP\n");
 	if(ureg->type == VectorPF)
 		m->cr2 = cr2get();
 	trap(ureg);
@@ -343,7 +342,8 @@ trap(Ureg* ureg)
 	Vctl *ctl, *v;
 
 	vno = ureg->type;
-
+print("teyp %x\n", ureg->type);
+die("TRAP HANG\n");
 	m->perf.intrts = perfticks();
 	user = userureg(ureg);
 	if(user && (m->nixtype == NIXTC)){

+ 2 - 2
sys/src/9/port/portclock.c

@@ -245,7 +245,7 @@ timersinit(void)
 	t = malloc(sizeof(*t));
 	t->tmode = Tperiodic;
 	t->tt = nil;
-	t->tns = 1000000000/HZ;
+	t->tns = 10000000000; // 10 seconds.1000000000/HZ;
 	t->tf = nil;
 	timeradd(t);
 }
@@ -259,7 +259,7 @@ addclock0link(void (*f)(void), int ms)
 	/* Synchronize to hztimer if ms is 0 */
 	nt = malloc(sizeof(Timer));
 	if(ms == 0)
-		ms = 1000/HZ;
+		ms = 10000; // 10 seconds. 1000/HZ;
 	nt->tns = (int64_t)ms*1000000LL;
 	nt->tmode = Tperiodic;
 	nt->tt = nil;

+ 0 - 2
sys/src/9/port/proc.c

@@ -92,7 +92,6 @@ schedinit(void)		/* never returns */
 	ainc(&run.nmach);
 
 	setlabel(&m->sched);
-die("hi");
 	if(up) {
 		if((e = up->edf) && (e->flags & Admitted))
 			edfrecord(up);
@@ -199,7 +198,6 @@ sched(void)
 
 		procsave(up);
 		mmuflushtlb(m->pml4->pa);
-die("let's to setlabel etc.\n");
 		if(setlabel(&up->sched)){
 			procrestore(up);
 			spllo();