Ejemplo n.º 1
0
 private static CommandResult TryBuildImage(CommandArgs args)
 {
     if (args.ContainsFlag("image"))
     {
         BuildImage("image");
     }
     return(null);
 }
Ejemplo n.º 2
0
 private static CommandResult TryBuildNative(CommandArgs args)
 {
     if (args.ContainsFlag("native"))
     {
         Directory.CreateDirectory(Env.Get("${ABANU_BINDIR}/${ABANU_ARCH}"));
         Exec("${nasm} -f elf32 ${ABANU_PROJDIR}/src/Abanu.Native.${ABANU_ARCH}/DebugFunction1.s -o ${ABANU_BINDIR}/${ABANU_ARCH}/Abanu.Native.o");
         Exec("${nasm} -f bin ${ABANU_PROJDIR}/src/Abanu.Native.${ABANU_ARCH}/EnableExecutionProtection.s -o ${ABANU_BINDIR}/${ABANU_ARCH}/Abanu.EnableExecutionProtection.o");
         Exec("${nasm} -f bin ${ABANU_PROJDIR}/src/Abanu.Native.${ABANU_ARCH}/InterruptReturn.s -o ${ABANU_BINDIR}/${ABANU_ARCH}/Abanu.InterruptReturn.o");
         Exec("${nasm} -f bin ${ABANU_PROJDIR}/src/Abanu.Native.${ABANU_ARCH}/LoadTaskRegister.s -o ${ABANU_BINDIR}/${ABANU_ARCH}/Abanu.LoadTaskRegister.o");
         Exec("${nasm} -f bin ${ABANU_PROJDIR}/src/Abanu.Native.${ABANU_ARCH}/DebugFunction1.s -o ${ABANU_BINDIR}/${ABANU_ARCH}/Abanu.DebugFunction1.o");
         Exec("${nasm} -f bin ${ABANU_PROJDIR}/src/Abanu.Native.${ABANU_ARCH}/SysCall.s -o ${ABANU_BINDIR}/${ABANU_ARCH}/Abanu.SysCall.o");
     }
     return(null);
 }
Ejemplo n.º 3
0
        private static CommandResult RunQemu(CommandArgs args)
        {
            Env.Set("DEBUG_INTERRUPTS", ",int");
            switch (args.RequireFlag("boot", "direct"))
            {
            case "direct":
                if (args.ContainsFlag("test"))
                {
                    var success = false;

                    Exec(
                        "${qemu} -kernel ${ABANU_OSDIR}/Abanu.OS.Image.${ABANU_ARCH}.bin -serial stdio -m 256 -display none",
                        (line, proc) =>
                    {
                        if (line.Contains(KConfig.SelfTestPassedMarker))
                        {
                            success = true;
                            proc.Kill();
                            Console.WriteLine("TEST PASSED");
                            Environment.Exit(0);
                        }
                    }, TimeSpan.FromSeconds(60));

                    if (success)
                    {
                        Environment.Exit(0);
                    }
                    else
                    {
                        Console.WriteLine("Test FAILED");
                        Environment.Exit(1);
                    }
                }
                else
                {
                    Exec("${qemu} -kernel ${ABANU_OSDIR}/Abanu.OS.Image.${ABANU_ARCH}.bin -serial file:${ABANU_LOGDIR}/kernel.log -d pcall,cpu_reset,guest_errors${DEBUG_INTERRUPTS} -D ${ABANU_LOGDIR}/emulator.log -m 256");
                }
                break;
            }
            return(null);
        }