* more re-work
[mascara-docs.git] / i386 / junos / MIT / course / src / src.lab / user / idle.c
blob4ae8b51270e5fe515a25c051df6bacf1b412fb13
1 // idle loop
3 #include <inc/x86.h>
4 #include <inc/lib.h>
6 void
7 umain(int argc, char **argv)
9 binaryname = "idle";
11 // Loop forever, simply trying to yield to a different environment.
12 // Instead of busy-waiting like this,
13 // a better way would be to use the processor's HLT instruction
14 // to cause the processor to stop executing until the next interrupt -
15 // doing so allows the processor to conserve power more effectively.
16 while (1) {
17 sys_yield();