From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JDlgo-0002b3-M5 for mharc-grub-devel@gnu.org; Sat, 12 Jan 2008 14:06:42 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JDlgm-0002Yv-F6 for grub-devel@gnu.org; Sat, 12 Jan 2008 14:06:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JDlgl-0002Xq-G6 for grub-devel@gnu.org; Sat, 12 Jan 2008 14:06:39 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDlgl-0002Xh-Bw for grub-devel@gnu.org; Sat, 12 Jan 2008 14:06:39 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JDlgl-0005Ns-06 for grub-devel@gnu.org; Sat, 12 Jan 2008 14:06:39 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JDle7-0004Of-Ax; Sat, 12 Jan 2008 20:03:56 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JDlZ5-0003Ke-Gz; Sat, 12 Jan 2008 19:58:43 +0100 Date: Sat, 12 Jan 2008 19:58:43 +0100 From: Robert Millan To: Mitch Bradley Message-ID: <20080112185843.GA12074@thorin> References: <20080112134230.GA30139@thorin> <20080112140020.GB30139@thorin> <4789009B.8030403@laptop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4789009B.8030403@laptop.org> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Cc: grub-devel@gnu.org, devel@lists.laptop.org Subject: Re: GRUB on OLPC / XO 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: Sat, 12 Jan 2008 19:06:40 -0000 On Sat, Jan 12, 2008 at 08:02:03AM -1000, Mitch Bradley wrote: > Robert Millan wrote: > >Some comments on things that need polishing. Some are more addressed at > >one > >of the two lists than the others, but feel free to join in either case. > > > >(also, if you feel this is off-topic in olpc-devel, feel free to ki^W let > >me know) > > > >btw, Mitch mentioned to me on IRC that the ELF loader on XO has some > >"weird" > >modifications to support Minix. Is this documented somewhere? > > > > I was mistaken about Minix - there are no Minix-specific hacks in the > ELF loader. The only Minix support is a handler for the Minix > filesystem layout, which doesn't affect the ELF loader. > > The ELF loader has two special cases, which are not documented anywhere > except the source code (cpu/x86/pc/olpc/linux.fth : ?memtest-elf-map-in ) : > > a) It recognizes the memtest86 binary that is embedded in OFW, setting > up some special mappings that memtest requires (or at least used to require) > > b) It recognizes the ELF form of the Linux binary and sets up a mapping > from virtual c0xx.xxxx to physical 00xx.xxxx . Normally this isn't > used, because we load the bzImage version of Linux. But OFW can load > the ELF portion of the Linux kernel, without the bzImage wrapper. If > you do it that way, OFW has access to the ELF symbol table and can thus > resolve symbolic names for addresses inside Linux. Ok, thanks for the explanation. It doesn't seem like GRUB would be affected then. > >On Sat, Jan 12, 2008 at 02:42:30PM +0100, Robert Millan wrote: > > > >>+void > >>+grub_exit (void) > >>+{ > >>+ /* Trap to Open Firmware. */ > >>+ /* FIXME. */ > >>+ > >>+ for (;;); > >>+} > >> > > > >We used to run "trap" insttruction on powerpc. I assume for exitting via > >trap > >on i386 we need to generate an interrupt; I'm just not sure which is the > >right > >number for it. > > > > To exit to OFW, call the "exit()" client service. I see. Is this one expected to work everywhere including Apple etc? We'd probably be better off ditching the __asm__("trap") altogether. > To reboot, call "boot()" with an empty string as the single IN argument. For this we used "reset-all". The standard seems to indicate both are equally fine; is that it? > To power off, call "interpret()" with a cmd string of "power-off". We used "shut-down" for this one. Unfortunately not mentioned in the standard (not sure where it came from). Is there a portable way to do this? > >> /* Load pre-loaded modules and free the space. */ > >> grub_register_exported_symbols (); > >>- grub_load_modules (); > >>+// grub_load_modules (); > >> > > > >This generates an out of bounds exception. GRUB puts modules above _end > >(0x1000-aligned). Is access to that address allowed by OFW ? > > > > The ELF loader will map in anything listed in a program header of type > PT_LOAD , according to the vaddr, memsize, and filesize fields. If the > module area is covered by such a program header, they should be accessible. Ah, that hints at a known bug in our ELF generator (affecting LinuxBI^W Coreboot). I'll check if the patches for that one help. > >> grub_ieee1275_finddevice ("/options", &options); > >> rc = grub_ieee1275_get_property (options, "real-mode?", &realmode, > >> sizeof realmode, 0); > >>- if ((rc >= 0) && realmode) > >>+// if ((rc >= 0) && realmode) > >> grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_REAL_MODE); > >> > > > >This OFW operates in what GRUB calls "real mode" (not to be confused with > >x86 realmode!), but /options/real-mode? doesn't exist. Should we probe > >for the actual feature (/chosen/mmu IIRC), probe for firmware version, or > >#ifdef it for x86 CPUs? > > > > This OFW operates in virtual mode, but happens to have an identity > mapping of low memory for convenience. /chosen/mmu is set to 0, at least on my (qemu) environment. Should clients interpret this as identity mapping, or is this unintended? Thank you! -- Robert Millan I know my rights; I want my phone call! What use is a phone call, if you are unable to speak? (as seen on /.)