cleanup
authorbrian <brian@brianweb.net>
Sun, 9 May 2004 08:51:37 +0000 (01:51 -0700)
committerbrian <brian@brianweb.net>
Sun, 9 May 2004 08:51:37 +0000 (01:51 -0700)
darcs-hash:20040509085137-24bed-4e5e480f72394e5e9f38b5a58c15341909074f72.gz

src/org/ibex/nestedvm/Runtime.java
src/org/ibex/nestedvm/UnixRuntime.java
upstream/Makefile

index 1af6f73..a758a50 100644 (file)
@@ -730,6 +730,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable {
             return hostFSDirFD(f,data);
         }
         
             return hostFSDirFD(f,data);
         }
         
+        // FIXME: Truncate
         final Seekable.File sf;
         try {
             sf = new Seekable.File(f,write);
         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 */
     }
     
     /** 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
     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() {
         public int pc;
         
         public CPUState dup() {
-                CPUState c = new CPUState();
+            CPUState c = new CPUState();
             c.hi = hi;
             c.lo = lo;
             c.fcsr = fcsr;
             c.hi = hi;
             c.lo = lo;
             c.fcsr = fcsr;
index 0bed8ed..723af47 100644 (file)
@@ -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;
             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
 
         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;
                 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() {
         }
         
         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 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; }
             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; }
index 3659aa6..f85070a 100644 (file)
@@ -167,7 +167,6 @@ version_busybox = 1.00-pre9
 url_busybox = http://busybox.net/downloads/busybox-$(version_busybox).tar.gz
 patches_busybox = busybox.patch
 
 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 && \
 tasks/extract_libjpeg: tasks/download_libjpeg
        mkdir -p build
        cd build && \