org.xwt.mips -> org.ibex.nestedvm
authorbrian <brian@brianweb.net>
Fri, 16 Apr 2004 23:54:06 +0000 (16:54 -0700)
committerbrian <brian@brianweb.net>
Fri, 16 Apr 2004 23:54:06 +0000 (16:54 -0700)
darcs-hash:20040416235406-24bed-c557be79adad6541a282cc40506e263afdf7d2c6.gz

22 files changed:
Makefile
src/org/ibex/nestedvm/ClassFileCompiler.java [moved from src/org/xwt/mips/ClassFileCompiler.java with 96% similarity]
src/org/ibex/nestedvm/ClassLoader.java [moved from src/org/xwt/mips/ClassLoader.java with 98% similarity]
src/org/ibex/nestedvm/Compiler.java [moved from src/org/xwt/mips/Compiler.java with 98% similarity]
src/org/ibex/nestedvm/Interpreter.java [moved from src/org/xwt/mips/Interpreter.java with 99% similarity]
src/org/ibex/nestedvm/JavaSourceCompiler.java [moved from src/org/xwt/mips/JavaSourceCompiler.java with 99% similarity]
src/org/ibex/nestedvm/Registers.java [moved from src/org/xwt/mips/Registers.java with 98% similarity]
src/org/ibex/nestedvm/Runtime.java [moved from src/org/xwt/mips/Runtime.java with 99% similarity]
src/org/ibex/nestedvm/UnixRuntime.java [moved from src/org/xwt/mips/UnixRuntime.java with 99% similarity]
src/org/ibex/nestedvm/UsermodeConstants.java [moved from src/org/xwt/mips/UsermodeConstants.java with 99% similarity]
src/org/ibex/nestedvm/crt0.c [moved from src/org/xwt/mips/crt0.c with 100% similarity]
src/org/ibex/nestedvm/linker.ld [moved from src/org/xwt/mips/linker.ld with 100% similarity]
src/org/ibex/nestedvm/support.s [moved from src/org/xwt/mips/support.s with 100% similarity]
src/org/ibex/nestedvm/support_aux.c [moved from src/org/xwt/mips/support_aux.c with 100% similarity]
src/org/ibex/nestedvm/syscalls.h [moved from src/org/xwt/mips/syscalls.h with 100% similarity]
src/org/ibex/nestedvm/util/ELF.java [moved from src/org/xwt/mips/ELF.java with 97% similarity]
src/org/ibex/nestedvm/util/Seekable.java [new file with mode: 0644]
src/org/xwt/mips/util/SeekableByteArray.java [deleted file]
src/org/xwt/mips/util/SeekableData.java [deleted file]
src/org/xwt/mips/util/SeekableFile.java [deleted file]
src/org/xwt/mips/util/SeekableInputStream.java [deleted file]
upstream/Makefile

index e1b6531..7f30324 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,11 @@
+.SECONDARY:
+
 # 
 # What to build
 #
 
 # Java sources that are part of the compiler/interpreter
