Chinaunix

标题: simics虚拟出的solaris10可以添加硬盘和其他设备吗? [打印本页]

作者: blackwolfdog    时间: 2008-10-22 12:32
标题: simics虚拟出的solaris10可以添加硬盘和其他设备吗?
按照精华区里的文章安装了solaris10,我想问能否再添加一些自定义设备比如硬盘\r\n这样可以进行一些具体的实际操作练习,谢谢!
作者: tjlong    时间: 2008-10-22 14:10
没用过\r\nVMware虚拟出的就可以
作者: microangle    时间: 2008-10-30 18:39
可以的! Adding a new Disk to a SunFire Machine\r\n\r\n\r\nAdd a SCSI Disk Component \r\nFirst create a file in [workspace]/targets/sunfire/ called peanut-disk.simics. In this file add the following contents: \r\n\r\n\r\nscript-branch {\r\n    wait-for-variable machine_defined\r\n    local $disk = (create-std-scsi-disk size = 4256972800)\r\n    connect-components $scsi_bus scsi-slot-2 $disk scsi-bus\r\n}\r\n\r\nrun-command-file peanut-common.simics\r\nThis will run a script branch that first waits for the machine to be defined by the machine configuration script (included from peanut-common.simics). Once the $machine_defined variable has triggered, a SCSI disk component, representing a 4GB disk, will be created that on the following line is connected to the SCSI bus component on connector scsi-slot-2. \r\n\r\n\r\nPrepare the Boot \r\nStart Simics, but do not start the simulation. Before booting, the disk needs an empty partition table for Solaris to recognize the disk. The partition table must contain a geometry that matches the size of the disk. Also add a large partition that covers the full disk. \r\n\r\n\r\nsimics> sd1.create-sun-vtoc-header 5470 19 80\r\nsimics> sd1.create-sun-vtoc-partition number = 0 start-block = 0 num-blocks = ((5470 - 2) * 19 * 80) flag = RW tag = root\r\n\r\n\r\n--------------------------------------------------------------------------------\r\nNote: Configuring partitions can also be done using the Solaris format command once the simulated machine has booted.\r\n--------------------------------------------------------------------------------\r\n \r\nThe partition table should now look something like: \r\n\r\n\r\nPartition Table:\r\nNumber   Tag             Flag                 Start        End       Size\r\n  0      2 (root)        0 (RW)                   0    8311359    8311360\r\n  2      5 (backup)      1 (unmountable)          0    8311359    8311360\r\nBefore booting, tell Solaris that new hardware has been added, by adding the -r argument to the OBP boot command variable: \r\nsimics> system_cmp0.set-prom-env boot-command \"boot disk1 -rv\"\r\n\r\nConfigure Solaris \r\nStart the simulation and wait for the simulated machine to reach the prompt. A file system has to be created on the new disk, this is done using the Solaris newfs command. At the same time, also add a mount point, and an entry in the file-system table. This way Solaris will automatically mount the disk on the next boot. \r\n\r\n\r\n# newfs /dev/dsk/c0t2d0s0\r\nnewfs: construct a new file system /dev/rdsk/c0t2d0s0: (y/n)? y\r\n\r\n<output from newfs here>\r\n\r\n# mkdir /disk\r\n# cat >> /etc/vfstab\r\n/dev/dsk/c0t2d0s0    /dev/rdsk/c0t2d0s0   /disk ufs  2    yes    -\r\n<control-D>\r\n# mount /disk\r\nThe disk can now be accessed as /disk/ in the file-system. \r\n\r\nSave the Changes \r\nTo save the changes to the new disk, shut down the simulated machine and save the modifications. Issue: \r\n\r\n\r\n# init 0\r\nthen wait for Solaris to shut down, stop the simulation and save the all modifications using the save-persistent-state command. But first remove -r from the boot command, or it will be for the next boot as well, making the boot slower. \r\nsimics> system_cmp0.set-prom-env boot-command \"boot disk1 -v\"\r\nsimics> save-persistent-state new-disk1.state\r\nNow exit Simics, and restart the peanut-disk.simics script. Before running, load the disk modifications saved earlier: \r\nsimics> load-persistent-state new-disk1.state\r\nNow boot the machine again. The new disk will be mounted as /disk/.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2