Vengineerの妄想(準備期間)

人生は短いけど、長いです。人生を楽しみましょう!

Zynqのqemu (その1)



qemuのmain関数は、vl.cで定義されています。
これを書いた時点のソースコードでは、2144行目です。

以下のようなqemuのコマンドオプション(-M)にて、実行するマシンを指定しています。
2843             case QEMU_OPTION_machine:
2844                 olist = qemu_find_opts("machine");
2845                 qemu_opts_reset(olist);
2846                 opts = qemu_opts_parse(olist, optarg, 1);
2847                 if (!opts) {
2848                     fprintf(stderr, "parse error: %s\n", optarg);
2849                     exit(1);
2850                 }
2851                 optarg = qemu_opt_get(opts, "type");
2852                 if (optarg) {
2853                     machine = machine_parse(optarg);
2854                 }
2855                 break;

Zynqの場合は、xilinx-zynq-a9になります。
    ./arm-softmmu/qemu-system-arm -M xilinx-zynq-a9 .....

2853行目でmachine(QEMUMachine)に実行するマシン名がストアされます。
このmachineのinit関数が呼び出されます(3377行目)。
3375     qdev_machine_init();
3376 
3377     machine->init(ram_size, boot_devices,
3378                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model);

では、このinit関数はどこで定義されているのでしょうか。
それは次回に。。

検証、Verification、FPGA