-java_sources = $(wildcard src/org/xwt/mips/*.java) $(wildcard src/org/xwt/mips/util/*.java)
+java_sources = $(wildcard src/org/ibex/nestedvm/*.java) $(wildcard src/org/ibex/nestedvm/util/*.java)
 
 # C sources that are part of the compiler/interpreter
 mips_sources = crt0.c support_aux.c
@@ -34,8 +36,8 @@ mips_optflags = -O3 -g \
 MIPS_CFLAGS = $(mips_optflags) $(flags) -I. -Wall -Wno-unused -Werror
 MIPS_LD = mips-unknown-elf-gcc
 MIPS_LDFLAGS= \
-       $(flags) -L$(build)/org/xwt/mips --static \
-       -T $(mips2java_root)/src/org/xwt/mips/linker.ld -Wl,--gc-sections
+       $(flags) -L$(build)/org/ibex/nestedvm --static \
+       -T $(mips2java_root)/src/org/ibex/nestedvm/linker.ld -Wl,--gc-sections
 MIPS_STRIP = mips-unknown-elf-strip
 
 # Java compiler/VM settings
@@ -56,7 +58,7 @@ EXE_EXT =
 #####
 
 java_classes = $(java_sources:src/%.java=build/%.class)
-mips_objects = $(mips_sources:%.c=build/org/xwt/mips/%.o) $(mips_asm_sources:%.s=build/org/xwt/mips/%.o)
+mips_objects = $(mips_sources:%.c=build/org/ibex/nestedvm/%.o) $(mips_asm_sources:%.s=build/org/ibex/nestedvm/%.o)
 
 usr = $(mips2java_root)/upstream/install
 PATH := $(usr)/bin:$(PATH)
@@ -88,10 +90,10 @@ $(unistd_h): $(tasks)/build_newlib
 
 # This works around a gcj -C bug
 ifeq ($(firstword $(JAVAC)),gcj)
-build/org/xwt/mips/util/.Dummy.class:
+build/org/ibex/nestedvm/util/.Dummy.class:
        mkdir -p `dirname $@`
        touch $@
-$(java_classes): build/org/xwt/mips/util/.Dummy.class
+$(java_classes): build/org/ibex/nestedvm/util/.Dummy.class
 endif
 
 $(java_classes): $(java_sources) $(bcel_jar)
@@ -104,7 +106,7 @@ $(bcel_jar): upstream/tasks/extract_bcel
 # FIXME: We're cramming more than we need into the binary here
 build/mips2java$(EXE_EXT): $(java_sources) $(java_gen_sources)
        @mkdir -p `dirname $@`
-       $(GCJ) -s -o $@ --main=org.xwt.mips.Compiler $(java_sources) $(java_gen_sources)
+       $(GCJ) -s -o $@ --main=org.ibex.nestedvm.Compiler $(java_sources) $(java_gen_sources)
 
 #
 # MIPS Binary compilation
@@ -134,15 +136,15 @@ build/%.mips.stripped: build/%.mips
 # MIPS Compiler generated class compilation
 ifdef DO_JAVASOURCE
 
-build/%.java: build/%.mips build/org/xwt/mips/JavaSourceCompiler.class 
-       $(JAVA) -cp $(classpath) org.xwt.mips.Compiler -outformat javasource $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< > build/$*.java
+build/%.java: build/%.mips build/org/ibex/nestedvm/JavaSourceCompiler.class 
+       $(JAVA) -cp $(classpath) org.ibex.nestedvm.Compiler -outformat javasource $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $< > build/$*.java
 
-build/%.class: build/%.java build/org/xwt/mips/Runtime.class
+build/%.class: build/%.java build/org/ibex/nestedvm/Runtime.class
        $(JAVAC) $(JAVAC_NODEBUG_FLAGS) -classpath build -d build $<
 else
 
-build/%.class: build/%.mips build/org/xwt/mips/ClassFileCompiler.class
-       $(JAVA) -cp $(classpath) org.xwt.mips.Compiler -outformat class -outfile $@ $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $<
+build/%.class: build/%.mips build/org/ibex/nestedvm/ClassFileCompiler.class
+       $(JAVA) -cp $(classpath) org.ibex.nestedvm.Compiler -outformat class -outfile $@ $(compiler_flags) $($(notdir $*)_COMPILERFLAGS) $(subst /,.,$*) $<
 
 
 endif
@@ -152,12 +154,12 @@ build/%.class: src/%.java
        $(JAVAC) -classpath build -d build $<
 
 clean:
-       rm -rf build/tests build/org/xwt/mips *.jar build/mips2java$(EXE_EXT)
+       rm -rf build/tests build/org/ibex/nestedvm *.jar build/mips2java$(EXE_EXT)
 
 #
 # env.sh
 #
-env.sh: Makefile $(tasks)/full_toolchain build/org/xwt/mips/Compiler.class
+env.sh: Makefile $(tasks)/full_toolchain build/org/ibex/nestedvm/Compiler.class
        @rm -f "$@~"
        @echo 'PATH="$(mips2java_root)/build:$(usr)/bin:$$PATH"; export PATH' >> $@~
        @echo 'CC=mips-unknown-elf-gcc; export CC' >> $@~
@@ -181,26 +183,26 @@ runtime_util_classes = SeekableData SeekableByteArray SeekableFile SeekableInput
 runtime_classes = Runtime Registers UsermodeConstants  $(runtime_util_classes:%=util/%)
 unixruntime_classes = $(runtime_classes) UnixRuntime
 
-runtime.jar: $(runtime_classes:%=build/org/xwt/mips/%.class)
-       cd build && jar cf ../$@ $(runtime_classes:%=org/xwt/mips/%*.class)
+runtime.jar: $(runtime_classes:%=build/org/ibex/nestedvm/%.class)
+       cd build && jar cf ../$@ $(runtime_classes:%=org/ibex/nestedvm/%*.class)
 
-unixruntime.jar: $(unixruntime_classes:%=build/org/xwt/mips/%.class)
-       cd build && jar cf ../$@ $(unixruntime_classes:%=org/xwt/mips/%*.class)
+unixruntime.jar: $(unixruntime_classes:%=build/org/ibex/nestedvm/%.class)
+       cd build && jar cf ../$@ $(unixruntime_classes:%=org/ibex/nestedvm/%*.class)
 
 # This is only for Brian to use... don't mess with it
-rebuild-constants: src/org/xwt/mips/syscalls.h $(errno_h) $(unistd_h)
+rebuild-constants: src/org/ibex/nestedvm/syscalls.h $(errno_h) $(unistd_h)
        @mkdir -p `dirname $@`
        cat $^ | ( \
                echo "// THIS FILE IS AUTOGENERATED! DO NOT EDIT!"; \
                echo "// run \"make rebuild-constants\" if it needs to be updated"; \
                echo ""; \
-               echo "package org.xwt.mips;"; \
+               echo "package org.ibex.nestedvm;"; \
                echo "public interface UsermodeConstants {"; \
                tr '\t' ' ' | sed -n ' \
                        s/  */ /g; \
                        s/ *# *define \([A-Z_][A-Za-z0-9_]*\) \([0-9][0-9x]*\)/    public static final int \1 = \2;/p'; \
                echo "}"; \
-       ) > src/org/xwt/mips/UsermodeConstants.java
+       ) > src/org/ibex/nestedvm/UsermodeConstants.java
        
 #
 # Tests
@@ -208,13 +210,13 @@ rebuild-constants: src/org/xwt/mips/syscalls.h $(errno_h) $(unistd_h)
 # to build or run mips2java
 #
 
-build/tests/Env.class: build/org/xwt/mips/Runtime.class build/org/xwt/mips/Interpreter.class
+build/tests/Env.class: build/org/ibex/nestedvm/Runtime.class build/org/ibex/nestedvm/Interpreter.class
 
 # Generic Hello Worldish test
 test: build/tests/Test.class
        $(JAVA) -cp build tests.Test "arg 1" "arg 2" "arg 3"
-inttest: build/tests/Test.mips build/org/xwt/mips/Interpreter.class
-       $(JAVA) -cp build org.xwt.mips.Interpreter build/tests/Test.mips "arg 1" "arg 2" "arg 3"
+inttest: build/tests/Test.mips build/org/ibex/nestedvm/Interpreter.class
+       $(JAVA) -cp build org.ibex.nestedvm.Interpreter build/tests/Test.mips "arg 1" "arg 2" "arg 3"
 cxxtest: build/tests/CXXTest.class
        $(JAVA) -cp build tests.CXXTest
 
