How does a computer boot?

How does a computer boot?

Post by Robert Redelmeie » Fri, 13 Oct 2000 04:00:00




> Fundamentally, I don't know how does a computer boot -and the basic
> operations that have to be executed by the computer in this phase-
> (Is it a miracle?).

Normally, we don't do people's homework around here, but Venice
is a very beautiful city, so I'll make a small exception.

Booting is a very complicated, multi-stage process.  It is very
dependant on CPU architecture and system hardware. In general:

1)  When powered on, and after receiving a power-good signal,
modern CPUs will start a built-in self test (BIST) and then
within a very short, prescribed time, will start executing
instructions from a specific memory address FFFF:0000 for x86.

2)  Normally, ROM BIOS chips are mapped into this address, and
the CPU starts executing BIOS routines.  These program the
various hardware chips on the mobo (particularly the north
and south bridges) and any adapter cards will also be given a
chance to execute their own setup routines from their own ROMs.

3)  After this, the BIOS will go looking to boot an OS from
disks (in whichever order it's programmed).  It will load the
first 512 byte sector into 0:7C00 and start executing it.

4)  What this Master-Boot Record does is entirely up to it.
MS-DOS/Win, *BSD, Linux (LILO) and OS/2 have their own MBRs.
Often, because it is so small, it cannot do much, and will
only load a second-stage boot loader.

5)  This boot loader will load the kernel image, perhaps
decompressing it, and transfer control to it

6)  The kernel will then take control and start it's own
setup of VM, page tables, IDTs, kernel data structures,
and also do further hardware initialization.

8)  *IX kernels will then call `init` which will do yet
more initialization.

9)  When all is finished, you may be presented with a login
prompt.  Or not :)

-- Robert

 
 
 

How does a computer boot?

Post by GIULIO POZZAN » Sat, 14 Oct 2000 21:48:24


Thanks for opening my mail :D.

I'm studying Informatics in Venice University, at the second year.
Actually I'm studying for an exam about Operating Systems.
Following the documentation given to me from the Institute, I've studied a
lot of theory about designing an OS, but nothing about the basics for
programming an operating system.

Fundamentally, I don't know how does a computer boot -and the basic
operations that have to be executed by the computer in this phase- (Is it a
miracle?).

Please post me solutions, advices, book titles, links for sites...
Everything could help me.

THANXX

Pozzana Mauro
Universit C Foscari di Venezia, CdL Informatica.

 
 
 

How does a computer boot?

Post by Wolfram Fau » Sat, 14 Oct 2000 04:00:00


Hi,

Quote:> Please post me solutions, advices, book titles, links for sites...
> Everything could help me.

In the O'Reilly Book "Device Drivers", sorry I forgot the authors name,
is small chapter about booting the linux kernel.

Wolfram

 
 
 

How does a computer boot?

Post by Nix » Sat, 14 Oct 2000 04:00:00



> 1)  When powered on, and after receiving a power-good signal,
> modern CPUs will start a built-in self test (BIST) and then

That's actually a Power On Self Test (POST).

