home | list info | list archive | date index | thread index

Re: [Bulk] Re: [OCLUG-Tech] Harddisk location on a virgin machine ??

  • Subject: Re: [Bulk] Re: [OCLUG-Tech] Harddisk location on a virgin machine ??
  • From: Stephen Gregory <oclug [ at ] kernelpanic [ dot ] ca>
  • Date: Fri, 26 Oct 2007 08:38:10 -0400
On Thu, Oct 25, 2007 at 10:04:18PM -0400, William Case wrote:

> the boot loader, something i.e. a high/low voltage, in BIOS ROM that
> makes up an initial 16 bit address for the SCSI bus must tell the CPU
> where the bus is and where (i.e. open the electronic path) the harddisk
> is.

The CPU doesn't know about hard drives and SCSI buses. The BIOS
does. The BIOS is software (firmware) that provides the
intelligence. The CPU is just a piece of hardware that can add numbers
and read and write to memory and i/o addresses.

The BIOS knows how to read and write to the hard drive because it has
been programmed with the correct commands (numbers) to send to the
hard drive controller. The BIOS knows the address of the hard drive
controller because the motherboard maker hard wired the chip to a
specific address or programmed a routine in the BIOS to find the
correct address. Any add-on boards need to provide additional BIOS
code in boot roms in order to function (at boot time).


> In doing so BIOS does it in such a way that the address can be
> translated as hd0,0, for example, by GRUB. 

GRUB uses the BIOS code to read and write to the hard drive. GRUB
accesses this code with the interrupt 0x13 (INT 13h) op code.



> GRUB uses that base address as the start point in gathering initial
> hardware data to find /boot and the initrd. That address has been
> copied to RAM (in most cases) so that it can be found by GRUB.

Not quite. Grub uses the INT 13 mechanism to run the BIOS code to read
the hard drive.


> GRUB, on installation, adds the harddisk address to the MBR and
> adds stage 1.5 at the first position past the MBR to the hard disk.

The location of stage 1.5 can be (almost) anywhere. The location (hard
drive blocks) are embedded into the 512 byte Grub stage 1 at install
time.


> How does BIOS initially get the harddisk
> address?

The BIOS starts looking at a hard coded location. It is the
motherboard maker's responsibility to insure that the hard drive
controller is where the BIOS code expects it to be.

-- 
sg