Changes in tools/ew.py [e9c1639:c35cc8b] in mainline
- File:
-
- 1 edited
-
tools/ew.py (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tools/ew.py
re9c1639 rc35cc8b 76 76 77 77 def termemu_detect(): 78 emus = ['gnome-terminal', 'xfce4-terminal', 'xterm'] 78 emus = ['gnome-terminal', 'foot', 'xfce4-terminal', 'xterm'] 79 80 if 'TERMINAL' in os.environ: 81 emus.insert(0, os.environ['TERMINAL']) 82 79 83 for termemu in emus: 80 84 try: 81 subprocess.check_output('which ' + termemu, shell = True )85 subprocess.check_output('which ' + termemu, shell = True, stderr = subprocess.STDOUT) 82 86 return termemu 83 87 except: … … 89 93 def run_in_console(cmd, title): 90 94 temu = termemu_detect() 91 if temu == 'gnome-terminal': 95 96 if os.path.basename(temu.split(' ')[0]) in ['gnome-terminal', 'foot']: 92 97 cmdline = temu + ' -- ' + cmd 93 98 else: … … 139 144 return 'system-x86_64', pc_options(64) 140 145 elif platform == 'arm32': 141 return 'system-arm', '-M integratorcp' 146 if machine == 'integratorcp': 147 return 'system-arm', '-M integratorcp' 148 elif machine == 'raspberrypi': 149 return 'system-arm', '-M raspi1ap' 142 150 elif platform == 'arm64': 143 # Search for the EDK2 firmware image 144 default_paths = ( 145 '/usr/local/qemu-efi-aarch64/QEMU_EFI.fd', # Custom 146 '/usr/share/edk2/aarch64/QEMU_EFI.fd', # Fedora 147 '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', # Ubuntu 148 ) 149 extra_info = ("Pre-compiled binary can be obtained from " 150 "http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd.\n") 151 efi_path = find_firmware( 152 "EDK2", 'EW_QEMU_EFI_AARCH64', default_paths, extra_info) 153 if efi_path is None: 154 raise Exception 155 156 return 'system-aarch64', \ 157 '-M virt -cpu cortex-a57 -m 1024 -bios %s' % efi_path 151 if machine == 'virt': 152 # Search for the EDK2 firmware image 153 default_paths = ( 154 '/usr/local/qemu-efi-aarch64/QEMU_EFI.fd', # Custom 155 '/usr/share/edk2/aarch64/QEMU_EFI.fd', # Fedora 156 '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', # Ubuntu 157 ) 158 extra_info = ("Pre-compiled binary can be obtained from " 159 "http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd.\n") 160 efi_path = find_firmware( 161 "EDK2", 'EW_QEMU_EFI_AARCH64', default_paths, extra_info) 162 if efi_path is None: 163 raise Exception 164 165 return 'system-aarch64', \ 166 '-M virt -cpu cortex-a57 -m 1024 -bios %s' % efi_path 158 167 elif platform == 'ia32': 159 168 return 'system-i386', pc_options(32) … … 169 178 raise Exception 170 179 if processor == 'us': 171 return 'system-sparc64', '-M sun4u --prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a"' 180 cmdline = '-M sun4u' 181 if is_override('nographic'): 182 cmdline += ' --prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a"' 183 return 'system-sparc64', cmdline 172 184 173 185 # processor = 'sun4v' … … 256 268 suffix, options = platform_to_qemu_options(platform, machine, processor) 257 269 cmd = 'qemu-' + suffix 258 259 if cpus:260 cmd += ' -smp cpus=' + cpus + ' '261 270 262 271 cmdline = cmd … … 284 293 if (is_override('nographic')): 285 294 cmdline += ' -nographic' 295 console = True 286 296 287 297 if (not console and (not is_override('nographic')) and not is_override('noserial')): … … 302 312 elif cfg['image'] == 'image.boot': 303 313 cmdline += ' -kernel image.boot' 314 elif cfg['image'] == 'kernel.img@rpi': 315 cmdline += ' -bios boot/image.boot.bin' 304 316 else: 305 317 cmdline += ' ' + cfg['image'] … … 324 336 def msim_run(platform, machine, processor): 325 337 hdisk_mk() 326 run_in_console('msim - c ' + TOOLS_DIR + '/conf/msim.conf', 'HelenOS/mips32 on msim')338 run_in_console('msim -n -c ' + TOOLS_DIR + '/conf/msim.conf', 'HelenOS/mips32 on msim') 327 339 328 340 def spike_run(platform, machine, processor): … … 342 354 'xhci' : False, 343 355 'tablet' : False 344 } 356 }, 357 'raspberrypi' : { 358 'run' : qemu_run, 359 'image' : 'kernel.img@rpi', 360 'audio' : False, 361 'console' : True, 362 'hdd' : False, 363 'net' : False, 364 'tablet' : False, 365 'usb' : False, 366 'xhci' : False 367 }, 345 368 }, 346 369 'arm64' : { … … 396 419 'image' : 'image.iso', 397 420 'audio' : False, 398 'console' : True,421 'console' : False, 399 422 'net' : False, 400 423 'usb' : False, … … 404 427 'sun4v' : { 405 428 'run' : qemu_run, 406 'image' : '-drive if=pflash,readonly=on,file=image.iso', 429 # QEMU 8.0.0 ignores the 'file' argument and instead uses 'id', 430 # which defaults to 'pflash0', but can be changed to the same value 431 # as 'file' 432 'image' : '-drive if=pflash,id=image.iso,readonly=on,file=image.iso', 407 433 'audio' : False, 408 434 'console' : True, … … 422 448 def usage(): 423 449 print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0])) 424 print("%s [ $] [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-hdd ata|virtio-blk] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %450 print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-hdd ata|virtio-blk] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" % 425 451 os.path.basename(sys.argv[0])) 426 print("$\t to run multiple($) cpus")427 452 print("-d\tDry run: do not run the emulation, just print the command line.") 428 453 print("-h\tPrint the usage information and exit.") … … 446 471 expect_hdd = False 447 472 expect_qemu = False 448 global cpus449 cpus = ''450 473 451 474 for i in range(1, len(sys.argv)): … … 488 511 usage() 489 512 exit() 490 elif sys.argv[i].isdigit():491 cpus = sys.argv[i]492 513 elif sys.argv[i] == '-d': 493 514 overrides['dryrun'] = True
Note:
See TracChangeset
for help on using the changeset viewer.
