What happens when we turn on computer?

Last Updated : 31 Jul, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A computer without a program running is just an inert hunk of electronics. The first thing a computer has to do when it is turned on is to start up a special program called an operating system. The operating system’s job is to help other computer programs work by handling the messy details of controlling the computer’s hardware. 

What happens when we turn on computer?

  1. The power supply sends electricity to the components of the computer, such as the motherboard, hard drive, and fans.
  2. The BIOS (basic input/output system) initializes and performs a power-on self-test (POST), which checks the basic hardware components to ensure they are working properly. If any issues are detected, error messages may be displayed.
  3. The operating system (OS), such as Windows or macOS, is loaded from the hard drive or another storage device into the computer’s RAM (random access memory).
  4. The OS then initializes its own components and drivers and presents the login screen or desktop environment to the user.

An overview of the boot process  

The boot process is something that happens every time you turn your computer on. You don’t really see it, because it happens so fast. You press the power button and come back a few sec (or minutes if on slow storage like HDD) later and Windows 10, or Windows 11, or whatever Operating System you use is all loaded. 

The BIOS chip tells it to look in a fixed place, usually on the lowest-numbered hard disk (the boot disk) for a special program called a boot loader (under Linux the boot loader is called Grub or LILO). The boot loader is pulled into memory and started. The bootloader’s job is to start the real operating system. 

Functions of BIOS

1. POST (Power On Self Test): The Power On Self Test happens each time you turn your computer on. It sounds complicated and that’s because it kind of is. Your computer does so much when it’s turned on and this is just part of that. 

  • It initializes the various hardware devices. 
  • It is an important process to ensure that all the devices operate smoothly without any conflicts. BIOSes following ACPI create tables describing the devices in the computer. 
  • The POST first checks the bios and then tests the CMOS RAM. 
  • If there is no problem with this then POST continues to check the CPU, hardware devices such as the Video Card, and the secondary storage devices such as the Hard Drive, Floppy Drives, Zip Drive, or CD/DVD Drives. 
  • If some errors are found then an error message is displayed on the screen or a number of beeps are heard. 
  • These beeps are known as POST beep codes. 

2. Master Boot Record: The Master Boot Record (MBR) is a special boot sector at the beginning of the disk. The MBR contains the code that loads the rest of OS, known as bootloader. This complicated process (called the Boot Process) starts with the POST (Power On Self Test) and ends when the Bios searches for the MBR on the Hard Drive, which is generally located in the first sector, first head, first cylinder (cylinder 0, head 0, sector 1). 
A typical structure looks like this: 

mbr

The bootstrap loader is stored in the computer’s EPROM, ROM, or another non-volatile memory. When the computer is turned on or restarted, it first performs the power-on-self-test, also known as POST. If the POST is successful and no issues are found, the bootstrap loader will load the operating system for the computer into memory. The computer will then be able to quickly access, load, and run the operating system. 

3. init: init is the last step of the kernel boot sequence. It looks for the file /etc/inittab to see if there is an entry for initdefault. It is used to determine the initial run level of the system. A run-level is used to decide the initial state of the operating system. 
Some of the run levels are: 

  • Level 0: System Halt.
  • Level 1: Single user mode.
  • Level 2: Full multiuser mode without network.
  • Level 3: Full multiuser mode with network.
  • Level 4: user definable.
  • Level 5: Full multiuser mode with network and X display manager.
  • Level 6: Reboot.

The above design of init is called SysV- pronounced as System five. Several other implementations of init have been written now. Some of the popular implementations are systemd and upstart. Upstart is being used by ubuntu since 2006. More details of the upstart can be found here

The next step of init is to start up various daemons that support networking and other services. X server daemon is one of the most important daemons. It manages the display, keyboard, and mouse. When X server daemon is started you see a Graphical Interface and a login screen is displayed. 

4. System Configuration:
The BIOS allows the user to configure various system settings, such as:

  1. Boot order: This determines the order in which the computer checks for bootable devices. For example, if the boot order is set to “hard drive” first, the computer will try to boot from the hard drive before checking other devices such as a CD/DVD drive or a USB drive.
  2. Time and date: The BIOS stores the time and date information, which can be set and adjusted by the user. This information is used by the operating system and various applications.
  3. Hardware settings: The BIOS provides options to configure various hardware settings such as CPU voltage, clock speed, and memory timings. These settings can be used to optimize system performance, but should only be changed by advanced users with the proper knowledge.

5. Security:
The BIOS can also provide security features such as:

  1. Password protection: The BIOS can be set to require a password to access certain features or to prevent unauthorized booting of the computer. This can be useful in preventing unauthorized access to sensitive data.
  2. Secure boot: Secure boot is a feature that ensures that only trusted operating system boot loaders, drivers, and firmware are loaded during the boot process. This helps to prevent malware and other unauthorized software from running on the system.
  3. TPM (Trusted Platform Module): Some modern motherboards have a built-in TPM that provides hardware-based security features such as encryption, digital certificates, and secure key storage. This can help to protect sensitive data and prevent unauthorized access to the system.

     

     



