TODAY -

Windows/Linux Booting process
- Part 1 -

sinuxs *



There're lot of interesting (for me; i don't know for others) things hapenning under the hoods of a computer, a fraction of second after we press the power button (to start the computer). The decription explained here is a gleam of my experience on my own machine and from other sources; and is taken Intel(including AMD) as an example.

While the PC architecure is open since its inception in the early 80s, the explanation here is assumed to be consistent for my machine but may possibly be inaccurate for other. However, one can take a general perception though.

When you press the power button, the AC current from your wall socket surges into your power supply (or adapter, in case of laptop) and gets converted into various DC supplies which are eventually fed into the Motherboard and its various hardware components. This is where your computer is ready to start off. Your computer at this stage is suffering from 'Amnesia'- Loss of memory.

It doesn't remember anything which was happened before your last shutdown. you can blame(or flame?) it to the non-volatile nature of the RAM sticks! As this is so, it has to start loading the OS to run any user applications.

The next obvious question is - what is the first address the CPU accesses when your computer is started for the first time? Depends on the architecture. For the Intel(x86 from now on) architecture, the designer has been hardcoding the intial address to be : 0xFFFFFFF0 (reset vector), which is just a 16 byte down the 4GB. This address contains a JUMP to the first instruction of BIOS which is located at the last 64K segment of the first 1MB.

Why a JUMP? Is this necessary or is it that the Intel designers are a JUMPER . It's necessary because the x86 computer following a restart starts from 16 bit processor called 'Real mode' which sees only 1MB of memory space. And you may logically asks me how the CPU starts first with the address '0xFFFFFFF0'(see above) in this 1MB restricted mode.

Again, blame on to the Intel designers. They hardwired all the x86 procesors to anyhow starts the computer with this exceptional protected mode address. A protected mode is the full 32 bit processor with the 4GB address space. Coming to the point, we need a JUMP so that the CPU will restrictively operate in real mode and hence points to the last 64K segment of the first 1MB memory. The BIOS loads there so that the CPU will always execute the BIOS code following a restart/power-on of a computer.

Now, after the JUMP, the control (of execution) will go to the first instruction of BIOS and from now on, BIOS will take the control of execution. If you ask me why only the 1MB address space in real mode, I would say this time to blame on Intel(Early PC) and Microsoft(DOS). Actually, it's not their faults. During the early 80's when the PC was introduced, 1MB of memory was just unthinkabl!y and unanimously a huge memory then and had taken off with the decission.

The intention was to divide the 1MB address space into 16 segments of 64k bytes. We called them as the 16 segments of real mode. The Intel/Microsoft strategy was to allocate the first 10 segments (10*64k = 640K) called a 'conventional memory' to user programs and DOS and the remaining 6 segments(6*64k = 384K) to BIOS and BIOS areas. The last segment (16th segment) is the BIOS area where the computer first jumps into following a computer restart.

The last 6 segments of the real mode cannot be accessible even to DOS and other user programs and hence we could say that there is a HOLE in the first 1MB address space from 640K to 1023K (1MB). Somebody has rightly said this as the infamous 384K HOLE of real mode. A memory hole, in general, is a region of physical memory where an OS cannot allocate it to a user application. They can be because of the above ROM BIOS mapping or because of I/O device mapping.

I/O devices like Video RAM are often mapped into the physical RAM for effeciency purpose(through ioremap() in Linux kernel) and these are treated as 'Reserved' and hence treated as a 'HOLE' regions.

Now, let's come to the booting process. We jump into the BIOS code post restart. The BIOS code, as we're refering currently, is the Motherboard BIOS which comes with a chip embedded on it. It consists of POST code and 16bit drivers of all legacy hardware components - Keyboard, Mouse, Disk, various controllers and a setup-program called CMOS/BIOS setup. A computer system also has other BIOS code coming in along with Adapter cards like Video card, SCSI controller etc.

Motherboard BIOS has roughly the following responsibilites:-
= Execute other BIOS code(Video BIOS, SCSI BIOS etc), if present and as and when required.
= Check whether the booting is 'Cold boot' or 'Warm boot'.
= POST (Power-On Self Test) - Detecting, Initializing hardware components.
= IVT(Interrupt Vector Table) Setup - Loading 16 bit BIOS drivers. (part of POST)
= Allows the user to configure the BIOS setting through CMOS/BIOS editor utility.
= Displays the available final hardware settings - CPU, Memory, PCI controllers, SCSI controllers etc.
= Read the bootable disks. Load the first sector of the boot disk and pass on the control to it.

