Assignment 2 FAQ

General

Assignment 2

Code Issues

What does ram_getsize do?
This function informs the caller of the location of the top and bottom of free memory when it is called. It is needed because the address of the bottom of free memory depends on how much memory has already been allocated using ram_stealmem. When this function is called it sets the pointers to memory top and bottom to be zero, so you should only ever call it once.

The memory between the top and bottom pointers is the memory you are going to manage.

Do I need to write my own tests?

Yes! Absolutely! Your code will be tested in many ways. The fact that it passes the test supplied is no guarantee it will pass all the tests we will run when marking it. You should design and code tests to make sure your code behaves as dictated in the specification.

Can I use inbuilt types?

You may use types already defined in the kernel. However, ensure that you understand them, and use them correctly.

vfs_open seems to mangle the string I pass it.

Yes, it does that (see the comment on the implementation). This means you need to be careful when opening the console, calls such as:

  vfs_open("something");
  vfs_open("something");
  
can fail, since GCC uses a single string constant for both function calls.

Spec Clarification

Do I have to support allocations larger than a page in alloc_kpages()?
No, your implementations of alloc_kpages() can assert(npages == 1). Yes, we know this breaks the tt3 test, that is okay.

How many regions do I need to support?

There is an absolute minimum number before your VM implementation will work. (you can work out what that number is.) However, you are unlikely to get close to full marks in this assignment unless your implementation is dynamic. The number of regions should only be limited by memory size, not some arbitrary value.

For my submission, the build number does not match. Is this a problem?

The build number (shown below as an X) is incremented each time you build your kernel. You do NOT have to match this with the number shown in the sample output. We will ignore it for testing purposes.

version 0 (ASST2 #X)

Is it okay if we leave some of the addition kprintf statement on the screen or will this cause the automarking to fail?

The code you submit should not add any printing in the submitted version. If you print extra statements it might cause the testing to fail, as we use a fairly simple pattern matching approach for testing your output.

We suggest surrounding all extra printing with a #ifdef PRINT_ON (or #if 0) and #endif pair. You can then easily switch printing on and off.

If I run my test from the command line, using $ sys161 kernel "p /testbin/mytest;q", the output from my test program does not get printed out on the console. What's going on?

When you run the kernel with more than one command (as above), then it just runs the commands one after the other. The first command in this case forks a process (your test), then returns. The second command tells the kernel to quit. The kernel doesn't wait for the forked process to end (why would it?), so it just kills the process before it can print anything.

We are aware of this, and in our testing we will wait for forked processes to end (within reason) before quitting the kernel.

Configuration

What sys161.conf file are you talking about? I don't have one.
The configuration file in ~/cs3231/root from assignment 0 will work fine, providing you modify it as described in the assignment 2 spec.

If you´ve deleted it, you can download this one.