linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mabye simple,but i confused
@ 2005-06-16  5:25 guorke
  2005-06-16  7:54 ` DervishD
  2005-06-16 12:31 ` Richard B. Johnson
  0 siblings, 2 replies; 6+ messages in thread
From: guorke @ 2005-06-16  5:25 UTC (permalink / raw)
  To: linux-kernel

in understangding the linux kernel, the authors says 
"..Moves itself from address 0x00007c00 to address 0x00090000.."

What i confused is why the Boot Loader do this, i asked google,but
still no answe.
who can make me understand it ?
Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mabye simple,but i confused
  2005-06-16  5:25 mabye simple,but i confused guorke
@ 2005-06-16  7:54 ` DervishD
  2005-06-16  8:55   ` guorke
  2005-06-16 12:31 ` Richard B. Johnson
  1 sibling, 1 reply; 6+ messages in thread
From: DervishD @ 2005-06-16  7:54 UTC (permalink / raw)
  To: guorke; +Cc: linux-kernel

 * guorke <gourke@gmail.com> dixit:
> in understangding the linux kernel, the authors says 
> "..Moves itself from address 0x00007c00 to address 0x00090000.."
> 
> What i confused is why the Boot Loader do this, i asked google,but
> still no answe.
> who can make me understand it ?

    Well, let's start with the Master Boot Record. In PC's the BIOS
loads the MBR at address 0x7c00, but the MBR is responsible for
loading the OS bootsector, if any. And the bootsectors are written
assuming that they're loaded by a MBR or *by the BIOS itself* so the
address they assume is 0x7c00. But the MBR is already at that
address! What can it do? Well, it moves itself out of the place.

    The problem is that the kernel itself could be loaded directly by
the BIOS (a long time ago, it was possible to boot from a raw floppy
containing an image of the kernel), and the first sector would be
loaded at 0x7c00, so the bootsector, MBR, loader or whatever has to
move out of that address at the very beginning. Why the physical
address 0x00090000 was used? I don't know. Well, it's well at the top
of the 640k base memory and the segment starts with 1001 in binary,
which is a fancy number XDD

    Hope that helps.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mabye simple,but i confused
  2005-06-16  7:54 ` DervishD
@ 2005-06-16  8:55   ` guorke
  0 siblings, 0 replies; 6+ messages in thread
From: guorke @ 2005-06-16  8:55 UTC (permalink / raw)
  To: guorke, linux-kernel

yes,DervishD.you give me a lot of help! Thanks

On 6/16/05, DervishD <lkml@dervishd.net> wrote:
>  * guorke <gourke@gmail.com> dixit:
> > in understangding the linux kernel, the authors says
> > "..Moves itself from address 0x00007c00 to address 0x00090000.."
> >
> > What i confused is why the Boot Loader do this, i asked google,but
> > still no answe.
> > who can make me understand it ?
> 
>    Well, let's start with the Master Boot Record. In PC's the BIOS
> loads the MBR at address 0x7c00, but the MBR is responsible for
> loading the OS bootsector, if any. And the bootsectors are written
> assuming that they're loaded by a MBR or *by the BIOS itself* so the
> address they assume is 0x7c00. But the MBR is already at that
> address! What can it do? Well, it moves itself out of the place.
> 
>    The problem is that the kernel itself could be loaded directly by
> the BIOS (a long time ago, it was possible to boot from a raw floppy
> containing an image of the kernel), and the first sector would be
> loaded at 0x7c00, so the bootsector, MBR, loader or whatever has to
> move out of that address at the very beginning. Why the physical
> address 0x00090000 was used? I don't know. Well, it's well at the top
> of the 640k base memory and the segment starts with 1001 in binary,
> which is a fancy number XDD
> 
>    Hope that helps.
> 
>    Raúl Núñez de Arenas Coronado
> 
> --
> Linux Registered User 88736 | http://www.dervishd.net
> http://www.pleyades.net & http://www.gotesdelluna.net
> It's my PC and I'll cry if I want to...
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mabye simple,but i confused
  2005-06-16  5:25 mabye simple,but i confused guorke
  2005-06-16  7:54 ` DervishD
@ 2005-06-16 12:31 ` Richard B. Johnson
  2005-06-20  1:55   ` guorke
  1 sibling, 1 reply; 6+ messages in thread
