Saturday, July 22, 2006

The Life of a Computer

I sometimes think about how exciting it would be to live inside my PowerBook right when I press the power button. That may sound strange, but think about all the exciting things that happen while the computer is turning on:

Power comes coursing through from wall to power board to internal hardware. The Power On Self Test (POST) is passed and the computer chimes. Next, the BootROM, a set of hardwired instructions for the computer hardware that tell it how to start the boot process, is read, directing the processor to load and run the BootX file. BootX contains just the bare essentials of information needed to load the operating system kernel from disk into main memory, and thus begin the bootstrapping chain of events that brings the grand Mac OS X experience to life.

A picture is drawn to the user's monitor while kexts are loaded to support the kernel. Then comes the most exhilarating part of this adventure: launchd is started, the almighty root process, Process ID #1. Other background processes are spawned, daemons are brought to life, and WaitingForLoginWindow is called upon to draw its placebo progress bar. Finally, loginwindow reports that it is ready to accept interaction from the user. Startup is complete, and the world of possibilities of what can be accomplished before shutdown is endless.

No comments: