School of Computer Science

Running Simulator Under VC++


  • Download all c files and data files from Olympus,
          *.c, *.h: simulator.c, obj1.c, obj2.c, obj3.c, obj4.c, obj5.c, obj6.c, osdefs.h, externs.h
          *.dat: boot.dat, compiler.dat, config.dat, editor.dat, linker.dat, logon.dat, printer.dat, script.dat, user.dat
    and put them in one directory, for example, c:\work

    Because the simulator defines two functions (strlwr and strupr) that are already defined by Microsoft Visual C++, you could not
    successfully build the simulator with the files which are downloaded from Olympus.
    You could modify the externs.h and simulator.c by yourself (two functions are declared and implemented in these two files).
    Comment out the the definitions and implementation of those functions in our simulator.
    • Goto externs.h and comment out their definition in line 84 and 85
    • Goto simulator.c and comment out strlwr's implementation (line 910-918) and strupr's implementation (line 920-927).
    You could also just replace the original files with modified externs.h, simulator.c

    Remember that you should not change simulator.c, externs.h or osdefs.h during your afterward programming .

  • Open Microsoft Visual C++, then Select File->New->Win32 Console Application
          Project Name: sim
          Location: C:\Work
    Click "OK" buttion, then choose "An empty project" and click "Finish" button.

  • You will get an empty workspace. Menu Project->Add to Project->Files, select all the source files
    (including simulator.c, extern.h, osdefs.h, obj1.c, obj2.c, obj3.c, obj4.c, obj5.c, obj6.c)
    After the above steps,
  • you should be able to compile and run the simulator, though you will get a lot of warnings. Don't worry about
    those warnings. Just skip them and go ahead!

  • Write you own source code, debug and run it!
      Note: Stick to the standard C. Your project will be graded in Olympus. So you should periodically upload your code to Olympus and
      make sure they work correctly.