hw22_osbugs - z Interrupts are disabled in kernel mode z...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 1 of 2 Homework: OS Bugs Read : Bugs as Deviant Behaviour paper . (See readings.) Hand-In Procedure You are to turn in this homework during lecture. Please write up your answers to the exercises below and hand them in to a 6.828 staff member at the beginning of lecture. OS Invariants In case, after all that OS hacking, you're wondering why 6.170 was a pre-requisite: here's a homework on invariants and specifications. Operating system code must obey many rules for correctness and performance (e.g. check user pointers before using them in kernel mode). These rules aren't normally checked by compilers like gcc and Engler et al make an argument for using a meta-compiler to check the source code for system-specific rule violations. Think about your JOS implementation. What are some unstated invariants in the JOS kernel? Here are some simple invariants that should generally be true across all our implementations:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: z Interrupts are disabled in kernel mode. z All registers are saved and restored on a context switch. z Application code is never executed with priority level (CPL) 0. z Never write to a page on the free page list. z If a page is on the free list, it is not mapped in any environment's address space below KERNBASE . z The addresses for UENVS , UPAGES and UVPT are never mapped writable in any address space. z There is only one GDT and only one TSS . There are a large number of other invariants and rules that you could probably state about your specific JOS implementation. Question Have you encountered any nasty bugs that would have been avoided if a metacompiler had alerted you that you were violating some rule or invariant you assumed your code was obeying? [feel free to recount mind-numbing debugging marathons here] This completes the homework. Page 2 of 2 In fact, this completes all homeworks!...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

hw22_osbugs - z Interrupts are disabled in kernel mode z...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online