Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / legion / docs / readmes / README.modify_diskimage
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "@(#)README.modify_diskimage 1.1 05/03/14 SMI"
#
# Modifying the Solaris disk image:
#
There are 2 ways to modify a disk image for use within the simulation
environment:
1) lofi mount the disk image
The Solaris disk image may be mounted on your development host by
using the Solaris lofi facility. Use lofiadm to enable access to
the simulated disk as a block device and then the Solaris mount
command may be used to mount it.
NOTE: you will need root access to modify a disk image.
Example:
To add files to the Solaris disk that you are booting from:
As root on a machine, do the following:
# lofiadm -a /export/my_disk_image
Take note of the value returned from lofiadm. For this
example we assume it's /dev/lofi/1
If needed, you can fsck your boot disk image as follows
# fsck -y /dev/rlofi/1
You can then mount this disk image:
# mount /dev/lofi/1 /mnt
# cd /mnt
You can then add/remove files to/from your disk image.
Once you are done you can umount the disk image and boot
the simulator.
# cd /
# umount /mnt
# lofiadm -d /dev/lofi/1
2) Boot under legion with disk in "shared" mode
The default legion config file uses the disk image in "rom" mode
(changes made to the disk image by the simulated system are not
committed to the underlying disk image). Once the simulator exits
the changes are lost. The benefit of this mode is that bugs in
the simulated system will not corrupt your disk image.
(eg. load s0 rom "disk1";)
You can use the "shared" keyword in the config file to allow
changes made within legion to the disk to be reflected on the
disk image itself. (eg. load s0 shared "disk1"; )
Be careful when using this mode as you can corrupt your disk
image if you leave it in an inconsistent state. If running in
this mode, halt the running Solaris within legion before killing
the simulation.
Example:
device "memory" 0x1f40000000 +800M {
virtual_disk;
load s0 shared "disk1";
load s3 shared "disk.export";
}