@@ -307,7 +309,7 @@ boehmgctest: build/tests/Env.class build/tests/GCTest.class
 # Speed tests
 #
 
-build/tests/SpeedTest.class: build/org/xwt/mips/Runtime.class
+build/tests/SpeedTest.class: build/org/ibex/nestedvm/Runtime.class
 
 tmp/thebride_1280.jpg:
        @mkdir -p tmp
@@ -345,8 +347,8 @@ speedtest: build/tests/SpeedTest.class build/tests/DJpeg.class build/tests/FTBen
                echo "Run \"make check\" to get the MS True Type fonts for the MSPackBench test"; \
        fi
 
-intspeed: build/tests/DJpeg.mips  build/org/xwt/mips/Interpreter.class tmp/thebride_1280.jpg
-       time $(JAVA) -cp build org.xwt.mips.Interpreter build/tests/DJpeg.mips -targa  -outfile tmp/thebride_1280.tga tmp/thebride_1280.jpg
+intspeed: build/tests/DJpeg.mips  build/org/ibex/nestedvm/Interpreter.class tmp/thebride_1280.jpg
+       time $(JAVA) -cp build org.ibex.nestedvm.Interpreter build/tests/DJpeg.mips -targa  -outfile tmp/thebride_1280.tga tmp/thebride_1280.jpg
        @echo "e90f6b915aee2fc0d2eb9fc60ace6203  tmp/thebride_1280.tga" | md5sum -c && echo "MD5 is OK"
 
 #
similarity index 96%
rename from src/org/xwt/mips/ClassFileCompiler.java
rename to src/org/ibex/nestedvm/ClassFileCompiler.java
index fe212c3..0d48aba 100644 (file)
@@ -1,7 +1,7 @@
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
 import java.io.*;
-import org.xwt.mips.util.*;
+import org.ibex.nestedvm.util.*;
 
 import org.apache.bcel.generic.*;
 
@@ -66,8 +66,8 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         return new MethodGen(flags,ret,args,null,name,fullClassName,new FixedInstructionList(),cp);
     }
     
-    public ClassFileCompiler(String path, String className, OutputStream os) throws IOException { this(new SeekableFile(path),className,os); }
-    public ClassFileCompiler(SeekableData binary, String className, OutputStream os) throws IOException {
+    public ClassFileCompiler(String path, String className, OutputStream os) throws IOException { this(new Seekable.File(path),className,os); }
+    public ClassFileCompiler(Seekable binary, String className, OutputStream os) throws IOException {
         super(binary,className);
         this.os = os;
     }
@@ -133,7 +133,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         
         // Trampoline
         MethodGen tramp = newMethod(ACC_PRIVATE,Type.VOID, Type.NO_ARGS, "trampoline");
-        tramp.addException("org.xwt.mips.Runtime$ExecutionException");
+        tramp.addException("org.ibex.nestedvm.Runtime$ExecutionException");
         selectMethod(tramp);
         
         InstructionHandle start = a(InstructionConstants.ALOAD_0);
@@ -162,7 +162,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         }
         
         ts.setTarget(a(InstructionConstants.POP)); // default case
-        a(fac.createNew("org.xwt.mips.Runtime$ExecutionException"));
+        a(fac.createNew("org.ibex.nestedvm.Runtime$ExecutionException"));
         a(InstructionConstants.DUP);
         a(fac.createNew("java.lang.StringBuffer"));
         a(InstructionConstants.DUP);
@@ -179,7 +179,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         a(new PUSH(cp,')'));
         a(fac.createInvoke("java.lang.StringBuffer","append",Type.STRINGBUFFER,new Type[]{Type.CHAR},INVOKEVIRTUAL));
         a(fac.createInvoke("java.lang.StringBuffer","toString",Type.STRING,Type.NO_ARGS,INVOKEVIRTUAL));
-        a(fac.createInvoke("org.xwt.mips.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
+        a(fac.createInvoke("org.ibex.nestedvm.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
         a(InstructionConstants.ATHROW);
         
         stateCheck.setTarget(a(InstructionConstants.RETURN));
@@ -280,10 +280,10 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
             cl.addMethod(lookupSymbol.getMethod());
         }
         
-        MethodGen setCPUState = newMethod(ACC_PROTECTED,Type.VOID,new Type[]{Type.getType("Lorg/xwt/mips/Runtime$CPUState;")},"setCPUState");
+        MethodGen setCPUState = newMethod(ACC_PROTECTED,Type.VOID,new Type[]{Type.getType("Lorg/ibex/nestedvm/Runtime$CPUState;")},"setCPUState");
         selectMethod(setCPUState);
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","r",new ArrayType(Type.INT,1),GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","r",new ArrayType(Type.INT,1),GETFIELD));
         a(InstructionConstants.ASTORE_2);
         for(int i=1;i<32;i++) {
             a(InstructionConstants.ALOAD_0);
@@ -293,7 +293,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
             a(fac.createFieldAccess(fullClassName,"r"+i,Type.INT, PUTFIELD));
         }
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","f",new ArrayType(Type.INT,1),GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","f",new ArrayType(Type.INT,1),GETFIELD));
         a(InstructionConstants.ASTORE_2);
         for(int i=0;i<32;i++) {
             a(InstructionConstants.ALOAD_0);
@@ -304,34 +304,34 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         }
         a(InstructionConstants.ALOAD_0);
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","hi",Type.INT,GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","hi",Type.INT,GETFIELD));
         a(fac.createFieldAccess(fullClassName,"hi",Type.INT, PUTFIELD));
         a(InstructionConstants.ALOAD_0);
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","lo",Type.INT,GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","lo",Type.INT,GETFIELD));
         a(fac.createFieldAccess(fullClassName,"lo",Type.INT, PUTFIELD));
         a(InstructionConstants.ALOAD_0);
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","fcsr",Type.INT,GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","fcsr",Type.INT,GETFIELD));
         a(fac.createFieldAccess(fullClassName,"fcsr",Type.INT, PUTFIELD));
         a(InstructionConstants.ALOAD_0);
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","pc",Type.INT,GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","pc",Type.INT,GETFIELD));
         a(fac.createFieldAccess(fullClassName,"pc",Type.INT, PUTFIELD));
         a(InstructionConstants.RETURN);
         setCPUState.setMaxLocals();
         setCPUState.setMaxStack();
         cl.addMethod(setCPUState.getMethod());
         
