From: adrian15 <adrian15@raulete.net>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: map command for grub2 draft
Date: Mon, 11 Jun 2007 16:45:40 +0200 [thread overview]
Message-ID: <466D6014.7090205@raulete.net> (raw)
In-Reply-To: <4668259D.9090701@raulete.net>
adrian15 escribió:
> 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 ?
I ask the question again.
I've begun to implement commands/i386/pc/map.c (I suppose the map.c is
pc specific althought I am not sure).
The question is how do I get the bios number for a given hard disk?
Thank you. You know hd0 is usually 0x80, that's the number that I want.
Here is the source code written so far which I have not compiled.
adrian15
static grub_err_t
grub_cmd_map (struct grub_arg_list *state __attribute__ ((unused)),
int argc, char **args)
{
grub_disk_t map_disk_1,map_disk_2;
if (argc != 2)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Two devices required");
map_disk_1 = grub_disk_open (args[0]);
if (! map_disk_1)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown 1st disk");
map_disk_2 = grub_disk_open (args[1]);
if (! map_disk_2)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown 2nd disk");
/* How do I get the BIOS number for a given disk */
next prev parent reply other threads:[~2007-06-11 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 15:34 map command for grub2 draft adrian15
2007-06-11 14:45 ` adrian15 [this message]
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=466D6014.7090205@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.