Пример #1
0
        public MainForm()
        {
            InitializeComponent();

            outputView = new OutputView(this);

            registersView = new RegisterView(this);

            displayView = new DisplayView(this);
            controlView = new ControlView(this);

            callStackView  = new CallStackView(this);
            stackFrameView = new StackFrameView(this);

            //stackView = new StackView(this);
            //flagView = new FlagView(this);
            statusView      = new StatusView(this);
            symbolView      = new SymbolView(this);
            watchView       = new WatchView(this);
            breakPointView  = new BreakPointView(this);
            instructionView = new InstructionView(this);
            methodView      = new MethodView(this);

            //scriptView = new ScriptView(this);

            AppLocations.FindApplications();
        }
Пример #2
0
        public DebugVMImageWindow(AppLocations apps, Options options)
        {
            InitializeComponent();

            Options      = options;
            AppLocations = apps;
        }
Пример #3
0
        public bool Build()
        {
            Console.WriteLine("Compile " + InputAssembly);
            Configure();

            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            TestAssemblyPath = AppContext.BaseDirectory;
            Options.Paths.Add(TestAssemblyPath);
            Options.SourceFile = Path.Combine(TestAssemblyPath, InputAssembly);

            var builder = new Builder(Options, AppLocations, this);

            var start = DateTime.UtcNow;

            builder.Compile();
            Console.WriteLine((DateTime.UtcNow - start).ToString());

            Linker     = builder.Linker;
            TypeSystem = builder.TypeSystem;
            ImageFile  = Options.BootLoaderImage ?? builder.ImageFile;

            return(!builder.HasCompileError);
        }
Пример #4
0
        public MainForm()
        {
            InitializeComponent();

            outputView = new OutputView(this);

            registersView = new RegisterView(this);

            displayView = new DisplayView(this);
            controlView = new ControlView(this);

            callStackView  = new CallStackView(this);
            stackFrameView = new StackFrameView(this);

            statusView      = new StatusView(this);
            symbolView      = new SymbolView(this);
            watchView       = new WatchView(this);
            breakPointView  = new BreakpointView(this);
            instructionView = new InstructionView(this);
            methodView      = new MethodView(this);

            //scriptView = new ScriptView(this);

            sourceView     = new SourceView(this);
            sourceDataView = new SourceDataView(this);

            AppLocations.FindApplications();
            LauncherOptions.EnableQemuGDB = true;
        }
Пример #5
0
		public UnitTestEngine()
		{
			Options = new Options()
			{
				EnableSSA = true,
				EnableIROptimizations = true,
				EnableSparseConditionalConstantPropagation = true,
				EnableInlinedMethods = true,
				IRLongExpansion = true,
				TwoPassOptimizations = true,

				Emulator = EmulatorType.Qemu,
				ImageFormat = ImageFormat.IMG,
				BootFormat = BootFormat.Multiboot_0_7,
				PlatformType = PlatformType.X86,
				LinkerFormatType = LinkerFormatType.Elf32,
				EmulatorMemoryInMB = 128,
				DestinationDirectory = Path.Combine(Path.GetTempPath(), "MOSA-UnitTest"),
				FileSystem = FileSystem.FAT16,
				UseMultipleThreadCompiler = true,
				InlinedIRMaximum = 8,
				BootLoader = BootLoader.Syslinux_3_72,
				VBEVideo = false,
				Width = 640,
				Height = 480,
				Depth = 32,
				BaseAddress = 0x00500000,//0x00400000,
				EmitRelocations = false,
				EmitSymbols = false,
				Emitx86IRQMethods = true,
				DebugConnectionOption = DebugConnectionOption.TCPServer,
				DebugConnectionPort = 9999,
				DebugConnectionAddress = "127.0.0.1",
				DebugPipeName = "MOSA",
				ExitOnLaunch = true,
				GenerateNASMFile = false,
				GenerateASMFile = false,
				GenerateMapFile = false,
				GenerateDebugFile = false,

				//BootLoaderImage = @"..\Tests\BootImage\Mosa.BootLoader.x86.img"
			};

			AppLocations = new AppLocations();

			AppLocations.FindApplications();

			Initialize();

			stopwatch.Start();

			processThread = new Thread(ProcessQueue)
			{
				Name = "ProcesQueue"
			};
			processThread.Start();
		}
