Download Simics User Guide for Unix

Transcript
7.1. Working with Images
Note: This memory limitation only applies to images. Although this is unlikely, Simics can
run out of memory due to other data structures becoming too large (for example memory
profiling information) even though a memory limit has been set.
7.1.3
Using Read/Write Images
As mentioned in section 6.2.2, images can also work as read-write media, although this is
not recommended. It can be useful sometimes when planning to make large changes to an
image (like installing an operating system on a disk).
To make an image read-write in your own configurations, simply set the second parameter (the “read-only” flag) of the files attribute in the image object to "rw".
In a ready-to-run example like enterprise, you can change this attribute after the configuration is completed:
# read the ’files’ attribute
simics> @files = conf.disk0_image.files
simics> @files
[[’enterprise3-rh73.craff’, ’ro’, 0, 20496236544L, 0]]
# provide the complete path to the file
simics> @files[-1][0] = "[workspace]/targets/enterprise/images/
enterprise3-rh73.craff"
# change the second element to make the file read-write
simics> @files[-1][1] = "rw"
simics> @files
[[’[workspace]/targets/enterprise/images/enterprise3-rh73.craff’,
’rw’, 0, 20496236544L, 0]]
# set the ’files’ attribute to its new value
simics> @conf.disk0_image.files = files
Note that by indexing files with the index -1, the last element of the array is accessed,
which is always the one that should be set read-write, in case files is a list of several files.
As you can see in the example above, Simics by default does not look for files in the
Simics search path when the files are used in read-write mode. If you do not provide a
complete path to a read-write file, a new file will be created in the current directory.
Use this feature with caution. Make sure to take a copy of the original image before
running Simics with the image in read-write mode. Remember to synchronize the storage
device within the target OS before exiting Simics, for example by shutting down the simulated machine.
72