public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dragoslav Zaric <dragoslav.zaric.kd@gmail.com>
To: devzero@web.de
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Linux image boot
Date: Thu, 16 Apr 2009 12:17:56 +0200	[thread overview]
Message-ID: <2d05c4580904160317i2e5499d2ld7b4deb8ec312aa2@mail.gmail.com> (raw)
In-Reply-To: <672927818@web.de>

Hey thanks roland,

the link is just what I was interested in. So GRUB does that loading
back and forth around
first 1 MB. I just looked at article:

http://duartes.org/gustavo/blog/post/how-computers-boot-up

and it says that there:
------------------------------------------------------------------------------
There’s a complication worth mentioning (aka, I told you this thing is
hacky). The image for a current Linux kernel, even compressed, does
not fit into the 640K of RAM available in real mode. My vanilla Ubuntu
kernel is 1.7 MB compressed. Yet the boot loader must run in real mode
in order to call the BIOS routines for reading from the disk, since
the kernel is clearly not available at that point. The solution is the
venerable unreal mode. This is not a true processor mode (I wish the
engineers at Intel were allowed to have fun like that), but rather a
technique where a program switches back and forth between real mode
and protected mode in order to access memory above 1MB while still
using the BIOS. If you read GRUB source code, you’ll see these
transitions all over the place (look under stage2/ for calls to
real_to_prot and prot_to_real). At the end of this sticky process the
loader has stuffed the kernel in memory, by hook or by crook, but it
leaves the processor in real mode when it’s done.
------------------------------------------------------------------------------

Thanks again,

Dragoslav Zaric
[Programmer; M Sc Astrophysics]

  reply	other threads:[~2009-04-16 10:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16  9:48 Linux image boot devzero
2009-04-16 10:17 ` Dragoslav Zaric [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-04-16  7:45 Dragoslav Zaric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d05c4580904160317i2e5499d2ld7b4deb8ec312aa2@mail.gmail.com \
    --to=dragoslav.zaric.kd@gmail.com \
    --cc=devzero@web.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox