Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KTKTP-0000dn-Nj for mharc-grub-devel@gnu.org; Wed, 13 Aug 2008 13:49:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTKTN-0000cx-Gg for grub-devel@gnu.org; Wed, 13 Aug 2008 13:49:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTKTM-0000cN-Os for grub-devel@gnu.org; Wed, 13 Aug 2008 13:49:25 -0400 Received: from [199.232.76.173] (port=40790 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTKTM-0000cD-G2 for grub-devel@gnu.org; Wed, 13 Aug 2008 13:49:24 -0400 Received: from smtp-vbr10.xs4all.nl ([194.109.24.30]:4291) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTKTL-0001Bw-TL for grub-devel@gnu.org; Wed, 13 Aug 2008 13:49:24 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id m7DHnLb6085123; Wed, 13 Aug 2008 19:49:22 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <20080811152238.GA23380@thorin> <48A05D25.6040209@nic.fi> <20080811212418.GC6883@thorin> <20080811220723.GA22204@thorin> <20080812132515.GA13942@thorin> <20080812162915.GA8518@thorin> <20080812223815.GA3141@thorin> <20080812234430.GA12880@thorin> Mail-Copies-To: mgerards@xs4all.nl Date: Wed, 13 Aug 2008 19:52:59 +0200 In-Reply-To: <20080812234430.GA12880@thorin> (Robert Millan's message of "Wed, 13 Aug 2008 01:44:30 +0200") Message-ID: <87skt8245g.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Cc: "Jonathan A. Kollasch" Subject: Re: [PATCH] decouple mmap parsing and implement Multiboot mmap in the loader 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, 13 Aug 2008 17:49:25 -0000 Hi, Robert Millan writes: > And here we go *AGAIN*, this time not forgetting to include all files in the > patch. [...] > Index: include/grub/i386/pc/init.h > =================================================================== > --- include/grub/i386/pc/init.h (revision 1802) > +++ include/grub/i386/pc/init.h (working copy) > @@ -1,6 +1,6 @@ > /* > * GRUB -- GRand Unified Bootloader > - * Copyright (C) 2002,2004,2005,2007 Free Software Foundation, Inc. > + * Copyright (C) 2002,2004,2005,2007,2008 Free Software Foundation, Inc. > * > * GRUB is free software: you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > @@ -21,6 +21,8 @@ > > #include > #include > +#include /* For struct grub_mmap_entry, which is also > + needed by Multiboot. */ Isn't it better to split the header file? This seems like a hack. > /* Get the memory size in KB. If EXTENDED is zero, return conventional > memory, otherwise return extended memory. */ > @@ -30,19 +32,18 @@ > in 1KB parts, and upper 16 bits are above 16MB in 64KB parts. */ > grub_uint32_t grub_get_eisa_mmap (void); > > -struct grub_machine_mmap_entry > -{ > - grub_uint32_t size; > - grub_uint64_t addr; > - grub_uint64_t len; > - grub_uint32_t type; > -} __attribute__((packed)); > +/* Multiboot mmaps have been defined to match with the E820 definition. */ > +#define GRUB_MACHINE_MEMORY_AVAILABLE GRUB_MMAP_MEMORY_AVAILABLE > +#define GRUB_MACHINE_MEMORY_RESERVED GRUB_MMAP_MEMORY_RESERVED > > /* Get a memory map entry. Return next continuation value. Zero means > the end. */ > -grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_machine_mmap_entry *entry, > +grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_mmap_entry *entry, > grub_uint32_t cont); > > +void EXPORT_FUNC(grub_mmap_iterate) > + (int (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); > + > /* Turn on/off Gate A20. */ > void grub_gate_a20 (int on); > > Index: include/grub/i386/coreboot/memory.h > =================================================================== > --- include/grub/i386/coreboot/memory.h (revision 1802) > +++ include/grub/i386/coreboot/memory.h (working copy) > @@ -25,7 +25,6 @@ > > #ifndef ASM_FILE > #include > -#include > #endif > > #define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */ > @@ -55,13 +54,13 @@ > { > grub_uint64_t addr; > grub_uint64_t size; > -#define GRUB_LINUXBIOS_MEMORY_AVAILABLE 1 > +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 > grub_uint32_t type; > }; > typedef struct grub_linuxbios_mem_region *mem_region_t; > > -grub_err_t EXPORT_FUNC(grub_available_iterate) > - (int (*hook) (mem_region_t)); > +void EXPORT_FUNC(grub_mmap_iterate) > + (int (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); > > #endif > > Index: include/grub/multiboot.h > =================================================================== > --- include/grub/multiboot.h (revision 1802) > +++ include/grub/multiboot.h (working copy) > @@ -1,7 +1,7 @@ > /* multiboot.h - multiboot header file with grub definitions. */ > /* > * GRUB -- GRand Unified Bootloader > - * Copyright (C) 2003,2007 Free Software Foundation, Inc. > + * Copyright (C) 2003,2007,2008 Free Software Foundation, Inc. > * > * GRUB is free software: you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > @@ -101,6 +101,16 @@ > grub_uint16_t vbe_interface_len; > }; > > +struct grub_mmap_entry > +{ > + grub_uint32_t size; > + grub_uint64_t addr; > + grub_uint64_t len; > +#define GRUB_MMAP_MEMORY_AVAILABLE 1 > +#define GRUB_MMAP_MEMORY_RESERVED 2 > + grub_uint32_t type; > +} __attribute__((packed)); > + > struct grub_mod_list > { > /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */ > Index: loader/i386/pc/multiboot.c > =================================================================== > --- loader/i386/pc/multiboot.c (revision 1802) > +++ loader/i386/pc/multiboot.c (working copy) > @@ -78,14 +78,60 @@ > grub_free ((void *) mbi->cmdline); > grub_free (mbi); > } > - > - > + Hm? :-) -- Marco