[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: map command for grub2 draft

From: adrian15
Subject: Re: map command for grub2 draft
Date: Mon, 11 Jun 2007 16:45:40 +0200
User-agent: Thunderbird (X11/20061107)

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.


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 */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]