From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MRE5L-0000cR-8R for mharc-grub-devel@gnu.org; Wed, 15 Jul 2009 19:40:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRE5I-0000Vy-1O for grub-devel@gnu.org; Wed, 15 Jul 2009 19:40:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRE5D-0000K5-45 for grub-devel@gnu.org; Wed, 15 Jul 2009 19:40:23 -0400 Received: from [199.232.76.173] (port=51457 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRE5C-0000Jo-TU for grub-devel@gnu.org; Wed, 15 Jul 2009 19:40:18 -0400 Received: from c60.cesmail.net ([216.154.195.49]:39651) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MRE5C-0002TC-86 for grub-devel@gnu.org; Wed, 15 Jul 2009 19:40:18 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 15 Jul 2009 19:40:16 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id C385C34C6D for ; Wed, 15 Jul 2009 19:49:49 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <20090715010017.17865.58915.stgit@mj.roinet.com> <20090715010055.17865.4764.stgit@mj.roinet.com> <1247672002.4177.19.camel@mj> Content-Type: text/plain Date: Wed, 15 Jul 2009 19:40:14 -0400 Message-Id: <1247701214.1500.14.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations 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: Wed, 15 Jul 2009 23:40:24 -0000 On Thu, 2009-07-16 at 00:41 +0200, Vladimir 'phcoder' Serbinenko wrote: > AFAIR during compilation process relocation entries are preserved and > resolved only in the last step. Now thinking it should work even > without .bss. Anyway don't care much about compiling bootsectors under > darwin. Apple's CC generates longer opcodes which breaks bootsectors. > Untill someone finds a fix darwin users will have to use bootsectors > compiled under linux. It's not a huge problem since very few > developpers need to modify boot sector OK, good to know. I'll try to preserve Darwin compatibility though. At least I can test it now. > > So patches 5 and 7 are dropped for now. I meant patches 4 (removal of kernel_address) and 7 (elimination of manual relocations). > Patches 1-4 and 6 have been > > applied. Installation on FAT32 is safe now. The "Hard Disk" message > > has been preserved, so it can be shortened later if the real need > > arises. > > > > That said, using direct jump to 0x8000 would save 3 bytes > Unfortunately BIOSes loading at 7c0:0 exist I mean we can remove kernel_address (minus 2 bytes) and use "jmp 0x8000" instead of "jmp *(kernel_address)" (3 bytes instead of 4). We are in the correct segment already at that point. > > and then we > > can save 2 bytes by taking an unconditional jump from the "disk check" > > code and reverting the logic. > I don't understand what part of code you mean but as long if it's just > revertion of a logic to do the same then it's fine with me Well, we cannot "revert the logic", as we don't use grub-setup in grub-mkrescue (perhaps it should be fixed). As it stands now, the bootsector should default to "no drive check". I have a solution for that, but it turns out that grub-setup is buggy, specifically this code: if (dest_dev->disk->id & 0x80) dest_dev->disk->id is just a position of the entry in device.map. Moreover, util/hostdisk.c sets disk->has_partitions to 1 indiscriminately, even for floppies, so we cannot rely on it. I suspect that installation on floppies is broken, as copying the partition table would overwrite the floppy code in the bootsector. Before this is fixed, it's better to keep the drive check as is. > > And maybe we could save 1 byte by yanking > > "cli" as writing to %ss disables interrupts until the next instruction. > I pefer to keep cli because alternative i386 implementations may have > bug with it OK. -- Regards, Pavel Roskin