[df64dbc] | 1 | #!/usr/bin/env python
|
---|
| 2 | #
|
---|
[3f4c537a] | 3 | # Copyright (c) 2013 Jakub Jermar
|
---|
[df64dbc] | 4 | # All rights reserved.
|
---|
| 5 | #
|
---|
| 6 | # Redistribution and use in source and binary forms, with or without
|
---|
| 7 | # modification, are permitted provided that the following conditions
|
---|
| 8 | # are met:
|
---|
| 9 | #
|
---|
| 10 | # - Redistributions of source code must retain the above copyright
|
---|
| 11 | # notice, this list of conditions and the following disclaimer.
|
---|
| 12 | # - Redistributions in binary form must reproduce the above copyright
|
---|
| 13 | # notice, this list of conditions and the following disclaimer in the
|
---|
| 14 | # documentation and/or other materials provided with the distribution.
|
---|
| 15 | # - The name of the author may not be used to endorse or promote products
|
---|
| 16 | # derived from this software without specific prior written permission.
|
---|
| 17 | #
|
---|
| 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 28 | #
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | """
|
---|
| 32 | Emulator wrapper for running HelenOS
|
---|
| 33 | """
|
---|
| 34 |
|
---|
[1c24c7c] | 35 | import os
|
---|
[f5ceb18] | 36 | import sys
|
---|
[1c24c7c] | 37 | import subprocess
|
---|
[df64dbc] | 38 | import autotool
|
---|
[8a26f82] | 39 | import platform
|
---|
[df425da] | 40 | import thread
|
---|
| 41 | import time
|
---|
[df64dbc] | 42 |
|
---|
[f5ceb18] | 43 | overrides = {}
|
---|
| 44 |
|
---|
| 45 | def is_override(str):
|
---|
| 46 | if str in overrides.keys():
|
---|
| 47 | return overrides[str]
|
---|
| 48 | return False
|
---|
| 49 |
|
---|
[df425da] | 50 | def cfg_get(platform, machine, processor):
|
---|
| 51 | if machine == "" or emulators[platform].has_key("run"):
|
---|
[f5ceb18] | 52 | return emulators[platform]
|
---|
[df425da] | 53 | elif processor == "" or emulators[platform][machine].has_key("run"):
|
---|
[f5ceb18] | 54 | return emulators[platform][machine]
|
---|
[df425da] | 55 | else:
|
---|
| 56 | return emulators[platform][machine][processor]
|
---|
[f5ceb18] | 57 |
|
---|
[e4c8e3cf] | 58 | def termemu_detect():
|
---|
| 59 | for termemu in ['xfce4-terminal', 'xterm']:
|
---|
| 60 | try:
|
---|
| 61 | subprocess.check_output('which ' + termemu, shell = True)
|
---|
| 62 | return termemu
|
---|
| 63 | except:
|
---|
| 64 | pass
|
---|
| 65 |
|
---|
[df64dbc] | 66 | def run_in_console(cmd, title):
|
---|
[1dab093] | 67 | ecmd = cmd.replace('"', '\\"')
|
---|
| 68 | cmdline = termemu_detect() + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"'
|
---|
[e4a1497] | 69 | print(cmdline)
|
---|
[f5ceb18] | 70 | if not is_override('dryrun'):
|
---|
[e4c8e3cf] | 71 | subprocess.call(cmdline, shell = True)
|
---|
[df64dbc] | 72 |
|
---|
[8a26f82] | 73 | def get_host_native_width():
|
---|
| 74 | return int(platform.architecture()[0].strip('bit'))
|
---|
| 75 |
|
---|
| 76 | def pc_options(guest_width):
|
---|
| 77 | opts = ''
|
---|
[a35b458] | 78 |
|
---|
[8a26f82] | 79 | # Do not enable KVM if running 64 bits HelenOS
|
---|
| 80 | # on 32 bits host
|
---|
| 81 | host_width = get_host_native_width()
|
---|
[f5ceb18] | 82 | if guest_width <= host_width and not is_override('nokvm'):
|
---|
[8a26f82] | 83 | opts = opts + ' -enable-kvm'
|
---|
[a35b458] | 84 |
|
---|
[8a26f82] | 85 | # Remove the leading space
|
---|
| 86 | return opts[1:]
|
---|
[df64dbc] | 87 |
|
---|
| 88 | def malta_options():
|
---|
| 89 | return '-cpu 4Kc'
|
---|
| 90 |
|
---|
[9185e42] | 91 | def platform_to_qemu_options(platform, machine, processor):
|
---|
[df64dbc] | 92 | if platform == 'amd64':
|
---|
[8a26f82] | 93 | return 'system-x86_64', pc_options(64)
|
---|
[df64dbc] | 94 | elif platform == 'arm32':
|
---|
[83b01c2] | 95 | return 'system-arm', '-M integratorcp'
|
---|
[df64dbc] | 96 | elif platform == 'ia32':
|
---|
[8a26f82] | 97 | return 'system-i386', pc_options(32)
|
---|
[df64dbc] | 98 | elif platform == 'mips32':
|
---|
| 99 | if machine == 'lmalta':
|
---|
| 100 | return 'system-mipsel', malta_options()
|
---|
| 101 | elif machine == 'bmalta':
|
---|
| 102 | return 'system-mips', malta_options()
|
---|
| 103 | elif platform == 'ppc32':
|
---|
[644352c] | 104 | return 'system-ppc', '-m 256'
|
---|
[df64dbc] | 105 | elif platform == 'sparc64':
|
---|
[9185e42] | 106 | if machine != 'generic':
|
---|
| 107 | raise Exception
|
---|
| 108 | if processor == 'us':
|
---|
[7f4937e] | 109 | return 'system-sparc64', '-M sun4u --prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a"'
|
---|
[9185e42] | 110 | elif processor == 'sun4v':
|
---|
| 111 | default_path = '/usr/local/opensparc/image/'
|
---|
| 112 | try:
|
---|
| 113 | if os.path.exists(default_path):
|
---|
| 114 | opensparc_bins = default_path
|
---|
| 115 | elif os.path.exists(os.environ['OPENSPARC_BINARIES']):
|
---|
| 116 | opensparc_bins = os.environ['OPENSPARC_BINARIES']
|
---|
| 117 | else:
|
---|
| 118 | raise Exception
|
---|
| 119 | except:
|
---|
| 120 | print("Cannot find OpenSPARC binary images!")
|
---|
| 121 | print("Either set OPENSPARC_BINARIES environment variable accordingly or place the images in %s." % (default_path))
|
---|
| 122 | raise Exception
|
---|
| 123 |
|
---|
| 124 | return 'system-sparc64', '-M niagara -m 256 -L %s' % (opensparc_bins)
|
---|
| 125 |
|
---|
[df64dbc] | 126 |
|
---|
[129b92c6] | 127 | def hdisk_mk():
|
---|
[df64dbc] | 128 | if not os.path.exists('hdisk.img'):
|
---|
| 129 | subprocess.call('tools/mkfat.py 1048576 uspace/dist/data hdisk.img', shell = True)
|
---|
[f5ceb18] | 130 |
|
---|
[129b92c6] | 131 | def qemu_bd_options():
|
---|
| 132 | if is_override('nohdd'):
|
---|
| 133 | return ''
|
---|
[a35b458] | 134 |
|
---|
[129b92c6] | 135 | hdisk_mk()
|
---|
[a35b458] | 136 |
|
---|
[5fdad22] | 137 | return ' -drive file=hdisk.img,index=0,media=disk,format=raw'
|
---|
[df64dbc] | 138 |
|
---|
| 139 | def qemu_nic_ne2k_options():
|
---|
[d4b7b29] | 140 | return ' -device ne2k_isa,irq=5,netdev=n1'
|
---|
[df64dbc] | 141 |
|
---|
| 142 | def qemu_nic_e1k_options():
|
---|
[d4b7b29] | 143 | return ' -device e1000,netdev=n1'
|
---|
[df64dbc] | 144 |
|
---|
| 145 | def qemu_nic_rtl8139_options():
|
---|
[d4b7b29] | 146 | return ' -device rtl8139,netdev=n1'
|
---|
[df64dbc] | 147 |
|
---|
[7bf16b7e] | 148 | def qemu_nic_virtio_options():
|
---|
[d4b7b29] | 149 | return ' -device virtio-net,netdev=n1'
|
---|
[7bf16b7e] | 150 |
|
---|
[df64dbc] | 151 | def qemu_net_options():
|
---|
[f5ceb18] | 152 | if is_override('nonet'):
|
---|
| 153 | return ''
|
---|
| 154 |
|
---|
| 155 | nic_options = ''
|
---|
| 156 | if 'net' in overrides.keys():
|
---|
| 157 | if 'e1k' in overrides['net'].keys():
|
---|
| 158 | nic_options += qemu_nic_e1k_options()
|
---|
| 159 | if 'rtl8139' in overrides['net'].keys():
|
---|
| 160 | nic_options += qemu_nic_rtl8139_options()
|
---|
| 161 | if 'ne2k' in overrides['net'].keys():
|
---|
| 162 | nic_options += qemu_nic_ne2k_options()
|
---|
[7bf16b7e] | 163 | if 'virtio-net' in overrides['net'].keys():
|
---|
| 164 | nic_options += qemu_nic_virtio_options()
|
---|
[f5ceb18] | 165 | else:
|
---|
| 166 | # Use the default NIC
|
---|
| 167 | nic_options += qemu_nic_e1k_options()
|
---|
| 168 |
|
---|
[d4b7b29] | 169 | return nic_options + ' -netdev user,id=n1,hostfwd=udp::8080-:8080,hostfwd=udp::8081-:8081,hostfwd=tcp::8080-:8080,hostfwd=tcp::8081-:8081,hostfwd=tcp::2223-:2223'
|
---|
[df64dbc] | 170 |
|
---|
| 171 | def qemu_usb_options():
|
---|
[f5ceb18] | 172 | if is_override('nousb'):
|
---|
| 173 | return ''
|
---|
| 174 | return ' -usb'
|
---|
[df64dbc] | 175 |
|
---|
[5119d34] | 176 | def qemu_xhci_options():
|
---|
| 177 | if is_override('noxhci'):
|
---|
| 178 | return ''
|
---|
| 179 | return ' -device nec-usb-xhci,id=xhci'
|
---|
| 180 |
|
---|
[27de618] | 181 | def qemu_tablet_options():
|
---|
| 182 | if is_override('notablet') or (is_override('nousb') and is_override('noxhci')):
|
---|
| 183 | return ''
|
---|
| 184 | return ' -device usb-tablet'
|
---|
| 185 |
|
---|
[f5ceb18] | 186 | def qemu_audio_options():
|
---|
| 187 | if is_override('nosnd'):
|
---|
| 188 | return ''
|
---|
[089901e] | 189 | return ' -device intel-hda -device hda-duplex'
|
---|
[f5ceb18] | 190 |
|
---|
[df425da] | 191 | def qemu_run(platform, machine, processor):
|
---|
| 192 | cfg = cfg_get(platform, machine, processor)
|
---|
[9185e42] | 193 | suffix, options = platform_to_qemu_options(platform, machine, processor)
|
---|
[df64dbc] | 194 | cmd = 'qemu-' + suffix
|
---|
| 195 |
|
---|
| 196 | cmdline = cmd
|
---|
[3692678] | 197 | if 'qemu_path' in overrides.keys():
|
---|
| 198 | cmdline = overrides['qemu_path'] + cmd
|
---|
| 199 |
|
---|
[df64dbc] | 200 | if options != '':
|
---|
| 201 | cmdline += ' ' + options
|
---|
| 202 |
|
---|
[f5ceb18] | 203 | cmdline += qemu_bd_options()
|
---|
| 204 |
|
---|
| 205 | if (not 'net' in cfg.keys()) or cfg['net']:
|
---|
[df64dbc] | 206 | cmdline += qemu_net_options()
|
---|
[f5ceb18] | 207 | if (not 'usb' in cfg.keys()) or cfg['usb']:
|
---|
[df64dbc] | 208 | cmdline += qemu_usb_options()
|
---|
[5119d34] | 209 | if (not 'xhci' in cfg.keys()) or cfg['xhci']:
|
---|
| 210 | cmdline += qemu_xhci_options()
|
---|
[27de618] | 211 | if (not 'tablet' in cfg.keys()) or cfg['tablet']:
|
---|
| 212 | cmdline += qemu_tablet_options()
|
---|
[f5ceb18] | 213 | if (not 'audio' in cfg.keys()) or cfg['audio']:
|
---|
| 214 | cmdline += qemu_audio_options()
|
---|
[a35b458] | 215 |
|
---|
[868d75c] | 216 | console = ('console' in cfg.keys() and cfg['console'])
|
---|
| 217 |
|
---|
[0ceeac3] | 218 | if (is_override('nographic')):
|
---|
| 219 | cmdline += ' -nographic'
|
---|
| 220 |
|
---|
[868d75c] | 221 | if (not console and (not is_override('nographic')) and not is_override('noserial')):
|
---|
[2fc9bfd] | 222 | cmdline += ' -serial stdio'
|
---|
| 223 |
|
---|
[abf8bd8] | 224 | if (is_override('bigmem')):
|
---|
| 225 | cmdline += ' -m 4G'
|
---|
| 226 |
|
---|
[f5ceb18] | 227 | if cfg['image'] == 'image.iso':
|
---|
[df64dbc] | 228 | cmdline += ' -boot d -cdrom image.iso'
|
---|
[f5ceb18] | 229 | elif cfg['image'] == 'image.boot':
|
---|
[df64dbc] | 230 | cmdline += ' -kernel image.boot'
|
---|
[9185e42] | 231 | else:
|
---|
| 232 | cmdline += ' ' + cfg['image']
|
---|
[df64dbc] | 233 |
|
---|
[868d75c] | 234 | if console:
|
---|
[df64dbc] | 235 | cmdline += ' -nographic'
|
---|
| 236 |
|
---|
| 237 | title = 'HelenOS/' + platform
|
---|
| 238 | if machine != '':
|
---|
| 239 | title += ' on ' + machine
|
---|
[9185e42] | 240 | if 'expect' in cfg.keys():
|
---|
| 241 | cmdline = 'expect -c \'spawn %s; expect "%s" { send "%s" } timeout exp_continue; interact\'' % (cmdline, cfg['expect']['src'], cfg['expect']['dst'])
|
---|
[df64dbc] | 242 | run_in_console(cmdline, title)
|
---|
| 243 | else:
|
---|
[e4a1497] | 244 | print(cmdline)
|
---|
[f5ceb18] | 245 | if not is_override('dryrun'):
|
---|
| 246 | subprocess.call(cmdline, shell = True)
|
---|
[3f4c537a] | 247 |
|
---|
[df425da] | 248 | def ski_run(platform, machine, processor):
|
---|
[63d46341] | 249 | run_in_console('ski -i tools/conf/ski.conf', 'HelenOS/ia64 on ski')
|
---|
[df64dbc] | 250 |
|
---|
[df425da] | 251 | def msim_run(platform, machine, processor):
|
---|
[129b92c6] | 252 | hdisk_mk()
|
---|
[63d46341] | 253 | run_in_console('msim -c tools/conf/msim.conf', 'HelenOS/mips32 on msim')
|
---|
[df64dbc] | 254 |
|
---|
[3f4c537a] | 255 | def spike_run(platform, machine, processor):
|
---|
[ae8d7b0] | 256 | run_in_console('spike -m1073741824:1073741824 image.boot', 'HelenOS/risvc64 on Spike')
|
---|
[3f4c537a] | 257 |
|
---|
[f5ceb18] | 258 | emulators = {
|
---|
| 259 | 'amd64' : {
|
---|
| 260 | 'run' : qemu_run,
|
---|
| 261 | 'image' : 'image.iso'
|
---|
| 262 | },
|
---|
| 263 | 'arm32' : {
|
---|
| 264 | 'integratorcp' : {
|
---|
| 265 | 'run' : qemu_run,
|
---|
| 266 | 'image' : 'image.boot',
|
---|
| 267 | 'net' : False,
|
---|
[a1a81f69] | 268 | 'audio' : False,
|
---|
| 269 | 'xhci' : False,
|
---|
| 270 | 'tablet' : False
|
---|
[f5ceb18] | 271 | }
|
---|
| 272 | },
|
---|
| 273 | 'ia32' : {
|
---|
| 274 | 'run' : qemu_run,
|
---|
| 275 | 'image' : 'image.iso'
|
---|
| 276 | },
|
---|
| 277 | 'ia64' : {
|
---|
| 278 | 'ski' : {
|
---|
| 279 | 'run' : ski_run
|
---|
| 280 | }
|
---|
| 281 | },
|
---|
| 282 | 'mips32' : {
|
---|
| 283 | 'msim' : {
|
---|
| 284 | 'run' : msim_run
|
---|
| 285 | },
|
---|
| 286 | 'lmalta' : {
|
---|
| 287 | 'run' : qemu_run,
|
---|
| 288 | 'image' : 'image.boot',
|
---|
[868d75c] | 289 | 'console' : True
|
---|
[f5ceb18] | 290 | },
|
---|
| 291 | 'bmalta' : {
|
---|
| 292 | 'run' : qemu_run,
|
---|
| 293 | 'image' : 'image.boot',
|
---|
[868d75c] | 294 | 'console' : True
|
---|
[f5ceb18] | 295 | },
|
---|
| 296 | },
|
---|
| 297 | 'ppc32' : {
|
---|
| 298 | 'run' : qemu_run,
|
---|
| 299 | 'image' : 'image.iso',
|
---|
| 300 | 'audio' : False
|
---|
| 301 | },
|
---|
[3f4c537a] | 302 | 'riscv64' : {
|
---|
| 303 | 'run' : spike_run,
|
---|
| 304 | 'image' : 'image.boot'
|
---|
| 305 | },
|
---|
[f5ceb18] | 306 | 'sparc64' : {
|
---|
| 307 | 'generic' : {
|
---|
[df425da] | 308 | 'us' : {
|
---|
| 309 | 'run' : qemu_run,
|
---|
| 310 | 'image' : 'image.iso',
|
---|
[0195374] | 311 | 'audio' : False,
|
---|
[868d75c] | 312 | 'console' : True,
|
---|
[fd57cf17] | 313 | 'net' : False,
|
---|
| 314 | 'usb' : False,
|
---|
| 315 | 'xhci' : False,
|
---|
| 316 | 'tablet' : False
|
---|
[df425da] | 317 | },
|
---|
| 318 | 'sun4v' : {
|
---|
[9185e42] | 319 | 'run' : qemu_run,
|
---|
| 320 | 'image' : '-drive if=pflash,readonly=on,file=image.iso',
|
---|
| 321 | 'audio' : False,
|
---|
[868d75c] | 322 | 'console' : True,
|
---|
[9185e42] | 323 | 'net' : False,
|
---|
| 324 | 'usb' : False,
|
---|
[fd57cf17] | 325 | 'xhci' : False,
|
---|
| 326 | 'tablet' : False,
|
---|
[9185e42] | 327 | 'expect' : {
|
---|
| 328 | 'src' : 'ok ',
|
---|
| 329 | 'dst' : 'boot\n'
|
---|
| 330 | },
|
---|
[df425da] | 331 | }
|
---|
[f5ceb18] | 332 | }
|
---|
| 333 | },
|
---|
| 334 | }
|
---|
| 335 |
|
---|
| 336 | def usage():
|
---|
| 337 | print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0]))
|
---|
[7bf16b7e] | 338 | print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %
|
---|
[f5ceb18] | 339 | os.path.basename(sys.argv[0]))
|
---|
| 340 | print("-d\tDry run: do not run the emulation, just print the command line.")
|
---|
| 341 | print("-h\tPrint the usage information and exit.")
|
---|
| 342 | print("-nohdd\tDisable hard disk, if applicable.")
|
---|
| 343 | print("-nokvm\tDisable KVM, if applicable.")
|
---|
| 344 | print("-nonet\tDisable networking support, if applicable.")
|
---|
| 345 | print("-nosnd\tDisable sound, if applicable.")
|
---|
| 346 | print("-nousb\tDisable USB support, if applicable.")
|
---|
[5119d34] | 347 | print("-noxhci\tDisable XHCI support, if applicable.")
|
---|
[27de618] | 348 | print("-notablet\tDisable USB tablet (use only relative-position PS/2 mouse instead), if applicable.")
|
---|
[abf8bd8] | 349 | print("-nographic\tDisable graphical output. Serial port output must be enabled for this to be useful.")
|
---|
[2fc9bfd] | 350 | print("-noserial\tDisable serial port output in the terminal.")
|
---|
[abf8bd8] | 351 | print("-bigmem\tSets maximum RAM size to 4GB.")
|
---|
[df64dbc] | 352 |
|
---|
[df425da] | 353 | def fail(platform, machine):
|
---|
| 354 | print("Cannot start emulation for the chosen configuration. (%s/%s)" % (platform, machine))
|
---|
[a35b458] | 355 |
|
---|
[df425da] | 356 |
|
---|
[df64dbc] | 357 | def run():
|
---|
[f5ceb18] | 358 | expect_nic = False
|
---|
[3692678] | 359 | expect_qemu = False
|
---|
[f5ceb18] | 360 |
|
---|
| 361 | for i in range(1, len(sys.argv)):
|
---|
| 362 |
|
---|
| 363 | if expect_nic:
|
---|
| 364 | expect_nic = False
|
---|
| 365 | if not 'net' in overrides.keys():
|
---|
| 366 | overrides['net'] = {}
|
---|
| 367 | if sys.argv[i] == 'e1k':
|
---|
| 368 | overrides['net']['e1k'] = True
|
---|
| 369 | elif sys.argv[i] == 'rtl8139':
|
---|
| 370 | overrides['net']['rtl8139'] = True
|
---|
| 371 | elif sys.argv[i] == 'ne2k':
|
---|
| 372 | overrides['net']['ne2k'] = True
|
---|
[7bf16b7e] | 373 | elif sys.argv[i] == 'virtio-net':
|
---|
| 374 | overrides['net']['virtio-net'] = True
|
---|
[f5ceb18] | 375 | else:
|
---|
| 376 | usage()
|
---|
| 377 | exit()
|
---|
[f134413] | 378 | continue
|
---|
[f5ceb18] | 379 |
|
---|
[3692678] | 380 | if expect_qemu:
|
---|
| 381 | expect_qemu = False
|
---|
| 382 | overrides['qemu_path'] = sys.argv[i]
|
---|
| 383 |
|
---|
[f5ceb18] | 384 | elif sys.argv[i] == '-h':
|
---|
| 385 | usage()
|
---|
| 386 | exit()
|
---|
| 387 | elif sys.argv[i] == '-d':
|
---|
| 388 | overrides['dryrun'] = True
|
---|
| 389 | elif sys.argv[i] == '-net' and i < len(sys.argv) - 1:
|
---|
| 390 | expect_nic = True
|
---|
| 391 | elif sys.argv[i] == '-nohdd':
|
---|
| 392 | overrides['nohdd'] = True
|
---|
| 393 | elif sys.argv[i] == '-nokvm':
|
---|
| 394 | overrides['nokvm'] = True
|
---|
| 395 | elif sys.argv[i] == '-nonet':
|
---|
| 396 | overrides['nonet'] = True
|
---|
| 397 | elif sys.argv[i] == '-nosnd':
|
---|
| 398 | overrides['nosnd'] = True
|
---|
| 399 | elif sys.argv[i] == '-nousb':
|
---|
| 400 | overrides['nousb'] = True
|
---|
[5119d34] | 401 | elif sys.argv[i] == '-noxhci':
|
---|
| 402 | overrides['noxhci'] = True
|
---|
[27de618] | 403 | elif sys.argv[i] == '-notablet':
|
---|
| 404 | overrides['notablet'] = True
|
---|
[0ceeac3] | 405 | elif sys.argv[i] == '-nographic':
|
---|
| 406 | overrides['nographic'] = True
|
---|
[abf8bd8] | 407 | elif sys.argv[i] == '-bigmem':
|
---|
| 408 | overrides['bigmem'] = True
|
---|
[2fc9bfd] | 409 | elif sys.argv[i] == '-noserial':
|
---|
| 410 | overrides['noserial'] = True
|
---|
[3692678] | 411 | elif sys.argv[i] == '-qemu_path' and i < len(sys.argv) - 1:
|
---|
| 412 | expect_qemu = True
|
---|
[f5ceb18] | 413 | else:
|
---|
| 414 | usage()
|
---|
| 415 | exit()
|
---|
| 416 |
|
---|
[df64dbc] | 417 | config = {}
|
---|
| 418 | autotool.read_config(autotool.CONFIG, config)
|
---|
| 419 |
|
---|
[f5ceb18] | 420 | if 'PLATFORM' in config.keys():
|
---|
[df64dbc] | 421 | platform = config['PLATFORM']
|
---|
[f5ceb18] | 422 | else:
|
---|
[df64dbc] | 423 | platform = ''
|
---|
| 424 |
|
---|
[f5ceb18] | 425 | if 'MACHINE' in config.keys():
|
---|
[df64dbc] | 426 | mach = config['MACHINE']
|
---|
[f5ceb18] | 427 | else:
|
---|
[df64dbc] | 428 | mach = ''
|
---|
| 429 |
|
---|
[df425da] | 430 | if 'PROCESSOR' in config.keys():
|
---|
| 431 | processor = config['PROCESSOR']
|
---|
| 432 | else:
|
---|
| 433 | processor = ''
|
---|
| 434 |
|
---|
[df64dbc] | 435 | try:
|
---|
[df425da] | 436 | emu_run = cfg_get(platform, mach, processor)['run']
|
---|
| 437 | emu_run(platform, mach, processor)
|
---|
[df64dbc] | 438 | except:
|
---|
[df425da] | 439 | fail(platform, mach)
|
---|
[df64dbc] | 440 | return
|
---|
| 441 |
|
---|
| 442 | run()
|
---|