AMD SimNow: Difference between revisions

From coreboot
Jump to navigation Jump to search
No edit summary
(14 intermediate revisions by 3 users not shown)
Line 3: Line 3:
There is PDF documentation that you can download on the same page as the simulator.  
There is PDF documentation that you can download on the same page as the simulator.  
== Build a ROM image for SimNow (Skip this step if you have your own Bios you want to use)==
== Build a ROM image for SimNow (Skip this step if you have your own Bios you want to use)==
# install Intel's ASL iasl tool
# make sure iasl tool is available
# ''svn co svn://coreboot.org/buildrom/''
# Choose Payload Configuration
# ''cd buildrom/buildrom-devel/''
## Desired Payload is FILO
# ''make menuconfig''
## Download the latest version of FILO from Subversion with
## Choose Platform Configuration
##''svn co svn://coreboot.org/filo/trunk/filo''
### Vendor AMD
##'' cd libpayload''
### Platform Target AMD Serengeti-Cheetah
##'' make defconfig''
### Select Build for SimNow emulator
##'' make''
## Choose Payload Configuration
##'' make DESTDIR=../build install''
### Desired Payload Linux-As-Bootloader
##''make menuconfig'' Note: use default configuration.
### Desired Target Architecture 64-bit
##''make CC="gcc -m32" LD="ld -b elf32-i386" HOSTCC="gcc" AS="as --32"''
### LAB Configuration
## filo.elf is generated.
#### Select Busybox but not reduced-size kexec tools
# Choose Platform Configuration
## Save and Exit
## ''svn co svn://coreboot.org/coreboot/trunk coreboot'' or go to http://www.coreboot.org/Download_coreboot to download coreboot
# ''make''
## ''cd targets/''
# Enjoy your amd_serengeti_cheetah.rom file
## ''./buildtarget amd/serengeti_cheetah/''
## ''cd amd/serengeti_cheetah/serengeti_cheetah/''
## make sure rename filo.elf to payload.elf and copy over to this directory
## ''gmake''
# coreboot.rom is generated.
 
== Download SimNow ==
== Download SimNow ==
# Download SimNow from [http://developer.amd.com/simnow.jsp AMD's website]
# Download SimNow from [http://developer.amd.com/simnow.jsp AMD's website]
Line 24: Line 29:
## Accept the license agreement
## Accept the license agreement
## Log in.
## Log in.
#Untar the .tar.gz file you download in a convenient place (You'll now have a directory called simnow-linux64-4.4.1pub)
#Untar the .tar.gz file you download in a convenient place (You'll now have a directory called simnow-linux64-4.5.x.pub)
#Follow the instructions from the help section "Setting up Linux" for the Simulator
## To get enough "mmap"able virtual address space, make sure you have a /etc/sysctl.conf file and that it contains the following line:
 
<pre><nowiki> vm.max_map_count = 1048576 </nowiki></pre>


== Run SimNow ==
== Run SimNow ==
#Run ''./simnow'' from the simnow-linux64-4.4.1pub directory
#Run ''./simnow'' from the simnow-linux64-4.5.xpub directory
#Inside the SimNow Main Window do File->Open BSD, browse to the simnow-linux64-4.4.1pub/bsds directory and load either cheetah_1p.bsd or cheetah_1pjh.bsd (jh is dual-core)<pre><nowiki>Now you have a single Opteron socket motherboard with an AMD-8132 PCI-X controller, an AMD-8111 I/O hub, and a Winbond W83627HF SuperIO.</nowiki></pre>  
#Inside the SimNow Main Window do File->Open BSD, browse to the simnow-linux64-4.5.xpub/bsds directory and load either cheetah_1p.bsd or cheetah_1pjh.bsd (jh is dual-core)
#Copy your coreboot ROM image to simnow-linux64-4.4.1pub/Images for convenience.
<pre><nowiki>Now you have a single Opteron socket motherboard with:
AMD-8132 PCI-X controller,  
AMD-8111 I/O hub,  
and Winbond W83627HF SuperIO.</nowiki></pre>  
#Copy your coreboot ROM image to simnow-linux64-4.5.xpub/Images for convenience.
#Open the SimNow Device Window (View->Show Devices)
#Open the SimNow Device Window (View->Show Devices)
#Double click on Memory Device #5 (Your BIOS chip)
#Double click on Memory Device #5 (Your BIOS chip)
#Click on the Memory Configuration Tab, and change the Base Address, Size, and File (I use Base Address = fff00000 and Size = 32 because I use a 1 MB image)
#Click on the Memory Configuration Tab, and change the Base Address, Size, and File (I use Base Address = fff00000 and Size = 32 because I use a 1 MB image)
#Click OK to save your changes
#Go to the main simulator window and hit Run Simulation (Play button)
#Go to the main simulator window and hit Run Simulation (Play button)
##You will get this error:
 
