Skip to content
Muhammad Shahbaz edited this page Jun 21, 2015 · 1 revision

Instructions for creating a NetASM VM using VirtualBox

Download and setup the VirtualBox

Installing Haskell Platform

Perform the following steps to install Haskell platform on your machine:

  • Change to root directory

    $ cd ~
  • Install the haskell-platform package from the ubuntu install-base. This process may take some time (several minutes to tens of minutes) depending on the speed of your connection.

    $ sudo apt-get install haskell-platform

    Important: It’s been reported that the above command is failing on most of the VMs. If this is happening with you, install haskell using the following command instead.

    $ sudo apt-get install ghc6
  • To test if the haskell platform is installed correctly, run ghci (a haskell interpreter)

    $ ghci
  • If installation is successful, you should see the following output:

    GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
    Loading package ghc-prim ... linking ... done.
    Loading package integer-gmp ... linking ... done.
    Loading package base ... linking ... done.
    Prelude>
  • On the gchi terminal, type :quit to exit the ghci interpreter

    Prelude> :quit

Once the Haskell platform is setup, you are now ready to install NetASM.

Installing NetASM

Perform the following steps to install NetASM on your machine:

  • Change to root directory

    $ cd ~/
  • Clone the NetASM-haskell repository

    $ git clone https://github.com/NetASM/NetASM-haskell.git

To test if NetASM is working on your VM, run the Hub example.

  • Change to NetASM-haskell root directory

    cd ~/NetASM-haskell
  • Run the Hub example

    $ runhaskell Apps/Hub/Run.hs
  • If this test run is successful, you should see the following output:

    [[("PID",(1,True)),("DRP",(0,True)),("inport",(1,True)),("outport",(2147483646,True))]
    [("PID",(1,True)),("DRP",(0,True)),("inport",(1,True)),("outport",(2147483645,True))]]
    
    "Instructions executed: 2"
    
Clone this wiki locally