From: Richard B. Johnson @ 2005-06-16 12:31 UTC (permalink / raw)
  To: guorke; +Cc: linux-kernel

On Thu, 16 Jun 2005, guorke wrote:

> in understangding the linux kernel, the authors says
> "..Moves itself from address 0x00007c00 to address 0x00090000.."
>
> What i confused is why the Boot Loader do this, i asked google,but
> still no answe.
> who can make me understand it ?
> Thanks.

The IBM 'IPL' (initial program load) address was specified to be
at 7c00. There was room here for only one "sector", which in the
early days was 512 bytes. The very first sector, the boot sector,
was loaded into this address and then execution was started at
a specified offset so that this boot code could load the rest
of the operating system. To load the rest of the operating system,
one needs to move the boot-code to somewhere it won't get
overwritten by subsequent reads from the disk.

To load Linux, the boot developers wanted to load code 64k at
a time. The only address in real-mode, that was guaranteed to
not be in use, where the boot code could load a whole 64k was
at 90000 hex. This provides a buffer from which the boot-loader
can copy 64k at a time into the protected-mode address space
starting at 0x00100000. The boot-loader uses real-mode BIOS
services to copy the code to the 1 megabyte address which can't
be reached in real mode.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mabye simple,but i confused
  2005-06-16 12:31 ` Richard B. Johnson
@ 2005-06-20  1:55   ` guorke
  0 siblings, 0 replies; 6+ messages in thread
From: guorke @ 2005-06-20  1:55 UTC (permalink / raw)
  To: linux-os; +Cc: linux-kernel

Thanks,I must read it carefully

On 6/16/05, Richard B. Johnson <linux-os@analogic.com> wrote:
> On Thu, 16 Jun 2005, guorke wrote:
> 
> > in understangding the linux kernel, the authors says
> > "..Moves itself from address 0x00007c00 to address 0x00090000.."
> >
> > What i confused is why the Boot Loader do this, i asked google,but
> > still no answe.
> > who can make me understand it ?
> > Thanks.
> 
> The IBM 'IPL' (initial program load) address was specified to be
> at 7c00. There was room here for only one "sector", which in the
> early days was 512 bytes. The very first sector, the boot sector,
> was loaded into this address and then execution was started at
> a specified offset so that this boot code could load the rest
> of the operating system. To load the rest of the operating system,
> one needs to move the boot-code to somewhere it won't get
> overwritten by subsequent reads from the disk.
> 
> To load Linux, the boot developers wanted to load code 64k at
> a time. The only address in real-mode, that was guaranteed to
> not be in use, where the boot code could load a whole 64k was
> at 90000 hex. This provides a buffer from which the boot-loader
> can copy 64k at a time into the protected-mode address space
> starting at 0x00100000. The boot-loader uses real-mode BIOS
> services to copy the code to the 1 megabyte address which can't
> be reached in real mode.
> 
> Cheers,
> Dick Johnson
> Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
>  Notice : All mail here is now cached for review by Dictator Bush.
>                  98.36% of all statistics are fiction.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mabye simple,but i confused
@ 2005-06-20 18:53 Nick Warne
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Warne @ 2005-06-20 18:53 UTC (permalink / raw)
  To: linux-kernel, guorke

guorke wrote:

> Thanks,I must read it carefully
> 
> On 6/16/05, Richard B. Johnson <linux-os@analogic.com> wrote:
>> On Thu, 16 Jun 2005, guorke wrote:
>> 
>> > in understangding the linux kernel, the authors says
>> > "..Moves itself from address 0x00007c00 to address 0x00090000.."
>> >
>> > What i confused is why the Boot Loader do this, i asked google,but
>> > still no answe.
>> > who can make me understand it ?
>> > Thanks.
>> 
>> The IBM 'IPL' (initial program load) address was specified to be
>> at 7c00. There was room here for only one "sector", which in the
>> early days was 512 bytes....

There is more in Documentation/i386/boot.txt on this subject.

Nick
-- 
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-06-20 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-16  5:25 mabye simple,but i confused guorke
2005-06-16  7:54 ` DervishD
2005-06-16  8:55   ` guorke
2005-06-16 12:31 ` Richard B. Johnson
2005-06-20  1:55   ` guorke
2005-06-20 18:53 Nick Warne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).