<pre><nowiki>"BIOS ROM file is the wrong size for this BSD.  Please either point the memdevice to the correct BIOS ROM file, or configure the memdevice to be the correct size." </nowiki></pre>
Repeat the last few steps to set the size and try again.  This happens whenever you increase the BIOS size.
== Serial Port Configuration ==  
== Serial Port Configuration ==  
In order to see the console output, go to the terminal you are running ./simnow in.  Hit enter.  You'll see a simnow> prompt.   
In order to see the console output, go to the terminal you are running ./simnow in.  Hit enter.  You'll see a simnow> prompt.   
Line 51: Line 63:
Alternatively, you can use a tool called 'snserial' to interact with the serial ports.  snserial will combine the input and output, and provide access to the combined stream through either a psuedo tty, or a telenet port.
Alternatively, you can use a tool called 'snserial' to interact with the serial ports.  snserial will combine the input and output, and provide access to the combined stream through either a psuedo tty, or a telenet port.


# Download the snserial tool from http://coreboot.org/~jcrouse/snserial-1.0.tar.gz.
# Download the snserial tool from http://khepri.openbios.org/~jcrouse/snserial-1.0.tar.gz.
# Extract it:  ''tar -zxvf snserial-1.0.tar.gz''
# Extract it:  ''tar -zxvf snserial-1.0.tar.gz''
# Build it: ''cd snserial/; make''
# Build it: ''cd snserial/; make''
Line 81: Line 93:
#Hit the Stop Simulation button if the simulation is running
#Hit the Stop Simulation button if the simulation is running
##File->Set IDE Primary Master Image
##File->Set IDE Primary Master Image
###Browse to your hard drive image
###Browse to your hard drive (.HDD) image
##File->Set IDE Secondary Master Image  
##File->Set IDE Secondary Master Image  
###Browse to a CD .iso
###Browse to a CD (.ISO) image
#Hit Run Simulation again
#Hit Run Simulation again



Revision as of 18:31, 30 October 2009

These are the steps I use to download, install, and use the AMD SimNow simulator. You may not want to do exactly what I did, but it should get you started. There is PDF documentation that you can download on the same page as the simulator.

Build a ROM image for SimNow (Skip this step if you have your own Bios you want to use)

  1. make sure iasl tool is available
  2. Choose Payload Configuration
    1. Desired Payload is FILO
    2. Download the latest version of FILO from Subversion with
    3. svn co svn://coreboot.org/filo/trunk/filo
    4. cd libpayload
    5. make defconfig
    6. make
    7. make DESTDIR=../build install
    8. make menuconfig Note: use default configuration.
    9. make CC="gcc -m32" LD="ld -b elf32-i386" HOSTCC="gcc" AS="as --32"
    10. filo.elf is generated.
  3. Choose Platform Configuration
    1. svn co svn://coreboot.org/coreboot/trunk coreboot or go to http://www.coreboot.org/Download_coreboot to download coreboot
    2. cd targets/
    3. ./buildtarget amd/serengeti_cheetah/
    4. cd amd/serengeti_cheetah/serengeti_cheetah/
    5. make sure rename filo.elf to payload.elf and copy over to this directory
    6. gmake
  4. coreboot.rom is generated.

