Preparing AMD's SimNow For Use With GDB And Serial Console

While working on the Barrelfish OS I needed a better way to interact with SimNow's serial interface. The problem is that SimNow allows you to set up pipes for serial communication to the development system. One file is created for the input and another for the output. Using cat for the output and echo for the output can be a real pain, especially when you want to easily configure a system to use a debugging system like GDB on the same physical machine. Around this time I found a document on the coreboot website that directly address this issue with a simple program called snserial.

From the SimNow documentation we can tell how to set up a serial pipe. Here is how I did it.

First make sure that you have a bsd loaded then execute the following.

  1. simnow> serial.SetCommPort pipe
  2. simnow> serial.GetCommPort

The pipe will not actually start or be created until you actually start the bsd. Once the bsd has been started there will be a directory within your user directory containing the pipes. On my system there were two files, simnow_out and simnow_in, created at ~/.simnow/com1/.

Once the bsd has been started with a system running an image that actually produces serial output you can view the output by

# cat ~/.simnow/com1/simnow_out

And you can echo commands to the remote system with echo. The options "-e" and "-n" may be worth looking into when using the echo command on some systems.

# echo <options> [echo] > ~/.simnow/com1/simnow_in

This method of serial io is not very conventional and may result in difficulties when working with additional systems. That's where the core boot resource snserial comes in. This program is being distributed under GPL v2 or higher. I've attached it to this document in the event that it's original host is not longer available.

I've also attached a patch that may need to be applied. I had some problems building due to a few unsigned int and pointer issues.

To run the patch just cd into the source directory after being unpacked and execute the following.

  1. # tar -zxvf snserial-1.0.tar.gz && cd snserial
  2. # patch -p1 < snserial-1.0.patch
  3. # make
  4. # ./snserial

The above unpacks, patches, builds and executes snserial. Snserial above is executed with default options. For more information and options for snserial see the README file.

It is worth noting that when testing, SimNow does print "SimNow" out on the terminal to let you know things are working. If you need a test source do some googleing for GRUB (legacy) Serial and I bet you'll find something helpful.

AttachmentSize
snserial-1.0.tar.gz13.35 KB
snserial-1.0.patch1.17 KB

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.