Running other BIOSes (Adapter's):
= The first of the activities done by the Motherboard(main) BIOS is to jump into the video BIOS code. This is when the screen shows the BIOS manufacturer Logo(Phoenix, in my case) and telling you that the video adapter is initializing and off course is workng properly!

The main reason the adapter card(like Video card/controller) has their own BIOS is probably the way to extend the main BIOS code and may be for some other extra features, the manufacturers(of the cards) want to initiate while the card is initialized with. How did the main BIOS finds the locations of other adapter's BIOS? The x86 architecture insists the adapter card manufacturers to map their BIOS from 0xC000(12th segment) to 0xF0000(15th segment).

The 16th segment, as mentioned earlier, is for the BIOS(main) code. The main BIOS starts looking for other adapter's BIOS from 0xC000. The main BIOS starts looking from this address a signature "0xAA55" for every 2K bytes successively till 0xF0000.The signature, if there, identifies that the segment is an adapter's BIOS. The following byte after this signature will give the size of the BIOS in 512 bytes chunks.So,the main BIOS will start looking for this signature for the video BIOS code at 0xC0000. It jumps into it and initializes the video card and all those logo (Energy),BIOS manufacturer details, CPU vendor and speed, Memory size etc. are shown up.

This is the first phase of POST. Once the video BIOS is executed, the control comes back to the main BIOS code. POST (Power-On Self Test): = POST test (a black screen at the computer startup) is done to find and initialize the hardware components(Physical drives, RAM, CD/DVD drives, Expansion slots, Keyboard, Mouse etc) so that an OS can be loaded. It consists of various POST tasks and any one of them fail would bring down the system. The error code of, if any of them is failed, will be written to '0x80h'(this is for Phoenix BIOS - mine. you may see your BIOS manufacturer datasheet to verify the same).

The error handler of the POST routine will decode the error codes and send to the display(if video adapter is working) or into a beep codes. Some of the POST tasks are mentioned below:-
- Initialize CPU registers
- Initialize I/O component
- Initialize the local bus IDE
- Initialize Power Management
- Initialize PCI Bus Mastering devices
- Initialize keyboard controller
- 8254 timer initialization
- 8237 DMA controller initialization
- Reset Programmable Interrupt Controller
- Test DRAM refresh
- Test CPU bus-clock frequency
- Advanced configuration of chipset registers
- Initialize interrupt vectors
- Initialize hard-disk controllers
- Set up Power Management
- Initialize the chipset
- Initialize the CPU
- Initialize PCI and DMA

You may check your BIOS manaufacturer manual for finer detail on the possible POST activitied from the error codes your BIOS is hardcoded.

One of the important functions done during POST is the initialization of IVT (Interrupt Vectore Table). The IVT is an array of 4 bytes pointers to interrupt routines. There is 4bytes for each IVT entry because the first 2bytes will give the segment address and the remaining two bytes will give the offset in the segment.

There are 256 interrupts define for real mode and hence the first 1024bytes (256*4) is occupied by IVT. You cannot press 'F2' or 'DEl' or 'F10' to enter the BIOS configuration without this IVT setup. The pressing of keystroke (will invoke IRQ1) fires the keyboard driver and displays the BIOS/CMOS configuration utility. Hence,

IVT setup is necessarily done before the computer displays something like, "Press 'F10' to enter BIOS/CMOS" etc. When all hardware components are set and proper, the BIOS code will determine the boot-disk sequence from the CMOS RAM. Well, before going further, let's go into a little bit about CMOS/RAM. CMOS/RAM is a chip comprises of RTC (Real Time Clock) and a RAM.This chip is powered by a button-like baterry. The CMOS chip is consuming a very low power(CMOS technology) that a battery can power it upto a maximum of 5-10 years.

With this battery,your computer can remember all the hardware components configurations and most importantly the date and time of the day. There are two parts of CMOS/RAM - user configurable data and static hardware configuration data. The user configurable data is the one we can change by pressing 'DEL' or 'F10' or 'F2' (depends on your BIOS manufacture). Here, you can change the booting sequence, master/secondary slave of IDE controller, change the date/time and some other parameters.

The other part of CMOS/RAM contains the non-changeable data of your hardware components like - the type of hard disk, the type of RAM(SDRAM, DDRAM,RDRAM etc), keyboard/mouse type,video display type(MDA/CGA/VGA etc) to name a few. The BIOS during its POST activity needs to know the type of your hardware to properly called its corresponding driver and probing as to whether it's correct or not. Any inconsistency with the hardware information present in CMOS/data and what's actually found after probing will halt the POST process.

In a sense, what we can conclude with this CMOS/RAM information is that there's a fair chance your computer will not boot properly if there's a problem in your button-battery causing the loss of CMOS/RAM data and ultimately (your) BIOS will not continue its POST activities. Now, coming to booting procedure, the BIOS after POST, will keep on searching a bootable disk from the sequence and load the first one which is found.

How does the BIOS code determines a bootable disk? Good question. A disk having a magic number "0xAA55" at the end of its first sector is a bootable disk. So, every bootbale disk will have this signature at the end of their first sector and this is how a BIOS knows and displays "No bootable disk ..." in the absence of any bootable disk or when a bootable disk drive is corrupted.

(Next: Windows vs Linux booting)
Linux kernel is an addict. Hardware is the driver of its existency. Join the community to make this open-source kernel, the best of its kind, as it is and for will be in the future.

Sign-off,
A Kernel junky.


* sinuxs (A pseudonym and a "kernel junky" ) contributes to e-pao.net regularly. The writer can be contacted at sinuxs(at)yahoo(dot)com
This article was webcasted on November 16th, 2009.




* Comments posted by users in this discussion thread and other parts of this site are opinions of the individuals posting them (whose user ID is displayed alongside) and not the views of e-pao.net. We strongly recommend that users exercise responsibility, sensitivity and caution over language while writing your opinions which will be seen and read by other users. Please read a complete Guideline on using comments on this website.




LATEST IN E-PAO.NET
  • Scientist of Manipur: Amom Ruhikanta
  • Violence in Manipur 2023-2024 : Timeline
  • Conspiracy, thy name is Kuki !
  • "ST status for Meetei" at Thounaojam
  • Ket Meth New Album "Ghost Stories"
  • World Hypertension Day
  • International Day of Families
  • Let the rule of law prevail
  • When donation becomes obligatory demand
  • Tourism of Manipur through Gastronomy
  • Beyond Eternity :: Poem
  • Patriarch subjugation on women
  • Celebrate Manipuri Cinema shine at Cannes
  • Training on cultivation of various mushroom
  • Transformative impact of Ayurveda & Yoga
  • War for over a year : Delhi is answerable
  • The logic behind illogical chargesheet
  • Preserving Thang-Ta :: Rare Photos
  • Regarding Human Rights Situation in Manipur
  • World Hypertension Day 2024
  • Article 355 of Constitution of India #3
  • Disinformation campaign touba thengnarey
  • Deeply mourn the demise of Oja Biren Lamba
  • Water Mimosa for sustainable development
  • Publicity drives of educational institutions
  • ED's revolutionary move!!!
  • Malemnganbi Laishram : Science Topper
  • Featured Front Page Photo 2024 #2: Gallery
  • Thokchom Sheityajit : Arts Topper
  • Aiena Naorem : Commerce Topper
  • AISSE 2024 Exam Result- RKM Imphal
  • Gold, new world currency !
  • Milk for hair and skin
  • Of illegal immigrants & the larger picture
  • The missive from Kamjong
  • Hr Secondary Exam 2024 : Science Topper
  • HSE 2024 : Subject Pass Percentage
  • HSE 2024 : District Pass Percentage
  • HSE 2024 : Candidates with Highest Marks
  • Hr Secondary Exam 2024: Science Full Result
  • Hr Secondary Exam 2024: Arts Full Result
  • Hr Secondary Exam 2024: Commerce Result
  • Hr Secondary Exam 2024 : Arts Topper
  • Hr Secondary Exam 2024 : Commerce Topper
  • Sezo Ringa- Debut Music Video "Revival"
  • Journalism - A thrilling career #2
  • After Class XII where? The eternal question
  • Entry of Arvind Kejriwal
  • Birth Centenary of Jananeta Irabat, 1996 : #1
  • Our nurses, our future: Power of care
  • Screenplay Writing course concluded
  • Workshop on IP & Patent Filing held
  • Let there be less Politics in Sports
  • Sam Pitroda is absolutely white
  • Motherhood: Soul & spirit of family & society
  • Time has come to criminalise ecocide
  • Meiteis, a disappearing community in Manipur
  • World Bamboo Congress @Taiwan : Gallery
  • Ima Manipur should smile more
  • 2nd National Lok Adalat at High Court
  • The Power of Poppy - 30 :: Poem
  • Army impact on Tamphasana Wushu odyssey
  • Aftermath of ferocious hailstorm #1 : Gallery
  • "Dynamic library service" :: Book Rvw
  • Radio E-pao: Manipuri Film OST (130+ song)
  • Artificial Intelligence & Environment
  • Article 355 of Constitution of India #2
  • Integrated Farming Systems for farmers #4
  • Delhi's stand after 1 year of clash
  • A new type of terrorism
  • Scientist of Manipur: Waikhom Vishwanath
  • SRF, JRF, RA @ Assam University
  • The Bleeding River :: Poem
  • Executive Meeting of WMC Assam Unit
  • Journalism - A thrilling career #1
  • Raising the call to replace Minister
  • A storm in a political teacup
  • Cheirao-chingkaba @ Chinga : Gallery
  • Happy Mother's Day
  • Empowering hill communities via U-Mangra
  • African Swine Fever
  • Free Training on Mushroom at Nagamapal
  • Harshit Dhingaun recieves award from Korea
  • Look for ways to restore normalcy
  • The danger of last kicks of a dying horse
  • Preserving Thang-Ta traditions
  • Resolving ST issue by democratic process
  • Top 5 songs to awaken your inner patriot
  • Project Assistant @ Manipur University
  • Leishemba Sanajaoba conferred Doctorate
  • Double tragedy: No time for red-tapism
  • A Youtuber called Dhruv
  • Nupi Landa Thaunaphabishing : Full Book
  • 174th Anniv Maharaj Narasingh #2 : Gallery
  • Challenges in Healthcare in rural Manipur
  • A salute to leadership quality of PM Modi
  • Career in press for freedom of expression
  • One day after devastating hailstorm
  • Understanding the suffering of others
  • A ferocious hailstorm @Imphal : Gallery
  • Article 355 of Constitution of India #1
  • Integrated Farming Systems for farmers #3
  • Election gossip & rumours
  • 'Melodic Minds' Tour in Guwahati
  • Leaving a trail of destruction
  • Political see-saw
  • A brand-new Scientific discovery
  • In memoriam of the happiness we shared !
  • Crop/animal for higher productivity in NE #5
  • "ST status for Meetei" at Sekmaijin
  • Oh Motherland :: Poem
  • Animal life should be treated with dignity
  • '365 Days of Chin-Kuki Aggression' : Gallery
  • Renaissance of politics in our youth
  • TB & tobacco co-epidemics in Indonesia
  • The Power of Poppy - 29 :: Poem
  • Advanced Charging Infrastructure in NE
  • Lessons learnt in the last one year
  • True colour of politics
  • World Heritage Day @ MU : Gallery
  • "ST status for Meetei" at Kakwa
  • Joint Combing Operations in Jiribam
  • Reboot PSUs for jobs: Task for new Govt
  • Ayurvedic remedies to keep healthy eyes
  • May 3, 2023 to May 3, 2024
  • One year of crisis, and what next ?
  • Scientist of Manipur: Nongmaithem Rajmuhon
  • Whither social justice & work for women?
  • Taiwan to enhancing economic ties with India
  • Integrated Farming Systems for farmers #2
  • Athoubasingi Numit #2 : Gallery
  • Privilege trap of While Male Meitei
  • Crop/animal for higher productivity in NE #4
  • 'Chizami Model' working in Gujarat ?
  • Racing towards the one year mark
  • On misattribution & falsifying history
  • Nupi Landa Thaunaphabishing #15 :: Book
  • May Calendar for Year 2024 : Tools
  • 12th World Bamboo Congress at Taiwan
  • Complex dance of democracy in Manipur
  • "ST status for Meetei" at Pangaltabi
  • Integrated Farming Systems for farmers #1
  • Showing ugly face of muscle power
  • Spare the rod, spoil the monster
  • Descent of Radha-Krishna #31: Download
  • Socio-Historical analysis on Ethnic Conflict
  • "ST status for Meetei" at Langmeidong
  • Ngangbam Dipapati- Gold @European Cup
  • Crop/animal for higher productivity in NE #3
  • Fresh surge in violence
  • The real culprit
  • National Science Teacher workshop
  • Livelihood Disaster in Mapithel Region
  • Condemns Killing of CRPF Personnel
  • "ST status for Meetei" at Manipur College
  • Huidrom Oliviya: Silver @Cadet European Cup
  • Election: Runner-up may spoil the joy
  • Scientists of Manipur : Laishram Ladu Singh
  • Imphal Ring Road Project to Transform
  • Crop/animal for higher productivity in NE #2
  • The Power of Poppy - 28 :: Poem
  • Condemned unabated illegal taxation
  • Watermelon : Super nutritious summer fruit
  • People have spoken, Manipur has voted
  • Skirting around core issues
  • Lok Sabha polls in Manipur #2 : Gallery
  • The Taj Mahal that bans Lovers !
  • Importance of bees !
  • Massive hailstorm in Jiribam
  • The messiah of hapless children
  • Attack on fuel tankers & blasting bridge
  • Blame it on Meetei
  • The Happiness Code : Download
  • NH-2 Bridge bombed @Sapermeina : Gallery
  • Crop/animal for higher productivity in NE #1
  • Training Programme under SPARK concluded
  • Why environment control is so difficult
  • 4th Foundation Day- Young Minds Collective
  • All set for second phase poll
  • The Nongsaba phenomenon
  • Khongjom Day @Khebaching #1 : Gallery
  • India's responsibility to end Manipur violence
  • Migrant worker could access TB services only
  • Importance of reading magazines as student
  • SHG pioneering agricultural innovation
  • Nearing the one year mark
  • The enemy within
  • Id-ul-Fitr @Hatta #2 : Gallery
  • Workshop @ NSU Manipur : Gallery
  • 15th Manipur State Film Awards 2023
  • "ST status for Meetei" at Panthoibi Shanglen
  • GSDP doubles, health shines
  • Vote has been cast, repoll held
  • Two faces of democracy
  • Laurels for Scientist Ngangkham Nimai
  • Crime against women in Manipur
  • "ST status for Meetei" at Sugnu
  • Creativity & innovation for vibrant career
  • 4th Foundation Day of YMC
  • Racing towards one year mark
  • Prophetic words, indeed
  • Nupi Landa Thaunaphabishing #14 :: Book
  • 174th Anniv Maharaj Narasingh #1 : Gallery
  • Ensuring Fair Voting in Hills of Manipur
  • Dr Irengbam Mohendra's latest book :: Rvw
  • NDA has the advantage in both
  • Lok Sabha polls in Manipur #1 : Gallery
  • L Rup's Robot 'Kangleinganbi' in Manipuri
  • Art- means of connecting hearts in Manipur
  • Is it Living Alive or Living Death ? :: Poem
  • Rabies - A preventable zoonotic disease
  • April 19, 2024: The blackest day of all
  • Ugly turns on voting day
  • Children Camp @JNMDA Imphal #2 : Gallery
  • The chasm between TB & HIV continues
  • Parliament and its Members
  • Kimchi for health and glowing skin
  • LS election with a difference
  • To vote, or not to vote ?
  • Sajibu Cheiraoba Chak Katpa #2 : Gallery
  • Scientists of Manipur : Laitonjam Warjeet
  • Community seed bank @Umathel : Gallery
  • Saving Manipur
  • Sajibu Cheiraoba: 1 occasion, 2 narratives #2
  • Athoubasingi Numit #1 : Gallery
  • Id-ul-Fitr @Hatta #1 : Gallery
  • 80th Anniv- Battle of Kanglatongbi @UK
  • Hun - Thadou Cultural Festival : Gallery
  • Scientists of Manipur : Ngangkham Nimai
  • Sajibu Cheiraoba Chak Katpa #1 : Gallery
  • Beating of the Retreat #1 : Gallery
  • Kenedy Khuman (Singer) : Gallery
  • Students @ Class X Exam : Gallery
  • Save Manipur : Protest [Feb 15] #3 : Gallery
  • GHOST of PEACE :: Download Booklet
  • List of Kings of Manipur: 33 - 1984 AD