Пример #6
0
        public MainForm()
        {
            InitializeComponent();

            Options      = new Options();
            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            Builder = new Builder(Options, AppLocations, this);
        }
Пример #7
0
        public UnitTestEngine(bool display = false)
        {
            LauncherOptions = new LauncherOptions()
            {
                EnableSSA             = true,
                EnableIROptimizations = true,
                EnableSparseConditionalConstantPropagation = true,
                EnableInlinedMethods = true,
                EnableLongExpansion  = true,
                EnableValueNumbering = true,
                TwoPassOptimizations = true,
                EnableBitTracker     = true,

                EnableMultiThreading = false,
                EnableMethodScanner  = false,

                Emulator               = EmulatorType.Qemu,
                ImageFormat            = ImageFormat.IMG,
                MultibootSpecification = Compiler.Framework.MultibootSpecification.V1,
                PlatformType           = PlatformType.x86,
                LinkerFormatType       = LinkerFormatType.Elf32,
                EmulatorMemoryInMB     = 128,
                DestinationDirectory   = Path.Combine(Path.GetTempPath(), "MOSA-UnitTest"),
                FileSystem             = BootImage.FileSystem.FAT16,
                InlinedIRMaximum       = 12,
                BootLoader             = BootLoader.Syslinux_3_72,
                VBEVideo               = false,
                Width                  = 640,
                Height                 = 480,
                Depth                  = 32,
                BaseAddress            = 0x00500000,
                EmitStaticRelocations  = false,
                EmitAllSymbols         = false,
                SerialConnectionOption = SerialConnectionOption.TCPServer,
                SerialConnectionPort   = 9999,
                SerialConnectionHost   = "127.0.0.1",
                SerialPipeName         = "MOSA",
                ExitOnLaunch           = true,
                GenerateNASMFile       = false,
                GenerateASMFile        = true,
                GenerateMapFile        = true,
                GenerateDebugFile      = true,
                PlugKorlib             = true,
                NoDisplay              = !display
            };

            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            Initialize();
        }
Пример #8
0
        public UnitTestEngine()
        {
            Options = new Options()
            {
                EnableSSA             = true,
                EnableIROptimizations = true,
                EnableSparseConditionalConstantPropagation = true,
                EnableInlinedMethods  = true,
                EnableIRLongExpansion = true,
                EnableValueNumbering  = true,
                TwoPassOptimizations  = true,

                Emulator                  = EmulatorType.Qemu,
                ImageFormat               = ImageFormat.IMG,
                BootFormat                = BootFormat.Multiboot_0_7,
                PlatformType              = PlatformType.X86,
                LinkerFormatType          = LinkerFormatType.Elf32,
                EmulatorMemoryInMB        = 128,
                DestinationDirectory      = Path.Combine(Path.GetTempPath(), "MOSA-UnitTest"),
                FileSystem                = FileSystem.FAT16,
                UseMultiThreadingCompiler = false,
                InlinedIRMaximum          = 12,
                BootLoader                = BootLoader.Syslinux_3_72,
                VBEVideo                  = false,
                Width                  = 640,
                Height                 = 480,
                Depth                  = 32,
                BaseAddress            = 0x00500000,
                EmitRelocations        = false,
                EmitSymbols            = false,
                Emitx86IRQMethods      = true,
                SerialConnectionOption = SerialConnectionOption.TCPServer,
                SerialConnectionPort   = 9999,
                SerialConnectionHost   = "127.0.0.1",
                SerialPipeName         = "MOSA",
                ExitOnLaunch           = true,
                GenerateNASMFile       = false,
                GenerateASMFile        = true,
                GenerateMapFile        = false,
                GenerateDebugFile      = false,
            };

            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            Initialize();
        }
Пример #9
0
        public MainForm()
        {
            InitializeComponent();

            Options      = new Options();
            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            Builder = new Builder(Options, AppLocations, this);

            dataGridView1.DataSource = includedEntries;
            dataGridView1.AutoResizeColumns();
            dataGridView1.Columns[1].Width = 175;
            dataGridView1.Columns[2].Width = 500;
        }
Пример #10
0
        public MainForm()
        {
            InitializeComponent();

            Options      = new LauncherOptions();
            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            Builder = new Builder(Options, AppLocations, this);

            dataGridView1.DataSource = includedEntries;
            dataGridView1.AutoResizeColumns();
            dataGridView1.Columns[1].Width = 175;
            dataGridView1.Columns[2].Width = 500;

            AddOutput("Current Directory: " + Environment.CurrentDirectory);
        }
