Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lv08Q-0006Js-42 for mharc-grub-devel@gnu.org; Fri, 17 Apr 2009 22:18:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lv08N-0006Fr-Vu for grub-devel@gnu.org; Fri, 17 Apr 2009 22:18:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lv08J-00065Z-4r for grub-devel@gnu.org; Fri, 17 Apr 2009 22:18:23 -0400 Received: from [199.232.76.173] (port=38241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lv08J-00065I-0Z for grub-devel@gnu.org; Fri, 17 Apr 2009 22:18:19 -0400 Received: from mail-ew0-f160.google.com ([209.85.219.160]:46485) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lv08I-00026X-IK for grub-devel@gnu.org; Fri, 17 Apr 2009 22:18:18 -0400 Received: by ewy4 with SMTP id 4so1127041ewy.42 for ; Fri, 17 Apr 2009 19:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer; bh=Cy90MWIbUJTiGtJ/oawIVlBqVSfbYlMDIwfFd0wSayA=; b=cRlcH/KwyInIF/96puVuLyi9yjHLzTTA6jcP+nx5CdX1ed0AMjMxX13iYSFJI8yy8B mwH2lSEJ8Om5v9dNMJGxOPxfTcl14/VuVdkhBWrZzeLnan9NO84umBXWgHLxhc5A4Zvz BD/qCZvHgWEOAQ0nIlnBSEsOqlaOMgYZj3fyg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer; b=EcsAyIFOJfTuoRu4MXUxscWZSfX+aEfAjM+7naYJiJ8kFnqNIBC5jj2CJxZDPusvlt CWDucMtsGAhquB2KXOm9rLIxxaCKDILFkDJXWwGhAm2uSOONPM1WaGa2eBDFnP0bqDQ1 DgPF6laI0zNr74/WjIzqRzd5HIqQnJBuswk54= Received: by 10.210.54.15 with SMTP id c15mr3366060eba.94.1240021097247; Fri, 17 Apr 2009 19:18:17 -0700 (PDT) Received: from ?192.168.1.104? (213.37.226.100.dyn.user.ono.com [213.37.226.100]) by mx.google.com with ESMTPS id 7sm4444708eyb.20.2009.04.17.19.18.15 (version=SSLv3 cipher=RC4-MD5); Fri, 17 Apr 2009 19:18:16 -0700 (PDT) From: Javier =?ISO-8859-1?Q?Mart=EDn?= To: The development of GRUB 2 In-Reply-To: <49E91862.9090103@verizon.net> References: <49E3E0FB.1070907@verizon.net> <1239694395.3718.5.camel@fz.local> <49E455B7.5040402@verizon.net> <49E4518D.1090301@gmail.com> <49E5A102.40701@verizon.net> <49E5A394.8050108@gmail.com> <49E5A91C.3000109@verizon.net> <49E5AA2F.1060305@gmail.com> <1240003243.6449.7.camel@localhost> <49E90CCD.90207@verizon.net> <49E91862.9090103@verizon.net> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-TE3uiY/zcFjXPhSzuoRX" Date: Sat, 18 Apr 2009 04:18:14 +0200 Message-Id: <1240021094.19677.29.camel@accesodirecto.casa> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: status grub2 port of grub-legasy map command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2009 02:18:24 -0000 --=-TE3uiY/zcFjXPhSzuoRX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable El vie, 17-04-2009 a las 20:01 -0400, John Stanley escribi=C3=B3: > Ok, that sounds good... I feel better about it then. I didn't mean=20 > directly modifying bios data, but through doc'd bios ints of course. It=20 > been a long, long time since I've looked at (or dealt with) bios code,=20 > so I was was simply wondering if boot device naming could be modified =20 > in a documented way nowadays-- after all, the functionality has been=20 > available in the bios setup in pcs for at least 10 years or so. Indeed. However, this is not necessary as most modern OSes only use the BIOS routines for the initial startup, switching sooner than later to their own device drivers. The problem with some of them, among them MS Windows, is that the loader stage fails to either notice the "boot drive number" info passed in %dl by the BIOS (or, in this case, by GRUB) and/or propagate it to latter stages of their multi-stage pre-boot process. As an example, FreeDOS ignores the parameter and fails to locate KERNEL.SYS, while ReactOS's freeldr uses it and is able to load its config file, but then fails to boot the (drive-#-hardcoded) paths in that same file. This sorry state of things motivates most BIOSes to actually "swap" your "designated boot device" with the actual first HD, so that systems that assume they were installed on hd0 will work. Drivemap basically replicates this functionality using the "canonical" real-mode interrupt handler chaining pattern: it intercepts calls to the BIOS drive access interrupt and calls the previous handler after performing its role. This is not a "dirty hack" (well, it _is_ by current standards), and in fact it was the way TSRs worked in DOS. Here's what happens when the Windows loader (or FreeDOS, etc.) tries to access the drives: ntldr --(int13h: r,0x80)--> drivemap_int13h --(lcall: f,r,0x81)-->BIOS Drivemap (and other TSRs) actually _simulate_ an interrupt call by pushing the flags on the stack, then doing a far call to the address of the handler they replaced (the address that occupied the related slot in the IVT when they were installed). This was, for example, how resident anti-virus programs were implemented in DOS, and I suppose that other programs like DoubleSpace and SmartDrive used it too. For modern OSes, once the initial stage has loaded the kernel and the relevant modules, it usually fires up its own disk drivers that reflect the "true" (as defined by the disk controller) order of the HDs, so neither the BIOS nor drivemap affect that. Moreover, many OSes currently select their root device based on its UUID, label, etc, so there is no problem switching the BIOS routines because they won't be used again after the initial loader is finished. The exception is, of course, FreeDOS, where the drives stay swapped for the whole session because it has no disk drivers other than those provided by BIOS. I hope this has reassured you that neither mmap nor drivemap are doing any "dark things" nor "1980s DOS/BIOS black magic". The only BIOS data table modified (by mmap) should be the "available free memory" at the BDA, which is a completely documented procedure and quite about the only way of telling a DOS "do not use this memory". Uhh... btw, I think I found the problem with mmap and FreeDOS: both the mmap int handler and the drivemap int handler reserve their memory as high as possible under 1M. Is FreeDOS aware of this? I mean, we can tell it not to touch memory under 640K through the BDA and INT12, but how do we tell it not to touch the 640K-1M area? I will check if this is the cause of the disaster... tomorrow - it's 4AM and I'm sleepy. Goodbye! --=20 -- Lazy, Oblivious, Rational Disaster -- Habbit --=-TE3uiY/zcFjXPhSzuoRX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Esto es una parte de mensaje firmado digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAABAgAGBQJJ6ThiAAoJEKSl+Fbdeo726DEP/3BIGrsrp1lw8ZRPF1EzSNXg uOuOwWRl8M2fsAtz0HMiTy7eTCEFDguA2E7h/6WKCHu6URF5d6q/b2Kttp+BJLOK aYQn2VrRzg3UIE4sE1PYGQE015axl1RhQQTMM3KgTp05mxyyyCpfh3ApceOTBz5B FuIXcPKRyDxtTjEOhhWbL8843Us6ZjhPfhK/w7ayjB0moLBaUBQaBPbsER5UcXLl Jmw8kVBwfjGkGhPVFMs3YHPLSZi5t+IN8lXZ6YDMOc4HqT4wJxU63q6Trdql5vst oTUP8iFJnpiN7P1X5Xwpw2kfddIMcE/FF/05vH5fNwxZUZDEwP1Bd2N+sKj2kpD4 oP4lIJQh/FqnslqiKNut4LE3iPqAgW/bRU07w5vsYVchYhl2M6rN6RJ+8WFPeXtj Xd3NTTMXLIwnj46uGOYZ+YpEDukGSXdd/mGBbx2nEC2Y9jPL4ju8o1mKj4i0mPgc cnKMei2FldNT1/0Pc6ktvZtI13qkN4GwxNHP4esRn4SFbpu989ZTgwyksI0AvWVl ukZHQYOaGHO2F53qASkq2lF9pyN8cCL0NTACQebeouT4gGVXJZObtB37W55Dy1/Q uE07aq5e6QIKy5Kjm4cs7pqq3xoAYo2bCg2G9h2dDrbao6CWOypyc+khWIwMtC/Z 1ZtKAUZ8qDJcpwWTKU+t =90HT -----END PGP SIGNATURE----- --=-TE3uiY/zcFjXPhSzuoRX--