From: adrian15 <adrian15@raulete.net>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: map command for grub2 draft
Date: Thu, 07 Jun 2007 17:34:53 +0200 [thread overview]
Message-ID: <4668259D.9090701@raulete.net> (raw)
I want to implement the map command for grub2 as long as it is an
interesting thing for stupid windows oses and because it's the clue for
making an "usbshift" equivalent command (See Super Grub Disk usbshift
command for more details).
1st) Where to save an array?
=============================
If I mimic the grub legacy map command I need to save an array with the
map definitions.
static unsigned short bios_drive_map[DRIVE_MAP_SIZE + 1];
So that each time I call something like:
map (hd0) (hd1)
it modifies this vector.
Any example on where should I define this vector so that I can use it
from each command ?
2nd) boot_func and actual mapping
====================================
If you look at grub legacy boot command
case KERNEL_TYPE_CHAINLOADER:
/* Chainloader */
/* Check if we should set the int13 handler. */
if (bios_drive_map[0] != 0)
{
int i;
/* Search for SAVED_DRIVE. */
for (i = 0; i < DRIVE_MAP_SIZE; i++)
{
if (! bios_drive_map[i])
break;
else if ((bios_drive_map[i] & 0xFF) == saved_drive)
{
/* Exchage SAVED_DRIVE with the mapped drive. */
saved_drive = (bios_drive_map[i] >> 8) & 0xFF;
break;
}
}
/* Set the handler. This is somewhat dangerous. */
set_int13_handler (bios_drive_map);
}
gateA20 (0);
boot_drive = saved_drive;
chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr);
break;
you will see that among other things it detects if you want to do a
chainloader boot. If you do a chainloader boot it checks the
bios_drive_map array,... run some BIOS calls so that there's an actual
map and then it finally boots.
When I told marco_g that I want to modificy grub2's boot command he
became scared because the boot command was arquitecture specific (or
maybe not, I actually did not understood what he meant) and as long as I
understood I was not meant to modify it.
how should I implement this then?
adrian15
next reply other threads:[~2007-06-07 15:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 15:34 adrian15 [this message]
2007-06-11 14:45 ` map command for grub2 draft adrian15
2007-06-15 18:22 ` Marco Gerards
2007-06-15 18:45 ` Bean
2007-06-15 18:56 ` Marco Gerards
2007-06-15 19:10 ` Bean
2007-06-16 17:19 ` adrian15
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=4668259D.9090701@raulete.net \
--to=adrian15@raulete.net \
--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.