OS and Bootstrap questions

G

Guest

Guest
Archived from groups: alt.comp.hardware.pc-homebuilt (More info?)

Hi I am reading atricals about (BIOS and OS). I have some question

1) <quote> When computer activates the hard disk drive, it finds the
first piece of the operation system: the bootstrap loader. </quote>
My question: I understand that the CPU read instruction from the
memory. Now when a computer activate the HD and found the bootstap,
would the computer load that piece of s/w (the bootstrap) to the
memory and execute it from there or it would read it right from the
hard drive and exectute it from there??

2) Does O/S manage the Cache memory?? or it only manage the RAM and
the Cache would be controled by the CPU??

Any help would be very much appreciate it. thanks.
 

somebody

Distinguished
Apr 2, 2004
154
0
18,680
Archived from groups: alt.comp.hardware.pc-homebuilt (More info?)

On 13 Apr 2004 08:28:30 -0700, esara123@hotmail.com (esara) wrote:

>Hi I am reading atricals about (BIOS and OS). I have some question
>
>1) <quote> When computer activates the hard disk drive, it finds the
>first piece of the operation system: the bootstrap loader. </quote>
>My question: I understand that the CPU read instruction from the
>memory. Now when a computer activate the HD and found the bootstap,
>would the computer load that piece of s/w (the bootstrap) to the
>memory and execute it from there or it would read it right from the
>hard drive and exectute it from there??

The cpu always runs code from memory.
The boot loader is loaded into memory.
In fact, even the code that loads the boot loader, is in memory, even
if it happens to be rom.
A CPU can't do anything without software.
Everything that happens is controlled by some software.
To run, software needs to be in addressable memory, ram or rom (or
equivalent, cache). The initial software the CPU finds, must reside
in rom or persistent ram.
A CPU executes the instruction its PC register (program counter)
points to. This pointer is mapped to a memory address by the memory
controller. But when the cpu powers on, it is in 'real mode', meaning
the pointer goes straight out as an address. This is neat, since the
memory controller depends on page descriptors, that need to be created
also in memory, to map to physical addresses. This is something that
also must be set up by software. and so on.

>2) Does O/S manage the Cache memory?? or it only manage the RAM and
>the Cache would be controled by the CPU??

There may be some few quirky highly privileged instructions that can
crank the cache in some way, forcing writebacks or something like
that. I have some manuals I could wear myself on, if this is terribly
important. But the cache is mainly controlled and used by the cpu's
internal logic. It's basically transparent to all software. I think
that includes the OS, - at least most of the time.

I would assume, that to the extent OS or other software is interested
in the cache, it would mainly be an issue of configuring itself, to
optimize running for the size of the cache, rather than controlling
the cache in any way. But I'm on thin ice here.

ancra