Skip to content

Commit

Permalink
Merge new args/doc from fish4terrisa-MSDSM/staging
Browse files Browse the repository at this point in the history
Added the information about serial to help output and added the seperated nvme and ata option
  • Loading branch information
LekKit authored Jan 12, 2024
2 parents 16e4574 + 297c776 commit 4609f1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright (C) 2021 LekKit <github.com/LekKit>
cerg2010cerg2010 <github.com/cerg2010cerg2010>
Mr0maks <[email protected]>
KotB <github.com/0xCatPKG>
fish4terrisa-MSDSM <[email protected]>
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
Expand All @@ -30,6 +31,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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")) {
Expand Down

0 comments on commit 4609f1a

Please sign in to comment.