Question 1. Which register number is used for the stack pointer (sp) in OS/161?
Answer: 29
As described by ./kern/arch/mips/include/asmdefs.h:#define sp $29 /* stack pointer */
Question 2. What bus/busses does OS/161 support?
Answer: Only one LAMEbus
As described by ./kern/arch/mips/include/bus.h: * The only bus we support for MIPS is LAMEbus.
Question 3. What is the difference between splhigh and spl0?
While both functions modify the interrupt priority levele, splhigh blocks all interruots by
seting the priority level to the highest value, while spl0 unlocks all interrupts by setting
spl to the lowest value.
As described by ./kern/arch/mips/include/spl.h
Question 4. Why do we use typedefs like u_int32_t instead of simply saying "int"?
typedef allows us to use a different name for a native type, in this case u_int32_t for int.
However, the C standard doesn't specify what the size of int is, and sizeof(int) may change
from platform to platform. Using typedef we can use a header file to appropriately match
a data type name to the proper native data type, for instance u_int32_t to a 32 bit integer type,
thus avoiding replacing all occurrences of int in the source code if the application
is ported to a different platform.
Source: http://en.wikipedia.org/wiki/64-bit
Question 5. What does splx return?
splx returns the old priority level
As described in: ./kern/arch/mips/mips/spl.c
Question 6. What is the highest interrupt level?
Answer: 15
As defined in: ./kern/arch/mips/include/spl.h:#define SPL_HIGH 15
Question 7. How frequently are hardclock interrupts generated?
/* hardclocks per second */
#if OPT_SYNCHPROBS
/* Make synchronization more exciting :) */
#define HZ 10000
#else
/* More realistic value */
#define HZ 100
#endif
Depending on configuraiton, ie the value of OPT_SYNCHPROBS, the kernel generates hardclock
interrupts every 10000 or 100 times a second.