-        MethodGen getCPUState = newMethod(ACC_PROTECTED,Type.getType("Lorg/xwt/mips/Runtime$CPUState;"),Type.NO_ARGS,"getCPUState");
+        MethodGen getCPUState = newMethod(ACC_PROTECTED,Type.getType("Lorg/ibex/nestedvm/Runtime$CPUState;"),Type.NO_ARGS,"getCPUState");
         selectMethod(getCPUState);
-        a(fac.createNew("org.xwt.mips.Runtime$CPUState"));
+        a(fac.createNew("org.ibex.nestedvm.Runtime$CPUState"));
         a(InstructionConstants.DUP);
-        a(fac.createInvoke("org.xwt.mips.Runtime$CPUState","<init>",Type.VOID,Type.NO_ARGS,INVOKESPECIAL));
+        a(fac.createInvoke("org.ibex.nestedvm.Runtime$CPUState","<init>",Type.VOID,Type.NO_ARGS,INVOKESPECIAL));
         a(InstructionConstants.ASTORE_1);
         
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","r",new ArrayType(Type.INT,1),GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","r",new ArrayType(Type.INT,1),GETFIELD));
         a(InstructionConstants.ASTORE_2);
         for(int i=1;i<32;i++) {
             a(InstructionConstants.ALOAD_2);
@@ -342,7 +342,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         }
         
         a(InstructionConstants.ALOAD_1);
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","f",new ArrayType(Type.INT,1),GETFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","f",new ArrayType(Type.INT,1),GETFIELD));
         a(InstructionConstants.ASTORE_2);
         for(int i=0;i<32;i++) {
             a(InstructionConstants.ALOAD_2);
@@ -354,19 +354,19 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         a(InstructionConstants.ALOAD_1);
         a(InstructionConstants.ALOAD_0);
         a(fac.createFieldAccess(fullClassName,"hi",Type.INT, GETFIELD));
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","hi",Type.INT,PUTFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","hi",Type.INT,PUTFIELD));
         a(InstructionConstants.ALOAD_1);
         a(InstructionConstants.ALOAD_0);
         a(fac.createFieldAccess(fullClassName,"lo",Type.INT, GETFIELD));
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","lo",Type.INT,PUTFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","lo",Type.INT,PUTFIELD));
         a(InstructionConstants.ALOAD_1);
         a(InstructionConstants.ALOAD_0);
         a(fac.createFieldAccess(fullClassName,"fcsr",Type.INT, GETFIELD));
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","fcsr",Type.INT,PUTFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","fcsr",Type.INT,PUTFIELD));
         a(InstructionConstants.ALOAD_1);
         a(InstructionConstants.ALOAD_0);
         a(fac.createFieldAccess(fullClassName,"pc",Type.INT, GETFIELD));
-        a(fac.createFieldAccess("org.xwt.mips.Runtime$CPUState","pc",Type.INT,PUTFIELD));
+        a(fac.createFieldAccess("org.ibex.nestedvm.Runtime$CPUState","pc",Type.INT,PUTFIELD));
         
         a(InstructionConstants.ALOAD_1);
         a(InstructionConstants.ARETURN);
@@ -425,7 +425,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
             selectList(clinitExtras);
             a(new PUSH(cp,sb.toString()));
             a(new PUSH(cp,segSize/4));
-            a(fac.createInvoke("org.xwt.mips.Runtime","decodeData",new ArrayType(Type.INT,1),new Type[]{Type.STRING,Type.INT},INVOKESTATIC));
+            a(fac.createInvoke("org.ibex.nestedvm.Runtime","decodeData",new ArrayType(Type.INT,1),new Type[]{Type.STRING,Type.INT},INVOKESTATIC));
             a(fac.createPutStatic(fullClassName,fieldname,new ArrayType(Type.INT,1)));
 
             selectList(initExtras);
