免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3938 | 回复: 3
打印 上一主题 下一主题

simics虚拟出的solaris10可以添加硬盘和其他设备吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-22 12:32 |只看该作者 |倒序浏览
按照精华区里的文章安装了solaris10,我想问能否再添加一些自定义设备比如硬盘
这样可以进行一些具体的实际操作练习,谢谢!

论坛徽章:
0
2 [报告]
发表于 2008-10-22 14:10 |只看该作者
没用过
VMware虚拟出的就可以

论坛徽章:
0
3 [报告]
发表于 2008-10-22 18:26 |只看该作者
我也碰到同样问题~

论坛徽章:
0
4 [报告]
发表于 2008-10-30 18:39 |只看该作者
可以的! Adding a new Disk to a SunFire Machine


Add a SCSI Disk Component
First create a file in [workspace]/targets/sunfire/ called peanut-disk.simics. In this file add the following contents:


script-branch {
    wait-for-variable machine_defined
    local $disk = (create-std-scsi-disk size = 4256972800)
    connect-components $scsi_bus scsi-slot-2 $disk scsi-bus
}

run-command-file peanut-common.simics
This 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.


Prepare the Boot
Start 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.


simics> sd1.create-sun-vtoc-header 5470 19 80
simics> sd1.create-sun-vtoc-partition number = 0 start-block = 0 num-blocks = ((5470 - 2) * 19 * 80) flag = RW tag = root


--------------------------------------------------------------------------------
Note: Configuring partitions can also be done using the Solaris format command once the simulated machine has booted.
--------------------------------------------------------------------------------

The partition table should now look something like:


Partition Table:
Number   Tag             Flag                 Start        End       Size
  0      2 (root)        0 (RW)                   0    8311359    8311360
  2      5 (backup)      1 (unmountable)          0    8311359    8311360
Before booting, tell Solaris that new hardware has been added, by adding the -r argument to the OBP boot command variable:
simics> system_cmp0.set-prom-env boot-command "boot disk1 -rv"

Configure Solaris
Start 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.


# newfs /dev/dsk/c0t2d0s0
newfs: construct a new file system /dev/rdsk/c0t2d0s0: (y/n)? y

<output from newfs here>

# mkdir /disk
# cat >> /etc/vfstab
/dev/dsk/c0t2d0s0    /dev/rdsk/c0t2d0s0   /disk ufs  2    yes    -
<control-D>
# mount /disk
The disk can now be accessed as /disk/ in the file-system.

Save the Changes
To save the changes to the new disk, shut down the simulated machine and save the modifications. Issue:


# init 0
then 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.
simics> system_cmp0.set-prom-env boot-command "boot disk1 -v"
simics> save-persistent-state new-disk1.state
Now exit Simics, and restart the peanut-disk.simics script. Before running, load the disk modifications saved earlier:
simics> load-persistent-state new-disk1.state
Now boot the machine again. The new disk will be mounted as /disk/.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP