NetRun Help

Logging In

If you don't yet have an account, or lost or don't trust your randomly generated password, you can reset your NetRun password here.  NetRun passwords are long randomly generated strings. Sorry, there's currently no way to set a custom password!

The password reset script mails your randomly generated password to your UAF email address. If you need to reset your UAF email password, call the helpdesk at 474-6564. Once you have your NetRun password, you can log in to netrun.

How your Code Runs

NetRun's default mode is "Subroutine fragment".  In this mode, the code you write becomes the center of a function named "foo"; like this:

int foo(void) {
YOUR CODE HERE
}
If you want to declare your own new functions, switch the Mode popup to "Whole subroutine (file)".  NetRun's main program will still try to call a function named "foo", so you have to name your top-level routine foo.

If you want to write your own complete main program, switch the Mode popup to "Whole program (main)".  None of the builtin NetRun code will be included, and you can define any routines you like.  You'll need to #include "lib/inc.c" to get the builtin NetRunroutines like print_int.

See also the Big List of NetRun Example Programs.

Saved Files

NetRun automatically saves everything you run under the "Run name:" you enter. You can then go back to the saved version by clicking the "Saved files:" link at the bottom of the page. If you use the same "Run name" twice, it overwites the previous version. Be careful--this makes debugging easier, but it also allows you to overwrite work!

Saved files with the same "prefix" are displayed together on one line.  NetRun defines a "prefix" as the whole run name up to the first space, underscore or dot.  So runs named "foo.bar", "foo_you", and "foo is my name" will all show up under the line "foo:"; while "foobar" will get listed on its own line.

Header Files

A selection of useful header files are automatically included by NetRun.  Currently, NetRun automatically includes:

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <string>
#include "lib/inc.h"
The only NetRun-specific header is "lib/inc.h".  The routines in lib/inc.h are documented below.

If you need to include additional headers, just switch to Whole Subroutine or Whole Program mode, and write the appropriate #include.

Builtin NetRun Functions

There are a bunch of handy functions built in to NetRun.  You can see how they work if you check the project/lib/inc.c file inside "Download this file as a .tar archive".  In no particular order, the routines are:
All these routines are accessible from both C and C++, and they work the same way in both languages.

Debugging in Assembly Language

The main program prints out the value returned from the "foo" subroutine you write, and x86 subroutines return their value in register eax, so you can see what's in register eax by just returning--it'll get printed out.

At the moment, there's no easy way to see what's in all the registers other than intentionally crashing, like doing a read-from-NULL:

	mov eax,[0]
You get an informative printout when you crash because NetRun registers a whole set of signal handlers (for segmentation fault, floating point exception, illegal instruction, etc.).  If you're interested in how this works, use the "Download this file as a .tar archive" link and read project/lib/signal.c.

Reading Input in Assembly

  1. Say "extern read_input" and "call read_input" as the FIRST TWO LINES in your assembly program.  This routine may trash (i.e., change) all other registers, so be sure to call it before doing anything else!  read_input, like any subroutine, returns its value in the eax register.
  2. Use eax as input to whatever computation you need to do.
  3. In the NetRun GUI, click "Input" checkbox to display the input data edit box.
  4. Enter the program's input data--just numbers--in the input data edit box.
  5. Hit "Run!".  The program will read the input you've typed in.
You can call "read_input" from C or C++, too--it takes no parameters, and returns the integer read in.

NetRun Output Images

NetRun automatically displays an image if your program writes a image file named "out.ppm", stored in the
PPM image format. Here's a complete out.ppm example program.

NetRun Hardware

The NetRun "P4" machine is an Intel Pentium 4 running at 2.8GHz. Hyperthreading is enabled, with two CPU frontends sharing the same arithmetic backend. The L2 cache is 1024KB.

Security in NetRun and Terms of Use

You are welcome to do any of the following using NetRun! The main NetRun CGI is a Perl script.  You're welcome to download that Perl script, using the "Download all saved files as a big .tar.gz archive" link.  This Perl script runs in taint mode, and uses regular expressions to check for dangerous characters in the input data.  It has extensive logging, and everything you run is marked with your username.  This means you should not attempt to hack into NetRun itself, or use NetRun to attack other machines.

You are not allowed to: share your NetRun account; denial-of-service or hack into NetRun; use NetRun to attack other machines; or use NetRun for any illegal, commercial, or partisan political purpose. Keep in mind Alaska AS11.46.740 makes "criminal use of a computer" a class C felony.

Your executable programs run with a variety of restrictions, enforced by the kernel:
To go beyond these restrictions, download a tar file of your project, and run it on your own machine!

O. Lawlor, ffosl@uaf.edu
CS, UAF