name: Forbidden Patterns and Hard Requirements description: Dangerous-bend rules from kernel.pdf - violations cause test failures or grade penalties type: project
These are explicitly called out as fatal-fail or grading-critical in kernel.pdf.
No sim_breakpoint() / MAGIC_BREAK at submission - test harness fails the entire suite if the kernel drops into the debugger.
No inline assembly (asm()) - use .S files for all assembly. Inline asm interacts badly with compiler optimizations and flags.
No COW (copy-on-write) - implement ZFOD instead. COW takes too long to implement and test, and a buggy COW on top of an otherwise working kernel is worse than no COW. Do ZFOD, ship the kernel, only revisit COW on a branch if time permits.
No floating-point variables or code - anywhere in the kernel or user-space test programs. FPU state is not managed.
No using INT instruction inside the kernel to context switch - "this approach is very expensive, structurally counterproductive, and forbidden."
Do not use only disable_interrupts() for synchronization - must use proper locking primitives (mutex, spinlock, cond) for anything longer than a few instructions. A kernel with only interrupt disabling for sync will not be preemptible and will score poorly.
vanish() must not fail due to OOM - "terminal irony": it is not acceptable for vanish() to fail because the kernel is out of memory.
Page 0x00000000 must remain unmapped - zero page must never be accessible from user or kernel code via normal means.
"Saved by the bell": spinning in a tight loop waiting for the timer interrupt to context-switch - forbidden.
"To run or not to run": putting sleeping/blocked threads in the runnable queue - forbidden.
"Yield loop": using repeated yield() to implement sleep - forbidden.
"Not now, maybe later": forbidding context switches in kernel mode - forbidden (deferring to a reasonable bound is ok, but blocking context switches entirely is not).
halt() system call must be implemented (calls sim_halt() + HLT) - grading infrastructure measures preemptibility via halt().
Shell must work end-to-end at submission.
Timer interrupt rate at submission should be ~2 ms (can vary during development).
config.mk must be correct: shell/idle/init in 410REQPROGS, tests only in 410TESTS/STUDENTTESTS. Graders mechanically edit config.mk before testing.
Normal kernel operation (load, run, exit a program) must produce ≤20 lines of kernel.log output.
getchar() stub must return -1 without crashing (not required to implement fully).
task_vanish() needs at least a fake implementation since user-space exit() calls it.
Why: These rules come directly from the "dangerous bend" warnings in kernel.pdf. Violations either cause the test harness to declare the entire suite failed, or are explicitly called out as design errors that will reduce the grade significantly.
How to apply: When suggesting or reviewing implementation strategies, check against this list first.
Table of Content