Similar Reads

Change what happens when you shut the laptop's lid on Windows 10
We usually see the laptop going to sleep automatically when we shut the laptop’s lid. We can choose action on what the laptop should do when we shut the laptop’s lid. There are 4 options to choose from. Shut Down - As all of you are aware of this. The laptop shuts down the operating system. When you want to reuse the laptop again you need to turn o
3 min read
Largest sphere that can be inscribed within a cube which is in turn inscribed within a right circular cone
Given here is a right circular cone of radius r and perpendicular height h, which is inscribed in a cube which in turn is inscribed in a sphere, the task is to find the radius of the sphere.Examples: Input: h = 5, r = 6 Output: 1.57306 Input: h = 8, r = 11 Output: 2.64156 Approach: Let the side of the cube = aLet the radius of the sphere = RWe know
4 min read
Difference between Turn Around Time (TAT) and Waiting Time (WT) in CPU Scheduling
In CPU Scheduling, we often need to find the average Turnaround and Waiting Time with the help of Arrival, Burst and Completion Time. Let's have a brief look of them: Turnaround Time (TAT): It is the time interval from the time of submission of a process to the time of the completion of the process.The difference b/w Completion Time and Arrival Tim
2 min read
Turn Variable in Operating System
The turn variable is defined as a synchronization mechanism that is implemented in the user mode. The turn variable is also known as the Strict Alternation Approach. It is a synchronization mechanism that is implemented for synchronizing two processes. For synchronization, it makes use of a variable known as the turn variable. This approach is used
5 min read
Difference Between Lock variable and Turn variable in Operating System
In operating systems, effe­ctive and reliable synchronization me­chanisms play a vital role in managing concurrency and coordinating the activitie­s of multiple processes or thre­ads. Two essential tools for synchronization are lock variable­s and turn variables, each serving distinct purpose­s and having unique characteristics. In this article, we
4 min read
Generations of Computer
Introduction: A computer is an electronic device that manipulates information or data. It can store, retrieve, and process data. Nowadays, a computer can be used to type documents, send an email, play games, and browse the Web. It can also be used to edit or create spreadsheets, presentations, and even videos. But the evolution of this complex syst
5 min read
Concept of Comments in Computer Programming
Comments are text notes added to the program to provide explanatory information about the source code. They are used in a programming language to document the program and remind programmers of what tricky things they just did with the code and also helps the later generation for understanding and maintenance of code. The compiler considers these as
4 min read
What are Threads in Computer Processor or CPU?
Threads are the virtual components or codes, which divides the physical core of a CPU into virtual multiple cores. A single CPU core can have up-to 2 threads per core. For example, if a CPU is dual core (i.e., 2 cores) it will have 4 threads. And if a CPU is Octal core (i.e., 8 core) it will have 16 threads and vice-versa. Working: The thread is cr
2 min read
Difference between Traditional and Reactive Computer System
1. Traditional Computer System: Traditional Computer System takes the input from the user and computes the output as the function of the input. It basically computes functions of the input. A traditional computer system is one in which the computer is in control of the sequence of operations. This type of system is typically used for batch processi
5 min read
Purpose of an Interrupt in Computer Organization
Interrupt is the mechanism by which modules like I/O or memory may interrupt the normal processing by CPU. It may be either clicking a mouse, dragging a cursor, printing a document etc the case where interrupt is getting generated. Why we require Interrupt? External devices are comparatively slower than CPU. So if there is no interrupt CPU would wa
2 min read
Difference between Supercomputer and Mainframe Computer
Prerequisite - Generations of Computer Supercomputers: Supercomputers are the largest in size and the most costly computers in the world. Seymour Cray invents the Supercomputer. Supercomputers are used for large and complex mathematical computations. Supercomputer's speed is more than Mainframe computers so they can execute billions of instructions
2 min read
Security Environment in Computer Network
The system needs to be secured from various perspectives : Hardware and software of the system needs to be secured from unauthorized access. Illegal use of processors, main memory and storage devices lead to loss or destruction of data Software need to be protected so that programs are not manipulated and the data can retain its confidentiality and
2 min read
Computer Hardware
Computer hardware includes the physical parts of a computer, such as a case, central processing unit (CPU), random access memory (RAM), monitor, and mouse which processes the input according to the set of instructions provided to it by the user and gives the desired output. The computer has mainly has two major components: HardwareSoftwareIn this a
11 min read
Computer Ethics
What does the word 'ethics' mean? The dictionary defines ethics because of the moral principles that govern the behavior of a gaggle or individual. But, not every people in society need to live an absolutely moral life. Ethics are actually the unwritten code of conduct that every individual should follow. These codes are considered correct only by
10 min read
Computer Memory
A computer is an electronic device and that accepts data, processes on that data, and gives the desired output. It performs programmed computation with accuracy and speed. Or in other words, the computer takes data as input and stores the data/instructions in the memory (use them when required). After processes the data, it converts into informatio
9 min read
Computer Security Threats
Computer security threats are potential threats to your computer's efficient operation and performance. These could be harmless adware or dangerous trojan infection. As the world becomes more digital, computer security concerns are always developing. A threat in a computer system is a potential danger that could jeopardize your data security. At ti
6 min read
Types of Computer Networks
Internet is a global network comprised of smaller networks that are interconnected using standardized communication protocols. With the help of the internet, we can communicate in any part of the world, access any kind of information, and do a lot more. The first workable prototype of the Internet was found in the late 1960s when the U.S. departmen
7 min read
Generations of Computers - Computer Fundamentals
Generations of Computer: The modern computer took its shape with the arrival of your time. It had been around the 16th century when the evolution of the computer started. The initial computer faced many changes, obviously for the betterment. It continuously improved itself in terms of speed, accuracy, size, and price to urge the form of the fashion
9 min read
Unicode in Computer Network
Unicode is a universal encoding system to provide a comprehensive character set and was created by the Unicode Consortium (a group of multilingual software manufacturers). Unicode simplifies software localization and improves multilingual text processing. It overcomes the difficulty inherent in ASCII and extended ASCII. Unicode has standardizes scr
4 min read
What is a Computer Virus?
A computer virus is a type of malicious software program ("malware") that, when executed, replicates itself by modifying other computer programs and inserting its code. When this replication succeeds, the affected areas are then said to be "infected". Viruses can spread to other computers and files when the software or documents they are attached t
9 min read
Types of Computer Ports
Ports are nothing but it is connections between external and internal input/output devices such as keyboards, mice, mouse, Disk Drive, and many more with motherboards using cables. That allows to communicate between external devices or peripherals with a laptop or computer. Computer ports may be virtual or physical. In this article, we are going to
7 min read
What are the Uses of Computer in Business?
Computers perform many types of tasks, store retrieve, and process information. A computer can create documents, send/receive emails, browse information online, and play video games. In this article, we will learn how computers can help us in business. Computer in BusinessComputers have become a part of modern Business tasks, transforming how organ
4 min read
What is Computer Networking?
Computer networking is like having a group of friends who all have phones and can call or text each other. In computer networking, instead of phones, we have computers and instead of phone lines, we use cables, Wi-Fi, or other methods to connect them. When computers are connected to a network, they can share information and resources, like files, p
15+ min read
Most asked Computer Science Subjects Interview Questions in Amazon, Microsoft, Flipkart
This article contains a list of most asked questions from Operating Systems, Computer Networks and DBMS in the interviews of the top product based companies like Amazon, Microsoft, Flipkart, Paytm etc.  Operating System: Process Introduction What is a microprocessor?Explain the internal architecture of a RAM.How compiler compiles the interlinked li
3 min read
Computer Security - Overview
Computer security refers to protecting and securing computers and their related data, networks, software, hardware from unauthorized access, misuse, theft, information loss, and other security issues. The Internet has made our lives easier and has provided us with lots of advantages but it has also put our system's security at risk of being infecte
9 min read
Cache Memory in Computer Organization
Cache memory is a small, high-speed storage area in a computer. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various independent caches in a CPU, which store instructions and data. The most important use of cache memory is that it is used to reduce the average time to
9 min read
CBSE Class 11th Computer Science Unit 2 : Computational Thinking and Programming - I
In Python for Class XI, you'll explore the fundamentals of programming with Python, tailored specifically for Class XI students. This article breaks down key concepts such as variables, loops, and functions, making it easy for you to grasp the basics of coding. Whether you're starting from scratch or looking to solidify your understanding, this gui
15+ min read
Operating System Tutorial
An Operating System(OS) is software that manages and handles the hardware and software resources of a computer system. It provides interaction between users of computers and computer hardware. An operating system is responsible for managing and controlling all the activities and sharing of computer resources. An operating system is a low-level Soft
7 min read
Python Program to Check Prime Number
Given a positive integer N, the task is to write a Python program to check if the number is Prime or not in Python. Examples: Input: n = 11Output: TrueInput: n = 1Output: FalseExplanation: A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. The first few prime numbers are {2, 3, 5, 7, 11, ….}. Py
7 min read
Types of Operating Systems
An Operating System performs all the basic tasks like managing files, processes, and memory. Thus, the operating system acts as the manager of all the resources, i.e. resource manager. Thus, the operating system becomes an interface between the user and the machine. It is one of the most required software that is present in the device. Operating Sy
11 min read