summaryrefslogtreecommitdiff
path: root/emu/Linux
diff options
context:
space:
mode:
Diffstat (limited to 'emu/Linux')
-rw-r--r--emu/Linux/emu-wrt108
-rwxr-xr-xemu/Linux/mk-wrt8
-rw-r--r--emu/Linux/os.c8
3 files changed, 122 insertions, 2 deletions
diff --git a/emu/Linux/emu-wrt b/emu/Linux/emu-wrt
new file mode 100644
index 00000000..c89ffedc
--- /dev/null
+++ b/emu/Linux/emu-wrt
@@ -0,0 +1,108 @@
+dev
+ root
+ cons
+ env
+ mnt
+ pipe
+ prog
+ prof
+ srv
+ dup
+ ssl
+ cap
+ fs
+ cmd cmd
+ indir
+
+# draw
+# pointer
+# snarf
+
+ ip ipif-posix ipaux
+# eia
+# audio audio
+ mem
+
+lib
+ interp
+# tk
+# freetype
+ math
+# draw
+
+# memlayer
+# memdraw
+ keyring
+ sec
+ mp
+
+ 9
+
+link
+
+mod
+ sys
+# draw
+
+# tk
+ math
+ srv srv
+ keyring
+ loader
+# freetype
+
+port
+ alloc
+ cache
+ chan
+ dev
+ dial
+ dis
+ discall
+ env
+ error
+ errstr
+ exception
+ exportfs
+ inferno
+ latin1
+ main
+ parse
+ pgrp
+ print
+ proc
+ qio
+ random
+ sysfile
+ uqid
+
+code
+ int dontcompile = 1;
+ unsigned long strtochan(char *s) {return 0;}
+
+init
+ emuinit
+
+root
+ /dev /
+ /fd /
+ /prog /
+ /net /
+ /net.alt /
+ /chan /
+ /nvfs /
+ /env /
+# /chan
+# /dev
+# /dis
+# /env
+# /n
+# /net
+# /nvfs /
+# /prog
+# /icons
+# /osinit.dis
+# /dis/emuinit.dis
+# /dis/lib/auth.dis
+# /dis/lib/ssl.dis
+# /n/local /
diff --git a/emu/Linux/mk-wrt b/emu/Linux/mk-wrt
new file mode 100755
index 00000000..f301ddea
--- /dev/null
+++ b/emu/Linux/mk-wrt
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+OPENWRT=$HOME/OpenWrt-SDK-Linux-i686-1
+INFERNO=/usr/inferno
+
+PATH=$OPENWRT/staging_dir_mipsel/bin:$INFERNO/Linux/386/bin:$PATH
+
+mk OBJTYPE=spim CONF=emu-wrt CONFLIST=emu-wrt SYSLIBS=-lm WIN= $*
diff --git a/emu/Linux/os.c b/emu/Linux/os.c
index 49aec7e5..b11ec83a 100644
--- a/emu/Linux/os.c
+++ b/emu/Linux/os.c
@@ -128,7 +128,7 @@ kproc(char *name, void (*func)(void*), void *arg, int flags)
if(flags & KPX11){
p->kstack = nil; /* never freed; also up not defined */
- tos = (char*)mallocz(X11STACK, 0) + X11STACK - sizeof(void*);
+ tos = (char*)mallocz(X11STACK, 0) + X11STACK - sizeof(vlong);
}else
p->kstack = stackalloc(p, &tos);
@@ -291,6 +291,10 @@ cleanexit(int x)
void
osreboot(char *file, char **argv)
{
+ if(dflag == 0)
+ termrestore();
+ execvp(file, argv);
+ error("reboot failure");
}
void
@@ -517,7 +521,7 @@ stackalloc(Proc *p, void **tos)
rv = stacklist.free;
stacklist.free = *(void **)rv;
unlock(&stacklist.l);
- *tos = rv + KSTACK - sizeof(void *);
+ *tos = rv + KSTACK - sizeof(vlong);
*(Proc **)rv = p;
return rv;
}