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
  • Konung Kang Chingba #1 : Gallery
  • Violence in Manipur 2023-2025 : Timeline
  • Manipur Iskcon's 25th Ratha Yatra 2025
  • Native Threshing machine made for farmers
  • COVID-19: Update 04 July 2025 : Manipur
  • Riso Ejang: Youth-led Transformation
  • Include males too in addressing HPV
  • Whispers from the past :: Poem
  • LPU opens permanent outreach centre
  • Raj Bhavan moving on the right track
  • Speculations over PM Modi's visit to state
  • Colonial Knowledge Production in NE #7
  • Make Yourself Visible to Opportunity
  • Orange bowl: tradition with ecological wisdom
  • 10 ways to keep a kitchen garden disease free
  • Between PR, military mandates & AFSPA
  • Allocation fund for MLALAD Fund during PR
  • Denounces Killing of KNA Deputy C-in-C
  • COVID-19: Update 03 July 2025 : Manipur
  • Cases of fake Aadhaar cards
  • Sincere dealing must for stricter Aadhaar
  • Archaeology: Culture of Manipur : Booklet
  • Wanna be a singer? Get Botox
  • A Central institute in Manipur
  • Nagging in the name of love
  • COVID-19: Update 02 July 2025 : Manipur
  • 'Benefits' of Indira's Emergency
  • Social Stigma :: Poem
  • Inking a peace pact: Why, how: SoO quagmire
  • Van Mahotsav under shadow of declining forest
  • 11th Th Kishan Memorial Lecture : Gallery
  • Shinthoibi, Jangvei, Tamphaton : eMing
  • Manipur crisis & the Left media's blind spot
  • COVID-19: Update 01 July 2025 : Manipur
  • Bombom RK : Musclemania Universe NYC
  • The Grief :: Poem
  • Music Concert & Quiz (MCQ) 2.0
  • SoO agreement unlikely to be scrapped
  • Regulating use of plastic carry bags
  • Mera Houchongba @Kangla #4 : Gallery
  • International Day of Yoga @JNMDA : Gallery
  • BD Behring: The inimitable Gentleman I knew
  • Violence in the name of patriotism : Misguided
  • Daily oral vs long-acting injectable for HIV
  • COVID-19: Update 30 June 2025 : Manipur
  • Smile :: Poem
  • Why was President's Rule imposed ?
  • BJP under pressure to forge unity
  • Kang @Leikai in Imphal : Gallery
  • July Calendar for Year 2025 : Tools
  • COVID-19 : A recurring crisis in Manipur
  • DC Kaith and Forestry in Manipur : Book
  • COVID-19: Update 29 June 2025 : Manipur
  • Longing for Peace :: Poem
  • Black badge, slogan protest by peeved scribes
  • Present the true picture before Delhi
  • Pung-Cholom @ Polo Tournament : Gallery
  • Life: A Journey Through Thought & Being
  • Khongjai Hills & Kuki claim to indigeneity
  • Master Time by Managing Information
  • COVID-19: Update 28 June 2025 : Manipur
  • Pride & patriotism in CCpur's army families
  • The Power of Poppy - 87 :: Poem
  • World Decarbonisation Day: green environment
  • Welcome Home - Nganthoi #2 : Gallery
  • Loss of two precious lives from Manipur
  • Balancing civil liberties with public safety
  • COVID-19: Update 27 June 2025 : Manipur
  • Gender equality & human rights are indivisible
  • Stay hydrated this summer season
  • Silent Half of the Sun :: Poem
  • Connecting the dots in the wishlist
  • Assembly record tampering claims by ex-CM
  • The immortal legacy of Pukhramba Kajao
  • International Day against Drug Abuse 2025
  • COVID-19: Update 26 June 2025 : Manipur
  • Black pottery from Ukhrul - tribal heritage
  • Program on "Mission-Drug Free Campus"
  • Play makes a better world
  • Urgent Appeal to the Honourable MLAs
  • Tribal Empowerment Campaign at CCpur
  • Talk doing the round: PM to come
  • 'Emergency' relief for under-fire BJP
  • Golden Jubilee Art Fair @Imphal : Gallery
  • Declaration: Meetei People Convention, Delhi
  • A Flower Among the Rocks :: Review
  • Book Donation Campaign
  • Improved road connectivity boosts livelihoods
  • To Have Great Dreams :: Poem
  • COVID-19: Update 25 June 2025 : Manipur
  • Regret vs Sorry: Technical & moral insight
  • Cocktail of inept Govt, selfish people
  • State trailing others in cleanliness
  • Colonial Knowledge in NE India #6
  • UHI effect & rising temperatures in Manipur
  • Frequent road blockades cripple economy
  • COVID-19: Update 24 June 2025 : Manipur
  • Unite Health with Community health services
  • NSU, Imphal, tops IIRF Ranking 2025
  • Endless conflict :: Poem
  • Pak nobel pish prize for Trump
  • May 3, 2023 - June 24, 2025: Failure of Delhi
  • Hotter days, sudden rainfall no more a rarity
  • "The Great June Uprising" #2 : Gallery
  • How to Build a Career, Lead with Purpose
  • 2nd Foundation Day- Karnataka Meitei Assn
  • COVID-19: Update 23 June 2025 : Manipur
  • NSCN-IM Amnesty threatens to isolate it
  • Sunset :: Poem
  • Intl Yoga Day for a healthier environment
  • Of clogged drains and plastics
  • Poor roads testify Govt indifference
  • Welcome Home - Nganthoi #1 : Gallery
  • The Silent Erosion of Manipuri Language
  • Design health services around people
  • Serene Hills Host Inspiring Int'l Yoga Day
  • COVID-19: Update 22 June 2025 : Manipur
  • Chopper services between Senapati & Imphal
  • High Court Judges interacted with convicts
  • Redyeing the Fabric :: Poem
  • Differences yet to be resolved stand
  • Border fencing rage as solution eludes
  • Radio E-pao: 14 new songs updated
  • Climate Adaptive Agroforestry
  • Manipur overlooked demographic shifts
  • Young designers shine on Fashion Stage
  • COVID-19: Update 21 June 2025 : Manipur
  • International Day of Yoga at Lamphelpat
  • International Day of Yoga at JNMDA
  • The Power of Poppy - 86 :: Poem
  • Keishampat Lairembi Haraoba #1 : Gallery
  • Crisis in Manipur's Contemporary Education
  • Best 8 Performances in Manipuri Cinema
  • Identity: Caught between China & India ?
  • COVID-19: Update 20 June 2025 : Manipur
  • To The Father Who Listens :: Poem
  • How does net suspension affect youths ?
  • Targeting farmers to cripple state's economy
  • The virus is back and spreading
  • Who is afraid of Manipur ?
  • A threatened lily growing at Shirui Hills
  • World Environment Day in Manipur : Gallery
  • Ambubachi Mela at Maa Kamakhya
  • COVID-19: Update 19 June 2025 : Manipur
  • Dolls made from repurposed vegetable refuse
  • Condemns Attack on Farmer & Killing
  • Abhorrent politics of SoO
  • Police arrogance on harmless drivers
  • "The Great June Uprising" #1 : Gallery
  • Solution from Buddhist & Jain perspectives
  • AI sparks employment concerns in Manipur
  • Greatest Foe :: Poem
  • Chief Justice at Relief Camp, Kangpokpi
  • Call for Recognition of a 3rd Category of IDPs
  • Jun 18, 2001- May 3, 2023: Seed of violence
  • Contract scam in hill districts
  • Colonial Knowledge in NE India #5
  • Spaced Out - Panthung Di Kadaaida! : Rvw
  • Condemns the Killing of Abdul Qadir
  • COVID-19: Update 17 June 2025 : Manipur
  • Thoubal aspirant makes Manipur proud
  • Tamenglong hospital brings quality healthcare
  • Chief Justice at Relief Camp, Mayang Imphal
  • Kuki CM & Sixth Schedule
  • Selective protests, selective silence
  • Nailing the culprits need of the hour
  • UK Meetei diaspora run for Myanmar : Gallery
  • Erwin Khundrakpam : NEET-UG 2025 topper
  • Will we rise to #endAIDS challenge or stumble
  • COVID-19: Update 16 June 2025 : Manipur
  • Appeal to Prime Minister: Manipur Crisis
  • Urges Action on Misinformation
  • Condolences : 2 young cabin crew
  • Grateful To Be Alive :: Poem
  • Making bonfire on the roads
  • Aggression yet again, inspite of playing victim
  • Aftermath of flooding @ Khurai #2 : Gallery
  • Zomia, geopolitics, & the struggle for unity
  • COVID-19: Update 15 June 2025 : Manipur
  • Condolences : Demise of 2 Manipuri Girls
  • Manipur unites in grief after Air India tragedy
  • Hail arms recovery as step toward peace
  • Cleanliness Drive at JNIMS Campus
  • Global Wind Day for a clean environment
  • First came the rain, then the heat
  • Rise in Covid-19 cases
  • Thang-Ta Day @Khuman Lampak #3 : Gallery
  • Meetei diaspora in UK runs for Myanmar victim
  • Manipur empower children with disabilities
  • COVID-19: Update 14 June 2025 : Manipur
  • World Blood Donor Day 2025
  • The Power of Poppy - 85 :: Poem
  • A Northeast Gin Makes Its Mark
  • Mera Houchongba @Kangla #3 : Gallery
  • Saluting Nganthoi, Lamnunthem : Joining hand
  • Condolence : Nganthoi & Lamnunthem
  • 50 years of Pebet #2 : Gallery
  • Indo-Naga Talks (From 2012) :: Timeline
  • Colonial Knowledge in NE India #4
  • Namphake Monastery @ Dibrugarh : Gallery
  • Protest @Checkon -AT arrest [Jun 9] : Gallery
  • Protests - AT arrest [Jun 8 night] : Gallery
  • Aftermath of flooding @ Khurai #1 : Gallery
  • /li>
  • Flooding at JNIMS Hospital #2 : Gallery
  • North East NSS Festival @ MU : Gallery
  • 27th Meira Paibi Numit : Gallery
  • Trump's tariff legacy & its global echo
  • Flooding at JNIMS Hospital #1 : Gallery
  • Flooding Imphal East [31 May] #3 : Gallery
  • Flooding Imphal East [31 May] #2 : Gallery
  • Flooding Imphal East [31 May] #1 : Gallery
  • S Nirupama @Miss Universe : Gallery
  • Protesters to Raj Bhavan [May 25]: Gallery
  • Human Chain @Airport road [May 26]: Gallery
  • Miss Shirui Pageant Contestant: Gallery
  • 48 hrs Bandh: protest security forces: Gallery
  • Protest Rally: Journalist harassment: Gallery
  • HSLC 2025: Full Result (Check Roll No)
  • HSLC 2025: Important Info & Grading System
  • HSLC 2025 : Compartmental candidates
  • HSLC 2025 : Comparative Statement
  • HSLC 2025 : Statistical Abstract
  • HSLC 2025 : District Pass Percentage
  • HSLC 2025 : Govt School Pass %
  • HSLC 2025 : Aided School Pass %
  • HSLC 2025 : Private School Pass %
  • People's Convention on 3rd May #2 : Gallery
  • Featured Front Page Photo 2025 #2: Gallery
  • Riya Khwairakpam : HSE Science Topper
  • Keisham Hannah : HSE Arts Topper
  • Warepam Lidia : HSE Commerce Topper
  • HSE 2025 Result : Science Full Result
  • HSE 2025 Result : Arts Full Result
  • HSE 2025 Result : Commerce Full Result
  • HSE 2025 Information / Abbreviation
  • HSE 2025 Topper : Science
  • HSE 2025 Topper : Arts
  • HSE 2025 Topper : Commerce
  • HSE 2025 : Pass Percentage
  • HSE 2025 : Result Abstract
  • HSE 2025 : Candidates with Highest Marks
  • Ougri Lirol :: Part 1 : Ooba Video
  • President's Rule in Manipur : 1967 - 2025
  • Downloadable Manipuri Calendar :: 2025