From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MabyX-00055D-43 for mharc-grub-devel@gnu.org; Mon, 10 Aug 2009 17:00:13 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MabyU-00051l-VA for grub-devel@gnu.org; Mon, 10 Aug 2009 17:00:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MabyQ-0004u4-6W for grub-devel@gnu.org; Mon, 10 Aug 2009 17:00:10 -0400 Received: from [199.232.76.173] (port=52460 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MabyQ-0004tr-0E for grub-devel@gnu.org; Mon, 10 Aug 2009 17:00:06 -0400 Received: from mailout02.t-online.de ([194.25.134.17]:43957) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MabyP-0004WX-GW for grub-devel@gnu.org; Mon, 10 Aug 2009 17:00:05 -0400 Received: from fwd06.aul.t-online.de by mailout02.t-online.de with smtp id 1MabyO-0007U1-00; Mon, 10 Aug 2009 23:00:04 +0200 Received: from [10.3.2.2] (SaOUUOZLoh5BrghNWRdBOoRvhxv0v9uX6zpoPhxuDJ2xnV8zkewGcQHaFu3U5ZRZe0@[217.235.186.114]) by fwd06.aul.t-online.de with esmtp id 1MabyI-0gBM9o0; Mon, 10 Aug 2009 22:59:58 +0200 Message-ID: <4A808A59.7080200@t-online.de> Date: Mon, 10 Aug 2009 23:00:09 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16 MIME-Version: 1.0 To: The development of GRUB 2 References: <20090802232422.GA23320@thorin> <4A791A24.8050602@t-online.de> <20090807105810.GB6695@thorin> <20090807114344.GO6695@thorin> <5FD279B0-A670-4A9F-8F5C-C3A56AAABFAB@zetam.org> <4A7DF4DC.5010106@t-online.de> <20090810115224.GJ9344@thorin> <4A806DA2.3070006@t-online.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: SaOUUOZLoh5BrghNWRdBOoRvhxv0v9uX6zpoPhxuDJ2xnV8zkewGcQHaFu3U5ZRZe0 X-TOI-MSGID: bf686db6-2e6d-4617-a6e4-d5d280258b80 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] ntldr support 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: Mon, 10 Aug 2009 21:00:11 -0000 Vladimir 'phcoder' Serbinenko wrote: >> grub4dos checks for ntldr as follows: >> - file starts with 0xe9, 0x??, 0x01, >> - first sector does not end with bootsector signature 0x55,0xaa, >> - file size exceeds 0x30000. >> > For me it sounds like a heuristic. I would prefer to trust user rather > than introducing heuristics to check file type. > I agree that such a heuristic is not needed. Grub2 uses different commands for different loaders (which is good) and therefore there is no need to auto-detect the loader type. But a simple health check (like in 'chainloader') would IMO make sense for any load command. For 'ntldr': check that the file size is reasonable and that code starts with a jmp instruction. Allow to override the check with '--force'. -- Regards, Christian Franke