--
`Normally, we don't do people's homework around here, but Venice
 is a very beautiful city, so I'll make a small exception.'
        --- Robert Redelmeier compromises his principles

 
 
 

How does a computer boot?

Post by Robert Redelmeie » Sat, 14 Oct 2000 04:00:00




> > 1)  When powered on, and after receiving a power-good signal,
> > modern CPUs will start a built-in self test (BIST) and then

> That's actually a Power On Self Test (POST).

POST is in BIOS.  BIST is on silicon (microcode).

-- Robert

 
 
 

How does a computer boot?

Post by ratz » Sun, 15 Oct 2000 04:00:00



> In the O'Reilly Book "Device Drivers", sorry I forgot the authors name,
> is small chapter about booting the linux kernel.

I guess you mean `Linux Device Drivers' by Alessandro Rubini. And you
are probably referring to Chapter 16: `Physical Layout of the Kernel
Source'.

You might check out following link:

http://www.ibiblio.org/pub/Linux/docs/linux-doc-project/linux-kernel-...

He explains in great detail the booting process. Together with Robert's
9 point cook book you should be able to figure it out pretty much ;)

Regards,
Roberto Nibali, ratz

--

 
 
 

How does a computer boot?

Post by Brian Juergensmeye » Mon, 16 Oct 2000 04:00:00


Hi, Wolfram,

The book title and author are "Linux Device Drivers" by Alessandro
Rubini.  The section you are talking about is Chapter 16.

HTH,

Brian

Quote:>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<


regarding Re: How does a computer boot?:
Quote:> Hi,
> > Please post me solutions, advices, book titles, links for sites...
> > Everything could help me.

> In the O'Reilly Book "Device Drivers", sorry I forgot the authors name,
> is small chapter about booting the linux kernel.
> Wolfram

 
 
 

How does a computer boot?

Post by Brian Juergensmeye » Mon, 16 Oct 2000 04:00:00


Hi, Pozzana,

I'm going off memory on this, but what I'm about to say should be grossly
accurate. When the power switch is first tripped, the BIOS performs a
Power On Self Test (or POST).  At the (successful) completion of this
POST, the CPU automatically jumps to a known, standardized address in the
system ROM and begins execution.  This address contains code for loading
the boot sectors of the known bootable drives.  The first bootable drive
is identified and the boot sector is loaded into memory.  Generally, this
code is a secondary bootstrap loader, as (IIRC) the code for the primary
bootstrap can't be more than one sector big on the hard drive.  Once the
secondary loader loads itself, the system will jump to the address to
which the secondary bootstrap loader was loaded, and will begin execution
there.  At this point, the boot process starts splitting off depending on
which OS you're loading.  Generally, however, the OS loads the base
kernel and initializes it (at this point the system switches into
protected mode), and the required device drivers are identified and
loaded.

The book I had for Operating Systems was Andrew Tanenbaum's "Operating
Systems: Design and Implementation" First edition.

Hope this helps,

Brian

Quote:>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<


How does a computer boot?:

Quote:> Thanks for opening my mail :D.
> I'm studying Informatics in Venice University, at the second year.
> Actually I'm studying for an exam about Operating Systems.
> Following the documentation given to me from the Institute, I've studied
a
> lot of theory about designing an OS, but nothing about the basics for
> programming an operating system.
> Fundamentally, I don't know how does a computer boot -and the basic
> operations that have to be executed by the computer in this phase- (Is it
a
> miracle?).
> Please post me solutions, advices, book titles, links for sites...
> Everything could help me.
> THANXX
> Pozzana Mauro
> Universit C Foscari di Venezia, CdL Informatica.

 
 
 

How does a computer boot?

Post by Wolfram Fau » Thu, 19 Oct 2000 04:00:00


Hallo,

I am writing my final theses at the moment so I look for exactly
definition of "booting" rather when booting is finished.


> 5)  This boot loader will load the kernel image, perhaps
> decompressing it, and transfer control to it

Is it finished here when the kernel is controlling the computer.

Quote:> 6)  The kernel will then take control and start it's own
> setup of VM, page tables, IDTs, kernel data structures,
> and also do further hardware initialization.

Or here when the the kernel has finished its initialisation.

Thanks

Wolfram

 
 
 

How does a computer boot?

Post by phil-news-nos.. » Thu, 19 Oct 2000 04:00:00



| I am writing my final theses at the moment so I look for exactly
| definition of "booting" rather when booting is finished.

The term "booting" refers to the combination of steps needed to get a
full operating system loaded and running.  Initially RAM has nothing
in it.  What happens first varies by platform, but it's generally
done in stages because the first things that happen are so primitive
that they cannot load the whole operating system all at once.  The
term refers to "pulling one self up by their boot straps".  Just how
that happens in a give platform is not the same overall.

|>
|> 5)  This boot loader will load the kernel image, perhaps
|> decompressing it, and transfer control to it
|
| Is it finished here when the kernel is controlling the computer.

That depends on your point of view.  Some people don't consider it done
until the "init" program runs.  Others don't consider it done until the
"init" loads all the other programs.  Some don't consider it done until
they can login.

|> 6)  The kernel will then take control and start it's own
|> setup of VM, page tables, IDTs, kernel data structures,
|> and also do further hardware initialization.
|
| Or here when the the kernel has finished its initialisation.

The kernel only starts one (or in certain circumstances, two) program.
That program starts all the others.  It's called "init".  It is your
friend.

--
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------

 
 
 

How does a computer boot?

Post by Robert Redelmeie » Thu, 19 Oct 2000 04:00:00



> I am writing my final theses at the moment so I look for exactly
> definition of "booting" rather when booting is finished.

Well, you can define 'booting' to be whatever you wish.
My personal definition is that a machine is finished
'booting' when a user or other agent can start to use
the machine as it was intended.


> > 5)  This boot loader will load the kernel image, perhaps
> > decompressing it, and transfer control to it

> Is it finished here when the kernel is controlling the computer.

Not really -- this is only the end of the BIOS boot, and
the start of the kernel boot.

Quote:> > 6)  The kernel will then take control and start it's own
> > setup of VM, page tables, IDTs, kernel data structures,
> > and also do further hardware initialization.

> Or here when the the kernel has finished its initialisation.

Not even -- this is only the end of the kernel boot.  As phil
points out, init will run, step through runlevels and /etc/rc.d
scripts starting up many vital processes including gettys
and maybe X.  Only then can the booting be considered complete.

Booting is a long, involved sequential process with remarkably
little parallelism.  At each phase, one piece of hardware or
code has control, and if it succeeds, passes control to the next.

-- Robert

 
 
 

1. Can I boot from DOS to use DOS Device Drivers?

Noticed that there are a couple of boot "systems" out there that allow you to
boot Linux from DOS. I was wondering if doing something like that would allow
me to load the Parallel Port driver for my External Hard drive on my Toshiba
1950CT so that Linux could access it?

Thanks,
Ewan Grantham


P.S. Of course if you know of some other way to do this... :-)

2. Windows NT Compatibility

3. Mini Linux coexists in DOS partition and boot from DOS

4. Ultra 133 Tx2 Controller card and Linux

5. DEFBOOTSTR=dos should this allow dos to boot by default?

6. HELP! Corrupt label - Wrong magic number

7. dd of DOS MBR wanted (to boot dos on hdb)

8. After upgrading to new kernel

9. How do you boot DOS not typing dos?

10. Get "dos: no dos partition" from boot prompt

11. boot problem: computer freezes on boot with "LI"

12. Booting Linux from DOS 6.2 Multi-Boot...

13. Make the boot floppy boot dos?