Replacing the legacy 'map' command
Quoted 26 lines
The cooperation between modules is not hard, but I think
map -first (hdx) will be more useful. Such command just swaps hd0 and hdx drives. This also covers the scenarios when we chainload something else than first sector of given partition.And maybe we can also consider following syntax:
map -pos (hd2) (hd0) (hd4)
with meaning:
hd0->hd1,
hd1->nothing
hd2->hd0,
hd3 not touch,
hd4->hd2
I.e. positional syntax, first argument is mapped to (hd0), second to (hd1),
and so on.This syntax will be sufficient most times and writing
chainloader --automap (hd1,0)+1
is same as writing
map -first (hd1)
chainloader (hd1,0)+1
or
setting grub root to (hd1,0)
map -root
chainloader +1
Quoted 2 lines
--
Tomas Ebenlendr
Well, such "additional" UIs will be useful, and there seems to be some consensus on how this should be done:
1.- There should be a new command called somethink like "drivemap"
and based on a new module that would provide the drive mapping capabilities.
2.- This module would be available in x86/PC (and, if it is ever
split from it, AMD64/PC), and would work by saving the user requested mappings and installing a pre-boot GRUB routine.
3.- Such a routine would, before the execution of grub_X_real_boot,
install the appropate ISRs (which are mostly available in GRUB Legacy code) to make the mappings effective, no matter what the OS loader is
- chain, multiboot, etc.
Therefore, if there are no objections to this plan, I can start the implementation (when I finish my exams, of course u_u). I think I will initially place the ISR installation code in grub_chainloader_real_boot in order to have a working version right away, then move it away into its own function and, however the way, "register" it with the boot routines so that it is executed as mentioned above. Other modules/commands would be later modified to add drivemap-related functionality. Is there any site/document (apart from the sources themselves) in which I can learn more about the internals of GRUB2 and, specifically, the "boot" command sequence?.
Habbit
---no PGP signature, I'm writing from the uni---
Quoted 3 lines · Javier Martín
drivemap-related functionality. Is there any site/document (apart from the sources themselves) in which I can learn more about the internals of GRUB2 and, specifically, the "boot" command sequence?.
GRUB 2 Wiki will serve the purpose for developer documentation:
If not there, then use the source luke ;)