Archer:SimNow

From Grid-Appliance Wiki

Jump to: navigation, search

Contents

Introduction

The AMD SimNow™ simulator is an AMD64 technology-compatible x86 platform simulator for AMD's family of processors. It is designed to provide an accurate model of a computer system from the program, OS, and programmer's point of view. It allows fast simulation of an entire computer system, plus standard debugging features such as break-pointing, memory-viewing, and single-stepping. The simulator allows such work as BIOS and OS development, memory-parameter tuning, and multi-processor system simulation.

The simulator works by translating guest x86 instructions to long-mode user-mode instructions which it then executes. The simulator has a concept of time, but it is not a cycle-accurate simulator. The basic timing mechanism is an instruction; all instructions execute in the same amount of time and are one tick in length.

Important SimNow Terms:

  1. Computer Platform Files (BSD - BroadSword Document): The bsd file (*.bsd) contains the configuration of the system (how models are connected together and their settings) and the logical state of all the devices in the simulator. When starting a simulation from reset, the “*.bsd” file is rather small and only contains the configuration information. When the simulation is halted and saved, the size of “*.bsd” files grow significantly. The developer's edition of SimNow includes few pre-configured bsds in the ./bsds directory.
  2. Device: A device library or device group (also, a known device or created device).
  3. Device Library: Contains binary implementation of device functionality; has no child devices; associated with a “*.bsl” Windows or “*.bsl” Linux file.
  4. Device Group: Grouping of one or more devices (libraries and groups) into a single device; gets its functionality through aggregation of its children, and from its group-specific properties/aspects; associated with a “*.bsg” file.
  5. Machine: Every BSD has a single created device group called the Machine device. It is special since it is the root node of a machine tree (it has no parent, it can't be deleted, it has no ports, and it has no sibling devices); each machine in a BSD has a single machine created device group.
  6. Image files: Hard Drive Image (*.hdd), Floppy Drive Image(*.fdd), DVD-/CD-ROM Image(*.iso), Generic Image(*.img)

This tutorial guides you through the process of installing and using SimNow on an Archer Appliance. For a more detailed tutorial on SimNow, refer to SimNow Users Guide

Pre-requisites

This tutorial assumes that you are familiar with the Grid Appliance and Archer Express.

Preparing your appliance to run SimNow

1. Configure the appliance's memory according to the simulated system's requirement. The default memory of an Archer Appliances is usually insufficient for running SimNow. Your VM should be configured with sufficiently more memory than what is required by the system it is simulating. For example, if the simulated machine is configured for 512MB ram, it is suggested to have the virtual appliance configured with around 1GB ram.

2. Set max_map_count by follwoing the below steps

  • Add the following to "/etc/sysctl.conf"
 # This is here to make sure we get enough "mmap"able virtual address
 # space, in 4K pages. It defaults to 65536, which is generally
 # too small. 
 vm.max_map_count = 1048576
  • Run the command "sysctl -p"

3. Make sure that the per-process memory limits is set to infinite by running the below commands

  • ulimit -m unlimited
  • ulimit -v unlimited

Installing SimNow on your Local Appliance

tar –xzf Simnow-Linux64-<version>.tar.gz


Running SimNow in Interactive Mode

To run SimNow you need to navigate to the directory containing SimNow binaries.

Below are the command line arguments for simnow:

Argument      Description
-l <path>     Directory to load devices from. If used, it must be first.
-f <file>     Open the .bsd file <file>.
-e <file>     Execute commands in <file> on startup.
-i <path>     Image search path for loading image files.
-m <path>     Mediator connection string for network adapters to use.
-n --novga    Disable VGA Window.
-c --nogui    Disable GUI (console mode).
-d            Disable mouse and keyboard inputs to simulator.
-r --register Register the simulator with the O/S as an automation server.
-h --help -?  Print this help message.

To open SimNow in GUI (console) mode, go to the simnow base directory and execute "./simnow". If you are not able to use the GUI within the Virtual Machine's window, you can configure SSH to open the GUI console on your local system. Refer Appendix A for a quick reference on using X-windows with SSH by configuring it with X11 tunneling. File:SimNow-GUI.png

Running SimNow Remotely

You can run simnow using the binaries in a remote system. We have hosted the SimNow binaires, shared libraries and a BSD file with saved state of a machine installed with Linux on a file server. To use these files for a sample simulation, use the below commands:

mkdir simnow_test
cd simnow_test
ln -s /mnt/ganfs/C001001250/simnow-linux64-4.5.2pub/* .
export LD_LIBRARY_PATH=`pwd`/libs:`pwd`/linuxlibs:`pwd`/local_lib
./simnow -f ./bsds/melody_1p_64MB_debian.bsd -i ./Images

Now, you can directly interact by using the GUI Main Window or by issuing commands in the console.

Appendix

A. X-window Using SSH Forwarding

Some brief steps to configure X11 forwarding using SSH

Windows

  • Install and start a X Window Server on your windows system. Xming can be used for this purpose.
  • Configure your ssh client for forwarding X11. In PuTTY, go to configuration > Connection > SSH > X11 and click on Enable X11 forwarding.

Linux

In Linux, you can forward X11 by using the parameter "-X" with ssh. For example: ssh -X username@hostname

References

  1. AMD SimNow Documentation
  2. SimNow used in COTSon
  3. Video Tutorials (Part 1 through Part 6)
Personal tools