use of suite.ip.ImperativeCompiler in project suite by stupidsing.
the class FailedTests method testDataStructure.
// cannot capture reference to a structure
@Test
public void testDataStructure() {
Bytes bytes = new ImperativeCompiler().compile(0, //
"" + //
"constant p = fix :p struct (() | pointer::p +next);" + //
"declare r = & new p (+next = null,);" + "0");
assertNotNull(bytes);
System.out.println(bytes);
}
use of suite.ip.ImperativeCompiler in project suite by stupidsing.
the class BootMain method run.
@Override
protected boolean run(String[] args) throws IOException {
Bytes bootLoader = new Assembler(16).assemble(FileUtil.read("src/main/asm/bootloader.asm"));
Bytes kernel = new ImperativeCompiler().compile(0x40000, Paths.get("src/main/il/kernel.il"));
if (bootLoader.size() == 512 && kernel.size() < 65536) {
// combine the images and align to 512 bytes
Bytes disk0 = Bytes.concat(bootLoader, kernel);
Bytes disk1 = disk0.pad(disk0.size() + 511 & 0xFFFFFE00);
String image = "target/boot.bin";
Files.write(Paths.get(image), disk1.toArray());
System.out.println("cat " + image + " | dd bs=512 count=1 | /opt/udis86-1.7.2/udcli/udcli -16 | less");
System.out.println("cat " + image + " | dd bs=512 skip=1 | /opt/udis86-1.7.2/udcli/udcli -32 | less");
System.out.println("qemu-system-x86_64 target/boot.bin");
return true;
} else
return Fail.t("size not match");
}
Aggregations