From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KQmZJ-0007h7-1D for mharc-grub-devel@gnu.org; Wed, 06 Aug 2008 13:13:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQmZG-0007gk-Bd for grub-devel@gnu.org; Wed, 06 Aug 2008 13:12:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQmZE-0007gS-LW for grub-devel@gnu.org; Wed, 06 Aug 2008 13:12:57 -0400 Received: from [199.232.76.173] (port=55556 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQmZE-0007gP-Fe for grub-devel@gnu.org; Wed, 06 Aug 2008 13:12:56 -0400 Received: from gateway12.websitewelcome.com ([67.18.7.5]:41736) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KQmZE-0007eQ-GH for grub-devel@gnu.org; Wed, 06 Aug 2008 13:12:56 -0400 Received: (qmail 22393 invoked from network); 6 Aug 2008 17:19:07 -0000 Received: from gator297.hostgator.com (74.53.228.114) by gateway12.websitewelcome.com with SMTP; 6 Aug 2008 17:19:07 -0000 Received: from spk.venturedesignservices.com ([65.61.115.34]:44949 helo=localhost) by gator297.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1KQmZB-0003qW-5s for grub-devel@gnu.org; Wed, 06 Aug 2008 12:12:53 -0500 Date: Wed, 6 Aug 2008 10:11:35 -0700 From: Colin D Bennett To: grub-devel@gnu.org Message-ID: <20080806101135.762ec5dd@gibibit.com> In-Reply-To: References: X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator297.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gibibit.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: Encryption Support for GRUB 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, 06 Aug 2008 17:12:59 -0000 On Wed, 6 Aug 2008 11:04:16 -0500 (CDT) "W. Michael Petullo" wrote: > 1. How do I know exactly what subset of libc is available to me as a > GRUB developer? Obviously, system calls would not be expected to work > because the operating system has not yet been loaded, but I would > expect libmath routines to be usable by GRUB. What about other > libraries? No libc is available. Only functions implemented by GRUB itself are available. See ``kern/misc.c`` and ``include/grub/misc.h`` in the GRUB 2 source tree for implementations of the most important things that are normally provided by libc, such as strcpy (grub_strcpy), memcmp (grub_memcmp), etc. link to online svn for misc.c: http://svn.savannah.gnu.org/viewvc/trunk/grub2/kern/misc.c?revision=1774&root=grub&view=markup GRUB implements dynamic memory allocation through grub_malloc, grub_free, grub_realloc. See ``kern/mm.c``. No math library is available, but I think you could create a 'math' module in GRUB and implement the required math functions there. The main thing is to keep the GRUB core small. It needs to fit in 32 KB, I think. GRUB has its own file I/O api (no stdio -- instead use grub_file_open, grub_file_read, etc.). If you want to see how to use the GRUB library stuff, look at some of the built in commands such as ``commands/ls.c``, etc. Regards, Colin