From: "Vesa Jääskeläinen" <chaac@nic.fi>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Reimplementing the legacy "map" command
Date: Fri, 06 Jun 2008 19:31:05 +0300 [thread overview]
Message-ID: <48496649.6060905@nic.fi> (raw)
In-Reply-To: <1212701730.3141.25.camel@localhost>
Javier Martín wrote:
> Hi again everybody. After some hacking with the GRUB internals, I've
> completed a reimplementation of the legacy "map" command that allowed
> the BIOS drives to have their numbers reassigned, in order to boot OSes
> whose boot code requires their installation to be located in the first
> HD (BIOS drive 0x80).
>
> This implementation gets next to the status of the command in GRUB
> Legacy, with the main changes being:
>
> * Command: now called "drivemap", attending to suggestions in this list
> * UI: the less complete part of the job. The syntax is now as follows:
> drivemap (hd1) 0x80 # Makes (hd1) appear as the first BIOS drive
> i.e. the second argument is now any BIOS drive number instead
> of another device. This change is in part due to my lack of time,
> but also because others here pointed that it would be useful to
> allow arbitrary mappings. If required, old syntax could be
> reimplemented in short time.
> * Backend: the command is now a module, but there is also code in the
> several files like the machine-specific loader.S, the loader
> header file and the makefiles.
> * Backend: a preboot hook system has been added to the loader backend,
> allowing modules to register functions to be run just before
> the grub_X_real_boot function is called. The drivemap module
> uses this new functionality to get its install_int13_handler
> function to be called before booting the target OS without
> creating chaos in GRUB itself.
> * Functionality: the new module is independent of chainloader, so its
> functions can be applied with any target loader. What
> effects will this have, I don't know.
>
> This patch is just a preliminary version that has been tested only in
> QEMU and Bochs, not on real hardware because I'm cut off from x86
> computers from the time being (I'm running on a PPC mac now). I will be
> back to town (and to my olde amd64 box) this weekend, but I wanted to
> submit this so others could scrutinize it for obvious mistakes, and
> maybe test it.
>
> I've tried to respect the style rules I've seen, but please note that
> this is my first patch. Cheers!
Did you forgot something from this patch :) ?
Anyway... Couple of comments. No chatting on the code. No commented out
code unless there is a really good reason for it. Try to move int13h
handle to module not to kernel. We do not want to put anything more to
kernel unless there is a really good reason to do so.
+/* This is NOT a typo: we just want this "void" var in order to take its
+ * address with &var - used for relative addressing within the int13
handler */
+extern void EXPORT_VAR(grub_drivemap_int13_handler_base);
Create new type for it. Or use variable type that eats that space. This
way you do not need this comment to confuse people.
Please do not include .mk files on next patch.
Abort on error?... Ok... do you go to deinit everything before that was
successfully installed or just give warning or ?
next prev parent reply other threads:[~2008-06-06 16:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-05 21:35 [PATCH] Reimplementing the legacy "map" command Javier Martín
2008-06-06 16:31 ` Vesa Jääskeläinen [this message]
2008-06-07 12:55 ` Javier Martín
2008-06-07 15:02 ` Vesa Jääskeläinen
2008-06-07 15:52 ` Javier Martín
2008-06-08 18:47 ` Javier Martín
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48496649.6060905@nic.fi \
--to=chaac@nic.fi \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.