コード例 #1
0
        /* This file has the creation functions just for Pypkjs */
        private void StartPypjks()
        {
            //Run some yucky Python code.
            //Get platform.
            FlashPair fp      = Program.config.flash_bins[platform];
            string    persist = persist_dir + "pypkjs/";

            Directory.CreateDirectory(persist);
            //Create arguments
            string args = "--qemu localhost:" + qemu_port.ToString() + " ";

            args += "--port " + pypkjs_port.ToString() + " ";
            args += "--persist " + persist + " ";
            args += "--layout " + fp.layouts + " ";
            args += "--debug ";
            //Run
            ProcessStartInfo startInfo = new ProcessStartInfo()
            {
                FileName = "/usr/bin/python", Arguments = Program.config.pypkjs_binary + " " + args
            };

            pypkjs_process = new Process()
            {
                StartInfo = startInfo,
            };
            pypkjs_process.Start();
        }
コード例 #2
0
        /* This file has the creation functions just for QEMU */
        private void SpawnProcess()
        {
            //Get objects, such as the flash locations.
            FlashPair fp = Program.config.flash_bins[platform];
            //Create command line arguments.
            string args = "-rtc base=localtime ";

            args += "-serial null ";
            args += "-serial tcp::" + qemu_port + ",server,nowait ";
            args += "-serial tcp::" + qemu_serial_port + ",server ";
            args += "-drive file=" + qemu_micro_image + ",if=pflash,format=raw ";
            args += "-gdb tcp::" + qemu_gdb_port + ",server ";
            args += "-vnc :" + sessionId.ToString() + " "; //This pushes the video output to vnc. See more here: https://stackoverflow.com/questions/22967925/running-qemu-remotely-via-ssh
            //Get the command line arguments from the specific platform.
            foreach (string ss in fp.args)
            {
                args += ss.Replace("qemu_spi_flash", qemu_spi_image) + " ";
            }
            //Run the QEMU process.
            ProcessStartInfo startInfo = new ProcessStartInfo()
            {
                FileName = Program.config.qemu_binary, Arguments = args
            };

            qemu_process = new Process()
            {
                StartInfo = startInfo,
            };
            qemu_process.Start();
            Log("QEMU process started with ID " + qemu_process.Id);
        }
コード例 #3
0
        private void CopyImages()
        {
            //Copy images for spi and micro.
            //Get platform.
            FlashPair fp = Program.config.flash_bins[platform];

            //Generate paths.
            qemu_spi_image   = persist_dir + "pebble_spi_image.bin";
            qemu_micro_image = persist_dir + "pebble_micro_image.bin";
            //Copy now.
            File.Copy(fp.spi_flash, qemu_spi_image);
            File.Copy(fp.micro_flash, qemu_micro_image);
        }