@@ -566,7 +566,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
         // move the default jump target (lookupswitch) to before the throw
         insnList.move(defaultHandle,insnList.getEnd());
         if(debugCompiler) {
-            a(fac.createNew("org.xwt.mips.Runtime$ExecutionException"));
+            a(fac.createNew("org.ibex.nestedvm.Runtime$ExecutionException"));
             a(InstructionConstants.DUP);
             a(fac.createNew("java.lang.StringBuffer"));
             a(InstructionConstants.DUP);
@@ -576,13 +576,13 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
             a(fac.createFieldAccess(fullClassName,"pc",Type.INT, GETFIELD));
             a(fac.createInvoke("java.lang.StringBuffer","append",Type.STRINGBUFFER,new Type[]{Type.INT},INVOKEVIRTUAL));
             a(fac.createInvoke("java.lang.StringBuffer","toString",Type.STRING,Type.NO_ARGS,INVOKEVIRTUAL));
-            a(fac.createInvoke("org.xwt.mips.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
+            a(fac.createInvoke("org.ibex.nestedvm.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
             a(InstructionConstants.ATHROW);
         } else {
-            a(fac.createNew("org.xwt.mips.Runtime$ExecutionException"));
+            a(fac.createNew("org.ibex.nestedvm.Runtime$ExecutionException"));
             a(InstructionConstants.DUP);
             a(new PUSH(cp,"Jumped to invalid address"));
-            a(fac.createInvoke("org.xwt.mips.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
+            a(fac.createInvoke("org.ibex.nestedvm.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
             a(InstructionConstants.ATHROW);
         }
 
@@ -769,10 +769,10 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
                 
                 break;
             case 13: // BREAK
-                a(fac.createNew("org.xwt.mips.Runtime$ExecutionException"));
+                a(fac.createNew("org.ibex.nestedvm.Runtime$ExecutionException"));
                 a(InstructionConstants.DUP);
                 a(new PUSH(cp,"BREAK Code " + toHex(breakCode)));
-                a(fac.createInvoke("org.xwt.mips.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
+                a(fac.createInvoke("org.ibex.nestedvm.Runtime$ExecutionException","<init>",Type.VOID,new Type[]{Type.STRING},INVOKESPECIAL));
                 a(InstructionConstants.ATHROW);
                 unreachable = true;
                 break;
similarity index 98%
rename from src/org/xwt/mips/ClassLoader.java
rename to src/org/ibex/nestedvm/ClassLoader.java
index 510d309..f51cd51 100644 (file)
@@ -1,4 +1,4 @@
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
 import java.io.*;
 
similarity index 98%
rename from src/org/xwt/mips/Compiler.java
rename to src/org/ibex/nestedvm/Compiler.java
index de457e7..de5a048 100644 (file)
@@ -1,12 +1,11 @@
 // Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
 
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
 import java.util.*;
 import java.io.*;
 
-import org.xwt.mips.util.SeekableData;
-import org.xwt.mips.util.SeekableFile;
+import org.ibex.nestedvm.util.*;
 
 public abstract class Compiler implements Registers {    
     /** The ELF binary being read */
@@ -64,7 +63,7 @@ public abstract class Compiler implements Registers {
     
     protected boolean nullPointerCheck = false;
     
-    protected String runtimeClass = "org.xwt.mips.Runtime";
+    protected String runtimeClass = "org.ibex.nestedvm.Runtime";
     
     protected String hashClass = "java.util.Hashtable";
     
@@ -144,7 +143,7 @@ public abstract class Compiler implements Registers {
         }
         if(className == null || mipsBinaryFileName == null) usage();
         
-        SeekableData mipsBinary = new SeekableFile(mipsBinaryFileName);
+        Seekable mipsBinary = new Seekable.File(mipsBinaryFileName);
         
         Writer w = null;
         OutputStream os = null;
@@ -185,7 +184,7 @@ public abstract class Compiler implements Registers {
         }
     }
         
-    public Compiler(SeekableData binary, String fullClassName) throws IOException {
+    public Compiler(Seekable binary, String fullClassName) throws IOException {
         this.fullClassName = fullClassName;
         elf = new ELF(binary);
         
@@ -249,7 +248,7 @@ public abstract class Compiler implements Registers {
             findBranchesInText(text.addr,new DataInputStream(text.getInputStream()),text.size,jumpableAddresses);            
         }
 
-        if(unixRuntime && runtimeClass.startsWith("org.xwt.mips.")) runtimeClass = "org.xwt.mips.UnixRuntime";
+        if(unixRuntime && runtimeClass.startsWith("org.ibex.nestedvm.")) runtimeClass = "org.ibex.nestedvm.UnixRuntime";
         
         for(int i=0;i<elf.sheaders.length;i++) {
             String name = elf.sheaders[i].name;
similarity index 99%
rename from src/org/xwt/mips/Interpreter.java
rename to src/org/ibex/nestedvm/Interpreter.java
index f95df92..cd82365 100644 (file)
@@ -2,9 +2,9 @@
 // Based on org.xwt.imp.MIPS by Adam Megacz
 // Portions Copyright 2003 Adam Megacz
 
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
-import org.xwt.mips.util.*;
+import org.ibex.nestedvm.util.*;
 import java.io.*;
 
 public class Interpreter extends UnixRuntime {
@@ -633,7 +633,7 @@ public class Interpreter extends UnixRuntime {
     }
     
     // Image loading function
-    private void loadImage(SeekableData data) throws IOException {
+    private void loadImage(Seekable data) throws IOException {
         if(state != UNINITIALIZED) throw new IllegalStateException("loadImage called on initialized runtime");
         
         ELF elf = new ELF(data);
@@ -710,12 +710,12 @@ public class Interpreter extends UnixRuntime {
     
     // This is package private for fork() which does all kinds of ugly things behind the scenes
     Interpreter() { super(4096,65536,true); }
-    public Interpreter(SeekableData data) throws IOException { this(); loadImage(data); }
+    public Interpreter(Seekable data) throws IOException { this(); loadImage(data); }
     public Interpreter(String filename) throws IOException {
-        this(new SeekableFile(filename,false));
+        this(new Seekable.File(filename,false));
         image = filename;
     }
-    public Interpreter(InputStream is) throws IOException { this(new SeekableInputStream(is)); }
+    public Interpreter(InputStream is) throws IOException { this(new Seekable.InputStream(is)); }
     
     // Debug functions
     // NOTE: This probably requires a jdk > 1.1, however, it is only used for debugging
similarity index 99%
rename from src/org/xwt/mips/JavaSourceCompiler.java
rename to src/org/ibex/nestedvm/JavaSourceCompiler.java
index 85295e6..d71bee8 100644 (file)
@@ -1,8 +1,8 @@
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
 import java.util.*;
 import java.io.*;
-import org.xwt.mips.util.SeekableData;
+import org.ibex.nestedvm.util.*;
 
 public class JavaSourceCompiler extends Compiler {
     /** Stores the "case r XXX: ... run_YYYY();" blocks generated by the emitText method/ */
@@ -27,7 +27,7 @@ public class JavaSourceCompiler extends Compiler {
     private static String indents[] = new String[16];
     static { String s=""; for(int i=0;i<indents.length;i++,s=s+"    ") indents[i] = s; }
     
-    public JavaSourceCompiler(SeekableData binary, String className, Writer w)  throws IOException {
+    public JavaSourceCompiler(Seekable binary, String className, Writer w)  throws IOException {
         super(binary,className);
         out = new PrintWriter(w);
     }
similarity index 98%
rename from src/org/xwt/mips/Registers.java
rename to src/org/ibex/nestedvm/Registers.java
index 14b2825..1a885a2 100644 (file)
@@ -1,4 +1,4 @@
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
 interface Registers {
     // Register Names
similarity index 99%
rename from src/org/xwt/mips/Runtime.java
rename to src/org/ibex/nestedvm/Runtime.java
index b659317..fd2b985 100644 (file)
@@ -2,9 +2,9 @@
 // Based on org.xwt.imp.MIPS by Adam Megacz
 // Portions Copyright 2003 Adam Megacz
 
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
-import org.xwt.mips.util.*;
+import org.ibex.nestedvm.util.*;
 import java.io.*;
 import java.util.Arrays;
 
@@ -646,7 +646,7 @@ public abstract class Runtime implements UsermodeConstants,Registers {
             if(!f.createNewFile()) throw new ErrnoException(EEXIST);
         if(!f.exists() && (flags&O_CREAT) == 0) return null;
         if(f.isDirectory()) return null;
-        final SeekableFile sf = new SeekableFile(path,mode!=RD_ONLY);
+        final Seekable.File sf = new Seekable.File(path,mode!=RD_ONLY);
         if((flags&O_TRUNC)!=0) sf.setLength(0);
         return new SeekableFD(sf,flags) {
             protected FStat _fstat() { return new HostFStat(f) {
@@ -1052,11 +1052,11 @@ public abstract class Runtime implements UsermodeConstants,Registers {
     /** FileDescriptor class for normal files */
     public abstract static class SeekableFD extends FD {
         private final int flags;
-        private final SeekableData data;
+        private final Seekable data;
         public boolean readable() { return (flags&3) != WR_ONLY; }
         public boolean writable() { return (flags&3) != RD_ONLY; }
         
-        SeekableFD(SeekableData data, int flags) { this.data = data; this.flags = flags; }
+        SeekableFD(Seekable data, int flags) { this.data = data; this.flags = flags; }
         
         protected abstract FStat _fstat();
 
similarity index 99%
rename from src/org/xwt/mips/UnixRuntime.java
rename to src/org/ibex/nestedvm/UnixRuntime.java
index 322e432..3befb91 100644 (file)
@@ -1,6 +1,6 @@
-package org.xwt.mips;
+package org.ibex.nestedvm;
 
-import org.xwt.mips.util.*;
+import org.ibex.nestedvm.util.*;
 import java.io.*;
 import java.util.*;
 
@@ -383,7 +383,7 @@ public abstract class UnixRuntime extends Runtime {
                 dos.write(b,0,b.length);
             }
             final byte[] data = bos.toByteArray();
-            return new SeekableFD(new SeekableByteArray(data,false),RD_ONLY) {
+            return new SeekableFD(new Seekable.ByteArray(data,false),RD_ONLY) {
                 protected FStat _fstat() { return  new FStat() {
                     public int length() { return data.length; }
                     public int type() { return S_IFDIR; }
@@ -506,7 +506,7 @@ public abstract class UnixRuntime extends Runtime {
                 if((flags&3)!=RD_ONLY) throw new ErrnoException(EACCES);
                 return directoryFD(f.list(),path.hashCode());
             }
-            final SeekableFile sf = new SeekableFile(path,(flags&3)!=RD_ONLY);
+            final Seekable.File sf = new Seekable.File(path,(flags&3)!=RD_ONLY);
             if((flags&O_TRUNC)!=0) sf.setLength(0);
             return new SeekableFD(sf,mode) {
                 protected FStat _fstat() { return new HostFStat(f) {
similarity index 99%
rename from src/org/xwt/mips/UsermodeConstants.java
rename to src/org/ibex/nestedvm/UsermodeConstants.java
index e3ffa35..c837ad6 100644 (file)
@@ -1,7 +1,7 @@
 // THIS FILE IS AUTOGENERATED! DO NOT EDIT!
 // run "make rebuild-constants" if it needs to be updated
 
-package org.xwt.mips;
+package org.ibex.nestedvm;
 public interface UsermodeConstants {
     public static final int SYS_null = 0;
     public static final int SYS_exit = 1;
similarity index 97%
rename from src/org/xwt/mips/ELF.java
rename to src/org/ibex/nestedvm/util/ELF.java
index 18698f2..9d4c862 100644 (file)
@@ -1,10 +1,9 @@
-package org.xwt.mips;
+package org.ibex.nestedvm.util;
 
-import org.xwt.mips.util.*;
 import java.io.*;
 
 public class ELF {
-    private SeekableData data;
+    private Seekable data;
     
     public ELFIdent ident;
     public ELFHeader header;
@@ -74,10 +73,10 @@ public class ELF {
         public byte abiversion;
                 
         ELFIdent() throws IOException {
-            if(readIntBE() != ELF_MAGIC) throw new ELFException("Bad Magic (is: " );
+            if(readIntBE() != ELF_MAGIC) throw new ELFException("Bad Magic");
             
             klass = readByte();
-            if(klass != ELFCLASS32) throw new ELFException("org.xwt.mips.ELF does not suport 64-bit binaries");
+            if(klass != ELFCLASS32) throw new ELFException("org.ibex.nestedvm.util.ELF does not suport 64-bit binaries");
             
             data = readByte();
             if(data != ELFDATA2LSB && data != ELFDATA2MSB) throw new ELFException("Unknown byte order");
@@ -202,8 +201,8 @@ public class ELF {
         public boolean isBSS() { return name.equals(".bss") || name.equals(".sbss"); }
     }
     
-    public ELF(String file) throws IOException, ELFException { this(new SeekableFile(file,false)); }
-    public ELF(SeekableData data) throws IOException, ELFException {
+    public ELF(String file) throws IOException, ELFException { this(new Seekable.File(file,false)); }
+    public ELF(Seekable data) throws IOException, ELFException {
         this.data = data;
         ident = new ELFIdent();
         header = new ELFHeader();
@@ -348,7 +347,7 @@ public class ELF {
     private static String toHex(int n) { return "0x" + Long.toString(n & 0xffffffffL, 16); }
     
     public static void main(String[] args) throws IOException {
-        ELF elf = new ELF(new SeekableInputStream(new FileInputStream(args[0])));
+        ELF elf = new ELF(new Seekable.InputStream(new FileInputStream(args[0])));
         System.out.println("Type: " + toHex(elf.header.type));
         System.out.println("Machine: " + toHex(elf.header.machine));
         System.out.println("Entry: " + toHex(elf.header.entry));
diff --git a/src/org/ibex/nestedvm/util/Seekable.java b/src/org/ibex/nestedvm/util/Seekable.java
new file mode 100644 (file)
index 0000000..85a48cc
--- /dev/null
@@ -0,0 +1,113 @@
+package org.ibex.nestedvm.util;
+
+import java.io.*;
+
+public interface Seekable { 
+    public int read(byte[] buf, int offset, int length) throws IOException;
+    public int write(byte[] buf, int offset, int length) throws IOException;
+    public int length() throws IOException;
+    public void seek(int pos) throws IOException;
+    public void close() throws IOException;
+    public int pos() throws IOException;
+    
+    public class ByteArray implements Seekable {
+        protected byte[] data;
+        protected int pos;
+        private final boolean writable;
+        
+        public ByteArray(byte[] data, boolean writable) {
+            this.data = data;
+            this.pos = 0;
+            this.writable = writable;
+        }
+        
+        public int read(byte[] buf, int off, int len) {
+            len = Math.min(len,data.length-pos);
+            if(len <= 0) return -1;
+            System.arraycopy(data,pos,buf,off,len);
+            pos += len;
+            return len;
+        }
+        
+        public int write(byte[] buf, int off, int len) throws IOException {
+            if(!writable) throw new IOException("read-only data");
+            len = Math.min(len,data.length-pos);
+            if(len <= 0) throw new IOException("no space");
+            System.arraycopy(buf,off,data,pos,len);        
+            pos += len;
+            return len;
+        }
+        
+        public int length() { return data.length; }
+        public int pos() { return pos; }
+        public void seek(int pos) { this.pos = pos; }
+        public void close() { /*noop*/ }
+    }
+    
+    public class File implements Seekable {
+        private final RandomAccessFile raf;
+        
+        public File(String fileName) throws IOException { this(fileName,false); }
+        public File(String fileName, boolean writable) throws IOException { this(new java.io.File(fileName),writable); }    
+        
+        public File(java.io.File file, boolean writable) throws IOException {
+            raf = new RandomAccessFile(file,writable ? "rw" : "r");
+        }
+        
+        // NOTE: RandomAccessFile.setLength() is a Java2 function
+        public void setLength(int n) throws IOException { raf.setLength(n); }
+        
+        public int read(byte[] buf, int offset, int length) throws IOException { return raf.read(buf,offset,length); }
+        public int write(byte[] buf, int offset, int length) throws IOException { raf.write(buf,offset,length); return length; }
+        public void seek(int pos) throws IOException{ raf.seek(pos); }
+        public int pos()  throws IOException { return (int) raf.getFilePointer(); }
+        public int length() throws IOException { return (int)raf.length(); }
+        public void close() throws IOException { raf.close(); }
+    }
+    
+    public class InputStream implements Seekable {
+        private byte[] buffer = new byte[4096];
+        private int bytesRead = 0;
+        private boolean eof = false;
+        private int pos;
+        private java.io.InputStream is;
+        
+        public InputStream(java.io.InputStream is) { this.is = is; }
+        
+        public int read(byte[] outbuf, int off, int len) throws IOException {
+            if(pos >= bytesRead && !eof) readTo(pos + 1);
+            len = Math.min(len,bytesRead-pos);
+            if(len <= 0) return -1;
+            System.arraycopy(buffer,pos,outbuf,off,len);
+            pos += len;
+            return len;
+        }
+        
+        private void readTo(int target) throws IOException {
+            if(target >= buffer.length) {
+                byte[] buf2 = new byte[Math.max(buffer.length+Math.min(buffer.length,65536),target)];
+                System.arraycopy(buffer,0,buf2,0,bytesRead);
+                buffer = buf2;
+            }
+            while(bytesRead < target) {
+                int n = is.read(buffer,bytesRead,buffer.length-bytesRead);
+                if(n == -1) {
+                    eof = true;
+                    break;
+                }
+                bytesRead += n;
+            }
+        }
+        
+        public int length() throws IOException {
+            while(!eof) readTo(bytesRead+4096);
+            return bytesRead;
+        }
+        
+        public int write(byte[] buf, int off, int len) throws IOException { throw new IOException("read-only"); }
+        public void seek(int pos) { this.pos = pos; }
+        public int pos() { return pos; }
+        public void close() throws IOException { is.close(); }
+    }
+    
+}
diff --git a/src/org/xwt/mips/util/SeekableByteArray.java b/src/org/xwt/mips/util/SeekableByteArray.java
deleted file mode 100644 (file)
index 807dd68..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.xwt.mips.util;
-
-import java.io.IOException;
-
-public class SeekableByteArray implements SeekableData {
-    protected byte[] data;
-    protected int pos;
-    private final boolean writable;
-    
-    public SeekableByteArray(byte[] data, boolean writable) {
-        this.data = data;
-        this.pos = 0;
-        this.writable = writable;
-    }
-    
-    public int read(byte[] buf, int off, int len) {
-        len = Math.min(len,data.length-pos);
-        if(len <= 0) return -1;
-        System.arraycopy(data,pos,buf,off,len);
-        pos += len;
-        return len;
-    }
-    
-    public int write(byte[] buf, int off, int len) throws IOException {
-        if(!writable) throw new IOException("read-only data");
-        len = Math.min(len,data.length-pos);
-        if(len <= 0) throw new IOException("no space");
-        System.arraycopy(buf,off,data,pos,len);        
-        pos += len;
-        return len;
-    }
-    
-    public int length() { return data.length; }
-    public int pos() { return pos; }
-    public void seek(int pos) { this.pos = pos; }
-    public void close() { /*noop*/ }
-}
diff --git a/src/org/xwt/mips/util/SeekableData.java b/src/org/xwt/mips/util/SeekableData.java
deleted file mode 100644 (file)
index 2603aba..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.xwt.mips.util;
-
-import java.io.IOException;
-
-public interface SeekableData { 
-    public int read(byte[] buf, int offset, int length) throws IOException;
-    public int write(byte[] buf, int offset, int length) throws IOException;
-    public int length() throws IOException;
-    public void seek(int pos) throws IOException;
-    public void close() throws IOException;
-    public int pos() throws IOException;
-}
diff --git a/src/org/xwt/mips/util/SeekableFile.java b/src/org/xwt/mips/util/SeekableFile.java
deleted file mode 100644 (file)
index 168d43a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.xwt.mips.util;
-
-import java.io.*;
-
-public class SeekableFile implements SeekableData {
-    private final RandomAccessFile raf;
-    
-    public SeekableFile(String fileName) throws IOException { this(fileName,false); }
-    public SeekableFile(String fileName, boolean writable) throws IOException { this(new File(fileName),writable); }    
-    
-    public SeekableFile(File file, boolean writable) throws IOException {
-        raf = new RandomAccessFile(file,writable ? "rw" : "r");
-    }
-    
-    // NOTE: RandomAccessFile.setLength() is a Java2 function
-    public void setLength(int n) throws IOException { raf.setLength(n); }
-    
-    public int read(byte[] buf, int offset, int length) throws IOException { return raf.read(buf,offset,length); }
-    public int write(byte[] buf, int offset, int length) throws IOException { raf.write(buf,offset,length); return length; }
-    public void seek(int pos) throws IOException{ raf.seek(pos); }
-    public int pos()  throws IOException { return (int) raf.getFilePointer(); }
-    public int length() throws IOException { return (int)raf.length(); }
-    public void close() throws IOException { raf.close(); }
-}
diff --git a/src/org/xwt/mips/util/SeekableInputStream.java b/src/org/xwt/mips/util/SeekableInputStream.java
deleted file mode 100644 (file)
index 1dc0b0d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.xwt.mips.util;
-
-import java.io.*;
-
-public class SeekableInputStream implements SeekableData {
-    private byte[] buffer = new byte[4096];
-    private int bytesRead = 0;
-    private boolean eof = false;
-    private int pos;
-    private InputStream is;
-    
-    public SeekableInputStream(InputStream is) { this.is = is; }
-    
-    public int read(byte[] outbuf, int off, int len) throws IOException {
-        if(pos >= bytesRead && !eof) readTo(pos + 1);
-        len = Math.min(len,bytesRead-pos);
-        if(len <= 0) return -1;
-        System.arraycopy(buffer,pos,outbuf,off,len);
-        pos += len;
-        return len;
-    }
-    
-    private void readTo(int target) throws IOException {
-        if(target >= buffer.length) {
-            byte[] buf2 = new byte[Math.max(buffer.length+Math.min(buffer.length,65536),target)];
-            System.arraycopy(buffer,0,buf2,0,bytesRead);
-            buffer = buf2;
-        }
-        while(bytesRead < target) {
-            int n = is.read(buffer,bytesRead,buffer.length-bytesRead);
-            if(n == -1) {
-                eof = true;
-                break;
-            }
-            bytesRead += n;
-        }
-    }
-    
-    public int length() throws IOException {
-        while(!eof) readTo(bytesRead+4096);
-        return bytesRead;
-    }
-        
-    public int write(byte[] buf, int off, int len) throws IOException { throw new IOException("read-only"); }
-    public void seek(int pos) { this.pos = pos; }
-    public int pos() { return pos; }
-    public void close() throws IOException { is.close(); }
-}
index e633ef7..73f3a11 100644 (file)
@@ -42,8 +42,10 @@ tasks/build_gcc: tasks/build_binutils
 tasks/build_newlib: tasks/build_gcc
 
 tasks/build_libc: tasks/build_newlib tasks/build_regex tasks/build_openbsdglob
+       # HACK
        rm -f $(usr)/mips-unknown-elf/lib/crt0.o
-       ln -s $(root)/build/org/xwt/mips/crt0.o $(usr)/mips-unknown-elf/lib/crt0.o 
+       ln -s $(root)/build/org/ibex/nestedvm/crt0.o $(usr)/mips-unknown-elf/lib/crt0.o 
+       
        echo '#include <unistd.h>' > $(usr)/mips-unknown-elf/include/getopt.h
        touch $@