Virtual USB disks can be used to transfer files to and from virtual machines.
A virtual USB disk is created with the new-usb-disk-comp command. The command accepts a file with disk image and creates a USB disk component:
simics> load-module usb-comp simics> $usb_disk=(new-usb-disk-comp file = /tmp/stick.img name = usb_disk)
Next, you can insert the virtual USB disk into the machine. Exactly how that is done depends on the system that is being simulated. A virtual USB disk should be connected to an empty USB-port connector:
simics> $usb_disk.connect-to $system Connecting usb_disk.usb_host to board.mb.sb.usb_port[10]
Writes to a virtual USB disk are normally not written directly to an image file, but cached in memory. The <image>.save command can be used to save changes to a new image file. One can find the objects that support the command with the help of the list-objects command:
simics> list-objects -all iface = image +-------+----------------------------+ | Class | Object | +-------+----------------------------+ ... |<image>|usb_disk.usb_scsi_disk_image| ... simics> usb_disk.usb_scsi_disk_image.save new_image