X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Futil%2FMSPack.java;fp=src%2Forg%2Fibex%2Futil%2FMSPack.java;h=0000000000000000000000000000000000000000;hb=ac84b5a03467c0853c7275105712ece6c71be1f1;hp=6236df6a576b2cae07d3fc9fd75a891e2045201f;hpb=3f8aa5300e178e8975b0edc896a5a9d303e7bdf3;p=org.ibex.core.git diff --git a/src/org/ibex/util/MSPack.java b/src/org/ibex/util/MSPack.java deleted file mode 100644 index 6236df6..0000000 --- a/src/org/ibex/util/MSPack.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.ibex.util; - -import org.ibex.core.Main; -import org.ibex.util.*; -import java.io.*; -import org.ibex.nestedvm.*; -import org.ibex.nestedvm.Runtime; - -public class MSPack { - private static byte[] image; - - private String[] fileNames; - private int[] lengths; - private byte[][] data; - - public static class MSPackException extends IOException { public MSPackException(String s) { super(s); } } - - public MSPack(InputStream cabIS) throws IOException { - try { - Runtime vm = (Runtime)Class.forName("org.ibex.util.MIPSApps").newInstance(); - byte[] cab = InputStreamToByteArray.convert(cabIS); - int cabAddr = vm.sbrk(cab.length); - if(cabAddr < 0) throw new MSPackException("sbrk failed"); - - vm.copyout(cab,cabAddr,cab.length); - - vm.setUserInfo(0,cabAddr); - vm.setUserInfo(1,cab.length); - - int status = vm.run(new String[]{ "mspack"} ); - if(status != 0) throw new MSPackException("mspack.mips failed (" + status + ")"); - - /*static struct { - char *filename; - char *data; - int length; - } output_table[MAX_MEMBERS+1]; */ - - int filesTable = vm.getUserInfo(2); - int count=0; - while(vm.memRead(filesTable+count*12) != 0) count++; - - fileNames = new String[count]; - data = new byte[count][]; - lengths = new int[count]; - - for(int i=0,addr=filesTable;i