diff --git a/README.md b/README.md index d50c857ae..a9e237d3f 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,14 @@ Argument explanation: ``` [fw_jump.bin] Initial M-mode firmware, OpenSBI in this case -k, -kernel u-boot.bin S-mode kernel payload (Linux Image, U-Boot, etc) --i, -image drive.img Attach NVMe storage image (Raw format as of now) +-i, -image drive.img Attach NVMe storage image (Raw format as of now, use -nvme instead) +-nvme drive.img Attach NVMe storage image (Raw format as of now) +-ata drive.img Attach ATA storage image (Raw format as of now) -m, -mem 2G Memory amount (may be suffixed by k/M/G), default 256M -s, -smp 2 Amount of cores, single-core machine by default -res 1280x720 Changes framebuffer & VM window resolution -jitcache 64M Raise JIT cache limit (64M recommended for complex guests) +-serial /tmp/pts1 Add more serial ports (use stdout to bring UART over terminal as usual) . . . -rv32 Enable 32-bit RISC-V, 64-bit by default -cmdline, -append ... Override/append default kernel command line diff --git a/src/main.c b/src/main.c index b8771bcf7..f98e9b3b4 100644 --- a/src/main.c +++ b/src/main.c @@ -4,6 +4,7 @@ Copyright (C) 2021 LekKit cerg2010cerg2010 Mr0maks KotB + fish4terrisa-MSDSM This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +31,7 @@ along with this program. If not, see . #include "devices/rtc-goldfish.h" #include "devices/pci-bus.h" #include "devices/nvme.h" +#include "devices/ata.h" #include "devices/eth-oc.h" #include "devices/rtl8169.h" #include "devices/i2c-oc.h" @@ -79,9 +81,12 @@ static void print_help() " -rv32 Enable 32-bit RISC-V, 64-bit by default\n" #endif " -k, -kernel ... Load S-mode kernel payload (Linux, U-Boot, etc)\n" - " -i, -image ... Attach NVMe storage image\n" + " -nvme ... Attach NVMe storage image\n" + " -i, -image ... Attach NVMe storage image (For compatibility reasons)\n" + " -ata ... Attach ATA storage image (Deprecated)\n" " -cmdline ... Override default kernel command line\n" " -append ... Modify kernel command line\n" + " -serial ... Add more serial ports\n" #ifdef USE_FB " -res 1280x720 Change framebuffer resoulution\n" " -nogui Disable framebuffer GUI\n" @@ -237,6 +242,16 @@ static int rvvm_main(int argc, const char** argv) rvvm_error("Failed to attach image \"%s\"", arg_val); success = false; } + } else if (cmp_arg(arg_name, "nvme")) { + if (success && !nvme_init_auto(machine, arg_val, true)) { + rvvm_error("Failed to attach image \"%s\"", arg_val); + success = false; + } + } else if (cmp_arg(arg_name, "ata")) { + if (success && !ata_init_auto(machine, arg_val, true)) { + rvvm_error("Failed to attach image \"%s\"", arg_val); + success = false; + } } else if (cmp_arg(arg_name, "cmdline")) { rvvm_set_cmdline(machine, arg_val); } else if (cmp_arg(arg_name, "append")) {