I recently sent an email to http://lists.gnu.org/archive/html/bug- grub/2005-12/msg00023.html and nobody answered me.
So... I will continue this message here... because there are some grub legacy developers round here or at least I hope so. I've already begun on implementing variables support on grub legacy. (Sorry code is at home). I've added to share.h ( http://cvs.savannah.gnu.org/viewcvs/grub/grub/stage2/shared.h?rev=1.99 &view=auto ) some BUF and LEN variables to store var1, var2 and var3. I've define and initialized variables on cmain() of stage2.c ( http://cvs.savannah.gnu.org/viewcvs/grub/grub/stage2/stage2.c?rev=1.46 &view=auto) so that every variable has it's first character to 0 (or \0 if you prefer). And then I modify the variables in builtins.c with two new commands: echov N: Shows the contents of a variable. set N contents: Sets contents of a variable to contents. N is a number between 1 and 3. And both commands work. I want to add more variables by using a function that receives a pointer to char... and returns a pointer to char. So that if I read 1 it returns the pointer to var+(VAR_SIZE*(1-1)) and if I read 2 it returns pointer to var+(VAR_SIZE*(2-1)) and so on... so that I do not have to define var1, var2, var3 but var where variables buffer begins. If you have better ideas of implement it or whatever you just say them. In the following weekends I'll try to implement addv to add a variable contents to another one. And adds to add an string to another variable. And what I wanted to ask about the run command which I think I will implement it (For the sake of simplicity) with "run N" ... where N is a variable... and variable can have "configfile (hd0,1)/grub/menu.lst) as contents. Well, waiting for comments. Can I add the variables that I want, with the size (300 currently) that I want or is there a limit size somewhere ? adrian15 P.D. Can anyone explain #define MENU_BUFLEN (0x8000 + PASSWORD_BUF - MENU_BUF) this line of shared.h... Isn't it supposed to be PASSWORD_BUF lesser than MENU_BUF...? Why's this MENU_BUFLEN defined this way? P.D.: I also want to implement a "call" command which loads a configfile let's you select you one option and then configfiles the previous menu. But that's another tale. _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel