Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Em8im-0004Wn-4t for mharc-grub-devel@gnu.org; Tue, 13 Dec 2005 06:53:28 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Em8ia-0004PB-O3 for grub-devel@gnu.org; Tue, 13 Dec 2005 06:53:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Em8g9-00039X-Eg for grub-devel@gnu.org; Tue, 13 Dec 2005 06:50:51 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Em8fV-0002r4-PZ for grub-devel@gnu.org; Tue, 13 Dec 2005 06:50:06 -0500 Received: from [193.144.10.34] (helo=relay2.udl.es) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Em8hO-0000Vu-DE for grub-devel@gnu.org; Tue, 13 Dec 2005 06:52:02 -0500 Received: from jupiter.udl.net (jupiter.udl.net [172.16.2.2]) by relay2.udl.es (8.13.4/8.13.4) with ESMTP id jBDBnBg5014056 for ; Tue, 13 Dec 2005 12:49:16 +0100 Received: from epssu-23 (eupsu_23 [172.16.3.203]) by jupiter.udl.net (8.11.7p1+Sun/8.11.6) with ESMTP id jBDBaKe26921 for ; Tue, 13 Dec 2005 12:36:20 +0100 (MET) Date: Tue, 13 Dec 2005 12:36:19 +0100 From: "adrian15" To: grub-devel@gnu.org Message-ID: X-Mailer: JBMail 3.2 X-Virus-Scanned: ClamAV 0.87.1/1209/Mon Dec 12 16:48:01 2005 on relay2.udl.es X-Virus-Status: Clean Subject: grub variables semi support on grub legacy X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2005 11:53:26 -0000 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.