Download SimNow

  1. Download SimNow from AMD's website
    1. Create an account
    2. Accept the license agreement
    3. Log in.
  2. Untar the .tar.gz file you download in a convenient place (You'll now have a directory called simnow-linux64-4.5.x.pub)
  3. Follow the instructions from the help section "Setting up Linux" for the Simulator
    1. To get enough "mmap"able virtual address space, make sure you have a /etc/sysctl.conf file and that it contains the following line:
 vm.max_map_count = 1048576 

Run SimNow

  1. Run ./simnow from the simnow-linux64-4.5.xpub directory
  2. Inside the SimNow Main Window do File->Open BSD, browse to the simnow-linux64-4.5.xpub/bsds directory and load either cheetah_1p.bsd or cheetah_1pjh.bsd (jh is dual-core)
Now you have a single Opteron socket motherboard with:
AMD-8132 PCI-X controller, 
AMD-8111 I/O hub, 
and Winbond W83627HF SuperIO.
  1. Copy your coreboot ROM image to simnow-linux64-4.5.xpub/Images for convenience.
  2. Open the SimNow Device Window (View->Show Devices)
  3. Double click on Memory Device #5 (Your BIOS chip)
  4. Click on the Memory Configuration Tab, and change the Base Address, Size, and File (I use Base Address = fff00000 and Size = 32 because I use a 1 MB image)
  5. Click OK to save your changes
  6. Go to the main simulator window and hit Run Simulation (Play button)

Serial Port Configuration

In order to see the console output, go to the terminal you are running ./simnow in. Hit enter. You'll see a simnow> prompt.

  1. Type serial.SetCommPort pipe and hit enter.
  2. Type serial.GetCommPort and hit enter.

On my machine this returns path (/home/myles/.simnow/com1), mode (PIPE)

Open a new terminal and type cat /home/myles/.simnow/com1/simnow_out If you need to send input to the serial port, echo to /home/myles/.simnow/com1/simnow_in

Using the snserial tool

Alternatively, you can use a tool called 'snserial' to interact with the serial ports. snserial will combine the input and output, and provide access to the combined stream through either a psuedo tty, or a telenet port.

  1. Download the snserial tool from http://khepri.openbios.org/~jcrouse/snserial-1.0.tar.gz.
  2. Extract it: tar -zxvf snserial-1.0.tar.gz
  3. Build it: cd snserial/; make

Before running the tool, make sure that you have enabled the serial pipes as detailed above.

To enable serial through a pseudo TTY, start your simulation and type ./snserial comX in another Linux terminal window (where X is 1 or 2). The program will respond with:

SimNow Serial pipe Muxer

Connection established.
Type 'target remote /dev/pts/2' in GDB to connect.
(Press CTRL-C to exit)

You can now connect your serial application (minicom, or GDB for debugging) to the specified pseudo-tty.

To enable serial interaction through telnet, start the simulation and type ./snserial -t comX. The program will respond with:

SimNow Serial pipe Muxer

COM 1: Listening on port 9000
(Press CTRL-C to exit)

You can now connect to the serial stream by typing 'telnet localhost 9000' in a Linux terminal window.

Note: It is a quirk of SimNow that the pipes are not created until the simulation for the BSD is started for the first time. Make sure you start the simulation before running snserial, otherwise you will see this: Couldn't stat /home/<user>/.simnow/com1/simnow_out: No such file or directory. The best course of action is to start the simulation quickly, attach the snserial program, and then restart the simulation to see the early serial output.

Add disks

  1. Hit the Stop Simulation button if the simulation is running
    1. File->Set IDE Primary Master Image
      1. Browse to your hard drive (.HDD) image
    2. File->Set IDE Secondary Master Image
      1. Browse to a CD (.ISO) image
  2. Hit Run Simulation again

You should get output from the serial port scrolling in one terminal, and be able to watch the VGA output in the main window.

If you used buildrom to get a BIOS image with coreboot + LAB, you'll end up at a linux prompt where you can mount the disks, etc.

Creative Commons License
Creative Commons Attribution iconCreative Commons Share Alike icon
This file is licensed under the Creative Commons Attribution ShareAlike 3.0 License.
In short: you are free to share and make derivative works of the file under the conditions that you appropriately attribute it, and that you distribute it only under a license identical to this one.