From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Q7o28-0003mt-TC for mharc-grub-devel@gnu.org; Thu, 07 Apr 2011 08:09:56 -0400 Received: from [140.186.70.92] (port=32983 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7o26-0003mk-EE for grub-devel@gnu.org; Thu, 07 Apr 2011 08:09:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7o25-000826-CP for grub-devel@gnu.org; Thu, 07 Apr 2011 08:09:54 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:59068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7o25-00080R-04 for grub-devel@gnu.org; Thu, 07 Apr 2011 08:09:53 -0400 Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate02.web.de (Postfix) with ESMTP id DD05319BEC21B for ; Thu, 7 Apr 2011 14:09:50 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localnet) by smtp01.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1Q7o22-0000Qr-00 for grub-devel@gnu.org; Thu, 07 Apr 2011 14:09:50 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.72) (envelope-from ) id 1Q7o22-00063r-CD for grub-devel@gnu.org; Thu, 07 Apr 2011 14:09:50 +0200 From: Goswin von Brederlow To: The development of GNU GRUB Date: Thu, 07 Apr 2011 14:09:50 +0200 Message-ID: <87r59efek1.fsf@frosties.localnet> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1+eQmZqp2517qISwo+6ZonP58xPMw7XU3kTRdyW ekCJ+oB2U6MMriD0v4UQeOS45CgIAJSxEG1871AXFb413lFxqY MpdC7zQCk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Subject: Would a cleanup+extending of docs/multiboot.h be acceptable? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2011 12:09:55 -0000 Hi, I've been working on a 32bit->64bit trampoline based on the example kernel that just switches to 64bit mode and executes a real kernel passed as module. As real kernel I want to use grubs example kernel as well to just verify the multiboot infos passed through the trampoline are intact. And there I hit a problem. The docs/multiboot.h does not use the types set out in the multiboot specs: typedef struct multiboot_header { unsigned long magic; unsigned long flags; unsigned long checksum; ... All of those should be u32. But long is 32bit on 32bit cpus and 64bit on 64bit cpus. Since I want to reuse the multiboot specs for 64bit as much as possible I would like to change the code like this: typedef unsigned int u32; typedef struct multiboot_header { u32 magic; u32 flags; u32 checksum; ... I would also like to expand the multiboot.h file to cover the full specs and #define all the bits and masks and not just those used in the example. Basically join the stage2/mb_header.h and stage2/mb_info.h (and replace 'unsigned *' types with 'u*'). That way the multiboot.h would be better reusable for people implementing their own multiboot compliant bootloader or kernel. Would a change like that be acceptable? If so I could provide patches for further review. Otherwise I won't bother and just make my own multiboot.h file. Also would you be interested in the 32->64bit trampoline and 64bit example kernel for inclusion in grub? The trampoline is based on the example kernel with a few lines added to boot.S and kernel.c to jump to 64bit mode and call the 64bit entry point. The 64bit kernel needs some changes to kernel.c (varargs for printf), which I think can be made to work for 32bit and 64bit, and a boot64.S similar to boot.S but rewritten for 64bit. What I propose would be to have boot.S, boot64.S and kernel.c with some #ifdef lines to switch between 32bit kernel, 32bit->64bit trampoline and 64bit kernel mode. MfG Goswin PS: It is still work-in-progress but I can already execute the 64bit kernel and everything works but printf (varargs issue I believe).