The boot process takes a few seconds to a few minutes, and typically checks memory and other hardware devices. The boot process can be customized by the user to do extra things on startup, like check for mail. Because certain data on file changes kept in memory while running the operating system, these must be written to disk before powering off the computer. To prevent your files from being messed up, you must exit or shutdown Windows before hitting the power switch. The operating system is responsible for system security - making sure that only authorized users are allowed access to certain files.
Security is particularly important in multiuser or network machines.
Typically, security is implemented using accounts and passwords. They must be long enough that a computer cannot try all of them by brute force. The resources controlled by the operating system can be accessed in three typical ways. The command language is typically clunkier to use than GUI, but more powerful for certain things. Differences in the system calls are another reason why Macintosh programs cannot run on Windows, etc.