6   Installing an OS on Simics

The files dredd-cd-install1.simics and dredd-cd-install2.simics, that are supplied with the dredd simulated machine provide a way to install an operating system on Simics from a bootable CD-ROM. Before starting, please read the instructions in dredd-cd-install1.simics.

Note: If you plan to mount your finished disk using loopback, you should make sure that each simulated file system is small enough to fit uncompressed on your local machine.

Note: The instructions given here for installing from CD-ROM also apply to installing from DVD. The ISO format is the same for data CD-ROMs and DVDs and you can install from an ISO image of any size using the new-file-cdrom command described below.

  1. Create an ISO image file of the bootable CD-ROM you want to install from. Linux example:

    $ dd if=/dev/cdrom of=myos.iso

    On Windows, a third-party tool is necessary to create the ISO image. For more information on how to deal with CD-ROMs and other disk images, see the chapter titled Managing Disks, Floppies, and CD-ROMs in the Simics User Guide. On Linux and Solaris hosts it is not necessary to create the ISO file, Simics can also access the actual CD directly by specifying the device file.

  2. Run Simics with the first script:

    $ ./simics targets/x86-440bx/dredd-cd-install1.simics
  3. Insert the ISO image with the OS into the simulated CD-ROM drive with the following two commands, and then start the simulation.

    simics> new-file-cdrom myos.iso
    cdrom 'myos' created
    simics> cd0.insert myos
    simics> c

    To install from a CD that is inserted in the host CD-ROM unit instead of from an ISO file, replace the first line in the example above with the following example line. The argument /dev/cdrom is the path to the device and may be different depending on your host system. Note that this is not the path to the files on the CD, such as /mnt/cdrom. Accessing a CD on the host is not supported on Windows hosts.

    simics> new-file-cdrom "/dev/cdrom" myos
  4. When the installation is finished, shutdown the simulated machine (a lot of OSes do this automatically when the install is complete). The way to shutdown the machine differs between operating systems, but there is usually some help available on the screen.
  5. You may get a error message from Simics saying that reboot/suspend/shutdown is an experimental feature, but that can be ignored. At this point save the persistent state of the machine:
    simics> save-persistent-state install-phase1.state
    The persistent state contains all information on the disk, as well as the contents of NVRAMs and other devices that survive reboot. Finally exit Simics.
  6. Start Simics using the second script, which will boot from the installation disk and not from the CD-ROM. If the CD-ROM is needed, it has to be inserted into the machine in the same way as in the first phase of the installation.

    If the installer program in the simulated machine asks for the path to the CD-ROM, give the path in the simulated machine. Since there is only one CD-ROM in the default machine setup, this should be quite easy to identify.

    $ ./simics targets/x86-440bx/dredd-cd-install2.simics

    Then, before starting the simulation, load the persistent state that was saved at the end of the first phase.

    simics> load-persistent-state install-phase1.state
  7. Since there are probably changes done to the disk in the second phase as well, reboot the simulated machine, and when it has completed the shut down, save the persistent state to a new file.
  8. If there are several reboots during the installation process, save a new state file each time. Only the most recent one has to be loaded when Simics is restarted, but all state files must be kept since they depend on each other.
  9. When the install is complete, you will have one or more persistent state files. To create a single one, use the checkpoint-merge utility to join them. After verifying that the combined persistent state works, the previous ones can be removed.
  10. To run the machine with the newly installed operating system, start the dredd-common.simics and load the most recent persistent state file, or the combined state file that was created using the checkpoint-merge utility.
  11. If you want to change the number of processors in the machine or some other machine parameters, you can do so now (provided that you have installed support for multiple processors or other hardware during your install). See chapter 3.5.