Messages in this thread | | | Date | Thu, 16 Apr 2009 12:17:56 +0200 | Subject | Re: Linux image boot | From | Dragoslav Zaric <> |
| |
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] -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |