From: brian Date: Sun, 9 May 2004 08:51:37 +0000 (-0700) Subject: cleanup X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=commitdiff_plain;h=8c7ea58a4a2eade641083daa87987c5b5425dda2 cleanup darcs-hash:20040509085137-24bed-4e5e480f72394e5e9f38b5a58c15341909074f72.gz --- diff --git a/src/org/ibex/nestedvm/Runtime.java b/src/org/ibex/nestedvm/Runtime.java index 1af6f73..a758a50 100644 --- a/src/org/ibex/nestedvm/Runtime.java +++ b/src/org/ibex/nestedvm/Runtime.java @@ -730,6 +730,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { return hostFSDirFD(f,data); } + // FIXME: Truncate final Seekable.File sf; try { sf = new Seekable.File(f,write); @@ -802,6 +803,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { } /** The stat/fstat syscall helper */ + // FIXME: Populate uid/gid/nlink int stat(FStat fs, int addr) throws FaultException { memWrite(addr+0,(fs.dev()<<16)|(fs.inode()&0xffff)); // st_dev (top 16), // st_ino (bottom 16) memWrite(addr+4,((fs.type()&0xf000))|(fs.mode()&0xfff)); // st_mode @@ -1339,7 +1341,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { public int pc; public CPUState dup() { - CPUState c = new CPUState(); + CPUState c = new CPUState(); c.hi = hi; c.lo = lo; c.fcsr = fcsr; diff --git a/src/org/ibex/nestedvm/UnixRuntime.java b/src/org/ibex/nestedvm/UnixRuntime.java index 0bed8ed..723af47 100644 --- a/src/org/ibex/nestedvm/UnixRuntime.java +++ b/src/org/ibex/nestedvm/UnixRuntime.java @@ -543,7 +543,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { } } - private static class MP { + private static class MP implements Comparable { public MP(String path, FS fs) { this.path = path; this.fs = fs; } public String path; public FS fs; @@ -650,7 +650,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { public synchronized Object exec(UnixRuntime r, String path) throws ErrnoException { // FIXME: Hideous hack to make a standalone busybox possible - if(path.equals("bin/busybox") && r.getClass().getName().endsWith("BusyBox")) + if(path.equals("bin/busybox") && Boolean.valueOf(getSystemProperty("nestedvm.busyboxhack")).booleanValue()) return r.getClass(); FStat fstat = stat(r,path); if(fstat == null) return null; @@ -986,16 +986,12 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { } private FD devZeroFD = new FD() { - public boolean readable() { return true; } - public boolean writable() { return true; } public int read(byte[] a, int off, int length) { Arrays.fill(a,off,off+length,(byte)0); return length; } public int write(byte[] a, int off, int length) { return length; } public int seek(int n, int whence) { return 0; } public FStat _fstat() { return new DevFStat(){ public int inode() { return ZERO_INODE; } }; } }; private FD devNullFD = new FD() { - public boolean readable() { return true; } - public boolean writable() { return true; } public int read(byte[] a, int off, int length) { return 0; } public int write(byte[] a, int off, int length) { return length; } public int seek(int n, int whence) { return 0; } diff --git a/upstream/Makefile b/upstream/Makefile index 3659aa6..f85070a 100644 --- a/upstream/Makefile +++ b/upstream/Makefile @@ -167,7 +167,6 @@ version_busybox = 1.00-pre9 url_busybox = http://busybox.net/downloads/busybox-$(version_busybox).tar.gz patches_busybox = busybox.patch - tasks/extract_libjpeg: tasks/download_libjpeg mkdir -p build cd build && \