From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RxRgT-0002Ow-9B for garchives@archives.gentoo.org; Tue, 14 Feb 2012 23:21:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DA841E0BCD; Tue, 14 Feb 2012 23:21:00 +0000 (UTC) Received: from mail-gy0-f181.google.com (mail-gy0-f181.google.com [209.85.160.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 27F09E0B36 for ; Tue, 14 Feb 2012 23:19:56 +0000 (UTC) Received: by ghrr17 with SMTP id r17so467945ghr.40 for ; Tue, 14 Feb 2012 15:19:56 -0800 (PST) Received: by 10.236.191.100 with SMTP id f64mr4578164yhn.57.1329261595944; Tue, 14 Feb 2012 15:19:55 -0800 (PST) Received: from [172.16.1.118] (173-165-180-238-atlanta.hfc.comcastbusiness.net. [173.165.180.238]) by mx.google.com with ESMTPS id n24sm1567478yhj.13.2012.02.14.15.19.54 (version=SSLv3 cipher=OTHER); Tue, 14 Feb 2012 15:19:55 -0800 (PST) Message-ID: <4F3AEC1B.4020401@trausch.us> Date: Tue, 14 Feb 2012 18:19:55 -0500 From: "mike@trausch.us" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120206 Thunderbird/10.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] grub vs grub 2 References: <4F3A9FAA.9000504@binarywings.net> <4F3AA6C7.4050501@trausch.us> <4FEAA3B3-0A32-4347-9441-C0E3FE3E1F38@gmail.com> <4F3AB616.4050506@alyf.net> <4F3AC72F.2090500@trausch.us> <475D2105-FA04-4A95-9AEB-328512F8985E@gmail.com> In-Reply-To: <475D2105-FA04-4A95-9AEB-328512F8985E@gmail.com> X-Enigmail-Version: 1.3.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5DC33AEEE4694C874D9F46B0" X-Gm-Message-State: ALoCoQlZJH4XVz3TqM7YI3RfuMDEfnxtoEn0xjE9GrhcBq5Kn516MASjTdAgyUWjZWSCkoZ0w0VB X-Archives-Salt: 576bbcc4-65fe-46c7-908c-2658a11776d4 X-Archives-Hash: 35a9bcd4d072f747af3dcd9ec4b1a60e This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5DC33AEEE4694C874D9F46B0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 02/14/2012 03:57 PM, LK wrote: > First, why do we need that much code? First, are you talking about source or binary code? If you're talking about source code, then realize this: Not all that source is even compiled on your system. As to the source that *is* compiled on your system, there is: - A tiny boot loader (max 448 bytes of binary code), which loads the GRUB core. - The GRUB bootloader core, which is the GRUB "main" program and which knows how to talk to different types of modules. - The modules themselves. There are modules for: - disk types, including PATA, SCSI, USB, Device Manager, DMRAID, LVM, LUKS. - filesystems, including ext2, btrfs, reiserfs. - partition types, including MBR, GPT, Apple Partition Map. Each type of module implements exactly the same interface; the core only needs to know how to talk to that type of module to communicate with all modules that implement that interface. The modular design makes it easier to (a) support new platforms, boot protocols, bus types, partition types, and filesystems, and (b) ensure that only code necessary for a particular type of thing is loaded. This design is _necessary_ to deal with today's world. Your computer is almost certainly setup differently from mine; I require the use of a GPT module on my system, for example. You may not, if you still use MBR. In fact, if you're using GRUB Legacy, then you almost certainly do not require the GPT module on your system (at least not right now). GRUB 1 assumed BIOS, and assumed MBR. GRUB 2 assumes neither. And for that matter, supports encrypted disks and logical volume management (both relatively common especially in servers) without third-party patche= s. For the _most_ part, GRUB 2 is simply designed to handle today's world. It also includes features that distributions developed (independently, and incompatibly between each other) for GRUB 1 as patches or add-on programs. > If we have less then we dont > have to divide into modules. Not true; modules are used in GRUB not because it's too big (once in 32-bit protected mode, all memory becomes available), but to help organize the system better. This simplifies the design. If I want to, I can create a new type of filesystem, and then all I have to do to make sure that GRUB 2 supports it is to write a module that knows how to talk to it. Nothing changes anywhere else in GRUB. If I create a new type of firmware, I simply write code that knows how to talk to that type of firmware, and I am done. Now GRUB 2 still runs on my PC, but also runs on my new custom computer. And that code for my custom computer never gets loaded on your computer, because your computer never uses it. Modules in this case are a structural (design) thing to simplify the design of the program, not to make it possible to fit in memory or anything like that. > Second, it does not translate into complex but rather into too much, > and whenever it is too much than needed, its hard to understand > and THUS complex. Not the other way. Having spent the last 30 minutes looking at the GRUB 2 sources from the bzr repo, I can tell you that it's very easy to understand; once you understand how the FS interface works, it's very easy to learn how one FS module reads a filesystem. And you then gain the understanding required to write a new, independent module. Think of GRUB 2's modules as "subprograms" if you must, which implement a particular (and identical) API for each instance. If you're interested, I can detail a history for you, and explain why GRUB 1 was discontinued and why the whole thing was restructured in detail. I can't right now, as I am about to get on a conference call, but I can certainly do so later tonight or tomorrow if you want. What it boils down to, though is that GRUB 1 made assumptions (that every computer used BIOS, that every computer used MBR partition tables) which no longer hold true. Because they no longer hold true, it was necessary to push that functionality into modules with a standardized interface, in order to support EFI and GPT. That also enabled GRUB 2 to be able to run on more than one platform, since it no longer made assumptions that were specific to consumer-class PC systems. --- Mike --=20 A man who reasons deliberately, manages it better after studying Logic than he could before, if he is sincere about it and has common sense. --- Carveth Read, =93Logic=94 --------------enig5DC33AEEE4694C874D9F46B0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQGcBAEBAgAGBQJPOuwbAAoJEMhPuajlh3KVjtYL/RWF4BBJRkK9v6TIlFdGlroF sRvhblnml3+hWQs42yjFK7fhNEUdd75s5tyWaYhB527EGFXBPIfwVrgyAk7YvFFv QcdYQwVy/rsGzAKeBpTyWoU9QwbVx95RBx02Oi4/1xO8T9tYz9UnYP0EI74dJUv0 r+O+Mf+5QobZLOXpwmK6r2hmBmc0d8O+RfTF2yrGBfMip4goCC/kaverK57l3P+Z 0yuKx65NRiTNiVtpq6oRMJ9h+WpwISmO4ua/3gMWRPSVKf81lMX7g4hbn5FLMtL8 PxQOI8J9yMPKRIsEChKfEtUlBnzbaY0dpcUGbGTZPFJ05CHE7yt5V2P8ByDzfphh idgjkNUQkWhZFy4YOfOqi5owJDz/Lkj3a2cGTPwV5s5vOSPwo61UXFB2jco1UX5C WTTazRR/QoEeCh+TEnDstK+6uxmWd27zYFqZcFIKzyYsG8pIKkM+98jJ4UDyDqD4 PIqoZzBPzH7VjP0MakPT2qchIj3J4aiffgXNp9nmBg== =cTK+ -----END PGP SIGNATURE----- --------------enig5DC33AEEE4694C874D9F46B0--