text: import argparse
  import os
  
  print("本构建脚本基于Python的argparse库，使用参数--help查看详细使用方法")
  
  parser = argparse.ArgumentParser()
  parser.description = '运行生成的bootloader'
  
  qemu_run_command = "qemu-system-aarch64 \
      -machine virt,secure=on \
      -cpu cortex-a72 \
      -smp 4 \
      -netdev user,id=user0,hostfwd=tcp::5000-:22 \
      -device virtio-net-device,netdev=user0 \
      -m 1024"
  
  parser.add_argument("-f", "--firmware",
                      help="（必选）指定固件类型",
                      type=str,
                      choices=["UEFI", "BIOS"])
  
  parser.add_argument("-d", "--debug",
                      help="（必选）指定固件类型",
                      type=str)
  
  args = parser.parse_args()
  
  if args.firmware is None:
      assert "要运行的固件类型不能为空"
  
  
  if args.firmware == "UEFI":
      if os.name == "posix":
          os.system("mkdir -p out_dir/EFI/Boot")
          os.system("cp out_dir/bootaa64.efi out_dir/EFI/Boot")
      elif os.name == "nt":
          os.system("md out_dir\\EFI\\Boot")
          os.system("copy out_dir\\bootaa64.efi out_dir\\EFI\\Boot")
      else:
          assert "unknown system!"
      qemu_run_command += " -bios trusted_edk2.bin"
      qemu_run_command += " -hda fat:rw:out_dir/"
      qemu_run_command += " -net none"
      qemu_run_command += " -device virtio-gpu-pci"
      qemu_run_command += " -serial stdio"
  else:
      qemu_run_command += " -bios out_dir/boot-aarch64_bios.img"
      qemu_run_command += " -device loader,file=header.img,addr=0x40100000"
      qemu_run_command += " -nographic"
  
  if args.debug is not None:
      qemu_run_command += " -S -s"
  
  os.system(qemu_run_command)
  