Пример #11
0
        public LonosBuilder_Kernel(string inputAssembly)
        {
            //Options = new Options()
            Options = new LauncherOptions()
            {
                EnableSSA             = true,
                EnableIROptimizations = true,
                EnableSparseConditionalConstantPropagation = true,
                EnableInlinedMethods  = true,
                EnableIRLongExpansion = false, // see LonosBuilder_Loader
                EnableValueNumbering  = true,
                TwoPassOptimizations  = true,

                Emulator    = EmulatorType.Bochs,
                ImageFormat = ImageFormat.IMG,
                //BootFormat = BootFormat.Multiboot_0_7,
                MultiBootV1          = true,
                PlatformType         = PlatformType.x86,
                LinkerFormatType     = LinkerFormatType.Elf32,
                EmulatorMemoryInMB   = 128,
                DestinationDirectory = Program.GetEnv("LONOS_OSDIR"),
                FileSystem           = FileSystem.FAT16,

                //UseMultiThreadingCompiler = false,
                EnableMultiThreading = false,

                InlinedIRMaximum = 12,
                BootLoader       = BootLoader.Syslinux_3_72,
                VBEVideo         = false,
                Width            = 640,
                Height           = 480,
                Depth            = 32,
                //BaseAddress = 0x00500000,
                BaseAddress = Address.KernelBaseVirt,
                //EmitRelocations = false,
                //EmitSymbols = false,
                //Emitx86IRQMethods = true,
                //SerialConnectionOption = SerialConnectionOption.Pipe,
                SerialConnectionPort = 9999,
                SerialConnectionHost = "127.0.0.1",
                SerialPipeName       = "MOSA",
                ExitOnLaunch         = true,
                GenerateNASMFile     = false,
                GenerateASMFile      = false,
                GenerateMapFile      = false,
                GenerateDebugFile    = false,
                PlugKorlib           = true,
                HuntForCorLib        = true
            };

            //Options.GenerateNASMFile = true;
            Options.GenerateASMFile   = true;
            Options.GenerateMapFile   = true;
            Options.GenerateDebugFile = true;
            //Options.EmitRelocations = true;
            //Options.EmitSymbols = true; // Kernel Loader needs to resolve Adress of Start Method
            //Options.Emitx86IRQMethods = true;
            Options.EmitAllSymbols = true;


            Options.EnableSSA             = false;
            Options.EnableIROptimizations = false;
            Options.EnableSparseConditionalConstantPropagation = false;
            Options.EnableInlinedMethods  = true;
            Options.EnableIRLongExpansion = false;
            Options.EnableValueNumbering  = false;
            Options.TwoPassOptimizations  = false;

            //Options.VBEVideo = true;

            Section sect = null;

            Options.CreateExtraSections = () =>
            {
                return(new List <Section>
                {
                    new Section
                    {
                        Name = "native",
                        Type = SectionType.ProgBits,
                        AddressAlignment = 0x1000,
                        EmitMethod = (section, writer) =>
                        {
                            var data = File.ReadAllBytes(Program.GetEnv("LONOS_NATIVE_FILES"));
                            writer.Write(data);
                            section.Size = (uint)data.Length;
                        }
                    },
                    new Section
                    {
                        Name = "consolefont.regular",
                        Type = SectionType.ProgBits,
                        AddressAlignment = 0x1000,
                        EmitMethod = (section, writer) =>
                        {
                            var data = File.ReadAllBytes(Path.Combine(Program.GetEnv("LONOS_PROJDIR"), "tools", "consolefonts", "Uni2-Terminus14.psf"));
                            writer.Write(data);
                            section.Size = (uint)data.Length;
                        }
                    },
                    new Section
                    {
                        Name = "consolefont.bold",
                        Type = SectionType.ProgBits,
                        AddressAlignment = 0x1000,
                        EmitMethod = (section, writer) =>
                        {
                            var data = File.ReadAllBytes(Path.Combine(Program.GetEnv("LONOS_PROJDIR"), "tools", "consolefonts", "Uni2-TerminusBold14.psf"));
                            writer.Write(data);
                            section.Size = (uint)data.Length;
                        }
                    },
                    new Section
                    {
                        Name = "elf.header",
                        Type = SectionType.ProgBits,
                        AddressAlignment = 0x1000,
                        Address = 0x4FF000,
                        Size = 0x1000,
                        EmitMethod = (section, writer) =>
                        {
                            sect = section; //TODO: Could set outsite
                            writer.Write(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
                            section.Size = 0x1000;
                        }
                    }
                });
            };

            Options.CreateExtraProgramHeaders = () =>
            {
                return(new List <ProgramHeader>
                {
                    new ProgramHeader
                    {
                        Alignment = sect.AddressAlignment,
                        Offset = sect.Offset,
                        VirtualAddress = sect.Address,
                        PhysicalAddress = sect.Address,
                        FileSize = 0x1000,
                        MemorySize = 0x1000,
                        Type = ProgramHeaderType.Load,
                        Flags = ProgramHeaderFlags.Read
                    }
                });
            };

            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            InputAssembly = inputAssembly;
        }
        public DebugAppLocationsWindow(AppLocations apps)
        {
            InitializeComponent();

            AppLocations = apps;
        }
Пример #13
0
        public LonosBuilder_Loader(string inputAssembly)
        {
            //Options = new Options()
            Options = new LauncherOptions()
            {
                EnableSSA             = true,
                EnableIROptimizations = true,
                EnableSparseConditionalConstantPropagation = true,
                EnableInlinedMethods  = true,
                EnableIRLongExpansion = false, // Compiler commit 2e23a85: If true, the loader is not able to display the section names
                EnableValueNumbering  = true,
                TwoPassOptimizations  = true,

                Emulator    = EmulatorType.Bochs,
                ImageFormat = ImageFormat.IMG,
                //BootFormat = BootFormat.Multiboot_0_7,
                MultiBootV1          = true,
                PlatformType         = PlatformType.x86,
                LinkerFormatType     = LinkerFormatType.Elf32,
                EmulatorMemoryInMB   = 128,
                DestinationDirectory = Program.GetEnv("LONOS_OSDIR"),
                FileSystem           = FileSystem.FAT16,

                //UseMultiThreadingCompiler = false,
                EnableMultiThreading = false,

                InlinedIRMaximum = 12,
                BootLoader       = BootLoader.Syslinux_3_72,
                VBEVideo         = false,
                BaseAddress      = Address.LoaderBasePhys,
                //EmitRelocations = false,
                //EmitSymbols = false,
                //Emitx86IRQMethods = false,
                //SerialConnectionOption = SerialConnectionOption.Pipe,
                ExitOnLaunch      = true,
                GenerateNASMFile  = false,
                GenerateASMFile   = true,
                GenerateMapFile   = true,
                GenerateDebugFile = false,
                PlugKorlib        = true,
                HuntForCorLib     = true
            };

            Options.VBEVideo       = true;
            Options.EmitAllSymbols = true;

            Section sect = null;

            Options.CreateExtraSections = () =>
            {
                return(new List <Section>
                {
                    new Section
                    {
                        Name = "native",
                        Type = SectionType.ProgBits,
                        AddressAlignment = 0x1000,
                        EmitMethod = (section, writer) =>
                        {
                            var data = File.ReadAllBytes(Program.GetEnv("LONOS_NATIVE_FILES"));
                            writer.Write(data);
                            section.Size = (uint)data.Length;
                        }
                    }
                });
            };

            Options.CreateExtraProgramHeaders = () =>
            {
                return(new List <ProgramHeader>
                {
                    // ELF Header. Reusing existing Region in File.
                    // This is allowed (overlapping Sections)
                    new ProgramHeader
                    {
                        Alignment = 0x1000,
                        Offset = 0x12345678,                                // Will be replaced in Link Disk stage
                        FileSize = 0x12345678,                              // Will be replaced in Link Disk stage
                        MemorySize = 0x12345678,
                        PhysicalAddress = Address.OriginalKernelElfSection, //Multiboot will load section here
                        VirtualAddress = Address.OriginalKernelElfSection,
                        Type = ProgramHeaderType.Load,
                        Flags = ProgramHeaderFlags.Read
                    }
                });
            };

            AppLocations = new AppLocations();

            AppLocations.FindApplications();

            InputAssembly = inputAssembly;
        }