Master the fundamental concepts of instruction set architecture through this focused micro-challenge.
Privileged instructions touch CPU state ordinary programs must not control: page tables, interrupt masks, model-specific registers, and I/O ports. Attempting them in user mode traps to the kernel.
Examples across architectures:
WRMSR, LGDT, IN/OUT (when IOPL blocks)MSR to system registers, WFICSRRW, SFENCE.VMA, MRETcLoading…
Without privilege levels, any process could remap memory, disable interrupts, or hijack devices. Operating systems rely on ring transitions (syscall, interrupt) to enter supervisor mode safely.
For this exercise, you will classify a list of mnemonics as user-safe or supervisor-only and explain what each privileged op controls. This task asks you to connect ISA privilege bits to the protection model your OS track will build on top of.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Explore privileged instructions and understand why they're restricted.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github