Skip to main content
Department of Information Technology

Clarifications and FAQ

This page will list clarifications and frequently asked questions on the specification, the tools, and other project aspects occuring during the course. Please check this page first if you have some problems. There are currently the following sections to this page:


Specification

1. Final Deliverable

The details on what the final deliverable should contain can be found on the final deliverable page.

2. Garbage Collection / Reclaiming Resources

In the specification, there is a requirement to reclaim all memory used by a certain process when it ends. What this means is that if you use statically allocated arrays for the process control blocks and process stacks and message queues, you should make sure that all used items are put back on the list of free items when the process ends. Ideally, you should also make sure that you have sufficient stack and message space for the maximum number of processes that your operating system supports.

3. Types for Process Starting Point Functions

All functions that form the starting point of a process should take the same parameters, since you will want to have arrays of function pointers with starting points of your processes. This requires that all starting point functions take the same parameters (if nothing else, the C type system requires this). Parameters from the process spawning a new process is easier to send as messages to the new process than to try to pass as arguments to the actual spawning.

4. Process Starting Point Functions Returning

If a process designated as the starting point of a process returns, your OS should interpret and handle this as if the process exited. Logically, this can be accomplished by wrapping the starting of function like in the following C-like pseudo-code (this code is called as the actual starting point of the new process, so it is run in the context of the new process):

StartProcess( function-pointer function_to_start )
{
  function_to_start()
  quit_this_process()  // kernel call to terminate this process
  // if we get here, we are in trouble
}


Programming

1. Description of Example Files

The example files page describes the header files in the include directory. What should be noted is especially the use of C structures to map hardware. In effect, we have the following:

  • A struct can be used to put names to offsets in memory, as each element in the struct has a fixed offset from the start of the struct.
  • By creating a pointer to a structure, and then assigning a specific address to this pointer, a structure can be used to access any part of memory in a "structured" manner.
  • The file malta.h creates pointers to the devices in the current MIPS system, using the structures defined in the device-specific files.
  • See the example code for how these structures are used.

Tools

1. Problems running the Linux part of the Simics introduction lab

You might encounter the following problem when running the introduction lab:

Argument error: argument 1 (vmlinux-4kc) given to 
'<processor>.load-binary' has the wrong type; an existing 
file (in the Simics search path) expected.
SYNOPSIS: <processor>.load-binary filename [offset] [-v] 
[-pa] [linux.simics:7] the command did not complete properly; 
interrupting script

This indicates that the file SIMICS/import/mips/vmlinux-4kc is missing. In the case that it is missing, copy it from /it/kurs/compsys/simics-2.0.23/import/mips.

Updated  2005-10-19 15:44:53 by John Håkansson.