Exemplo n.º 1
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public static void Initialize()
        {
            SetupPrimaryDisplayForm();

            // Emulate a ram chip (128Mb)
            Mosa.EmulatedDevices.Emulated.RAMChip ramChip1 = new Mosa.EmulatedDevices.Emulated.RAMChip(0, 1024 * 640);
            Mosa.EmulatedDevices.Emulated.RAMChip ramChip2 = new Mosa.EmulatedDevices.Emulated.RAMChip(1024 * 1024, 1024 * 1024 * 127);

            // Setup PCI Bus
            PCIBus pciBus = new PCIBus();

            // Setup PCI Controller
            pciBus.Add(new PCIController(PCIController.StandardIOBase, pciBus));
            IOPortDispatch.RegisterDevice(pciBus.Get(0) as IIOPortDevice);

            // Add CMOS
            IOPortDispatch.RegisterDevice(new CMOS(CMOS.StandardIOBase));

            // Add VGA Controller
            IOPortDispatch.RegisterDevice(new VGAConsole(PrimaryDisplayForm));

            // Add IDE Controller
            string[] files = new string[1];
            files[0] = @"..\Data\HardDriveImage\hd.img";

            // Fix for Linux
            files[0] = files[0].Replace('\\', System.IO.Path.DirectorySeparatorChar);

            //IOPortDispatch.RegisterDevice(new IDEController(IDEController.PrimaryIOBase, files));

            // Simulate multiboot
            Mosa.EmulatedDevices.Multiboot.Setup();
        }
Exemplo n.º 2
0
Arquivo: Setup.cs Projeto: djlw78/Mosa
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public static void Initialize()
        {
            SetupPrimaryDisplayForm();

            // Emulate a ram chip (128Mb)
            Mosa.EmulatedDevices.Emulated.RAMChip ramChip1 = new Mosa.EmulatedDevices.Emulated.RAMChip(0, 1024 * 640);
            Mosa.EmulatedDevices.Emulated.RAMChip ramChip2 = new Mosa.EmulatedDevices.Emulated.RAMChip(1024 * 1024, 1024 * 1024 * 127);

            // Setup PCI Bus
            PCIBus pciBus = new PCIBus();

            // Setup PCI Controller
            pciBus.Add(new PCIController(PCIController.StandardIOBase, pciBus));
            IOPortDispatch.RegisterDevice(pciBus.Get(0) as IIOPortDevice);

            // Add CMOS
            IOPortDispatch.RegisterDevice(new CMOS(CMOS.StandardIOBase));

            // Add VGA Controller
            IOPortDispatch.RegisterDevice(new VGAConsole(PrimaryDisplayForm));

            // Add IDE Controller
            string[] files = new string[1];
            files[0] = @"..\..\Data\HardDriveImage\hd.img";

            // Fix for Linux
            files[0] = files[0].Replace('\\', System.IO.Path.DirectorySeparatorChar);

            IOPortDispatch.RegisterDevice(new IDEController(IDEController.PrimaryIOBase, files));

            // Simulate multiboot
            Mosa.EmulatedDevices.Multiboot.Setup();
        }