Megan0704-1 / OS

UNIX like OS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Command

qemu-system-riscv64 -machine virt -bios none -kernel kernel/kernel -m 128M -smp 1 -nographic -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0

Note: the -nogrphic command tells QEMU to run without a graphical output. It is useful for running the VM in a command-line env.

Breaking it down

  • qemu-system-riscv64: This starts QEMU with support for a RISC-V 64 bit architecture.
  • machine virt: This specifies the type of hardware model to be emulated. virt is a platform which does not correspond to any real hardware. link
  • bios none: This tells QEMU not to emulated Basic Input/Output System. Instead, the machine will be booted directly from the kernel.
  • -kernel kernel/kernel: This option specifies the kernel to boot. (In this case, the kernel image is located in kernel/kernel)
  • -m 128M: This option sets the amount of memory for the VM. (128 MB of RAM)
  • -smp 1: This option sets the number of CPU cores for the VM. (single core)
  • -nographic: Tells QEMU to run without graphical output. (running VM in a command-lline env)
  • -drive file=fs.img,if=none,format=raw,id=x0: This option sets up a virtual drive.
    • file = fs.img: This specifies the disk image file used for the virtual drive.
    • if=none: This means that the drive is not connected to any standard buses (e.g. IDE, SCSI). This is set for the purpose of manually code up interface for connecting to storage devices.
    • format=raw
    • id=x0

About

UNIX like OS

License:Other


Languages

Language:C 77.2%Language:Python 9.6%Language:HTML 7.8%Language:Assembly 2.4%Language:Makefile 2.1%Language:CSS 0.7%Language:Perl 0.2%Language:Shell 0.1%Language:Emacs Lisp 0.0%