Try 2. sorry.
Thanks again to charles for finding that CLD issue.
ron
hg diff
diff -r c7e9b5edb8d4 src/9vx/main.c
--- a/src/9vx/main.c Sun Dec 27 09:49:22 2009 -0800
+++ b/src/9vx/main.c Fri Sep 03 16:58:16 2010 +0100
@@ -55,6 +55,7 @@
static void bootinit(void);
static void siginit(void);
+static void machkeyinit(void);
static char* getuser(void);
static char* findroot(void);
@@ -80,6 +81,9 @@
char buf[1024];
/* Minimal set up to make print work. */
+#ifndef TLS
+ machkeyinit();
+#endif
setmach(&mach0);
coherence = nop;
quotefmtinstall();
@@ -695,9 +699,6 @@
void
mach0init(void)
{
-#ifndef TLS
- machkeyinit();
-#endif
conf.nmach = 1;
machinit(); /* common per-processor init */
diff -r c7e9b5edb8d4 src/9vx/sched.c
--- a/src/9vx/sched.c Sun Dec 27 09:49:22 2009 -0800
+++ b/src/9vx/sched.c Fri Sep 03 16:58:16 2010 +0100
@@ -158,6 +158,8 @@
m->machno, p->pid, p->text, kprocq.n, nrunproc);
unlock(&kprocq.lk);
punlock(&run);
+ while(p->mach != nil)
+ sched_yield();
return p;
}
diff -r c7e9b5edb8d4 src/Makefrag
--- a/src/Makefrag Sun Dec 27 09:49:22 2009 -0800
+++ b/src/Makefrag Fri Sep 03 16:58:16 2010 +0100
@@ -1,7 +1,7 @@
# Main top-level makefile fragment for the vx32 virtual machine.
# Compiler flags common to both host and VX32 environment files.
-COMMON_CFLAGS = -g -O3 -MD -std=gnu99 -I. $(CFLAGS)
+COMMON_CFLAGS = -g -O2 -MD -std=gnu99 -I. -fno-stack-protector $(CFLAGS)
#COMMON_CFLAGS = -g -MD -std=gnu99 -I. $(CFLAGS)
COMMON_LDFLAGS = -g -L. $(LDFLAGS)
diff -r c7e9b5edb8d4 src/libvx32/run32.S
--- a/src/libvx32/run32.S Sun Dec 27 09:49:22 2009 -0800
+++ b/src/libvx32/run32.S Fri Sep 03 16:58:16 2010 +0100
@@ -111,6 +111,7 @@
popl %edi
popl %esi
popl %ebx
+ cld
ret
@@ -128,6 +129,8 @@
// (DS/ES/SS were already restored by vxrun_return.)
movw VXEMU_HOST_VS(%eax),VSEG
+ cld
+
ret
// Don't put anything here!