Grub4Dos Default Reset Command?
Posted 04 February 2012 - 11:45 PM
I'm not a programmer but I suspect there is a way to accomplish what I want. I'm just unsure of how to approach it or even how to search for an answer.
Could someone point me in the right direction please? (Or tell me it can't be done!)
Posted 04 February 2012 - 11:53 PM
You cannot change the default file before plop loads the menu for a 2nd time or it will not autorun. So I suspect the answer is to set the timeout to 10 seconds so you remember to press a cursor key before the timeout runs the menu item again!
I have found that Plop does not run on some systems (i3 Acer Aspire 7741 for instance) - so in this case your automenu would always hang! I think it is better to have a separate menu entry to load plop and leave it up to the user - you can always give it a title of 'Use this option if you get slow performance' and use the hiddenusb parameter so it reboots from USB again.
Posted 06 February 2012 - 02:58 AM
Like most of us, I usually have 2 or 3 things/jobs/pc's running at the same time and I often will hit 'reboot' and then turn to another PC and pick up where I left off on that job while the first reboot completes.
Setting the timeout value to anything very high somewhat defeats the benefits of using Plop. And of course getting around the issue of Plop killing the USB keyboard the the real reason for this topic.
My problem is the inability to ever reset the default file back to it's virgin state of all nuls in the first line (in which case the PC boots and the highlighted menu selection is whatever is the first 'title' at the top of the G4D menu, usually a title-only option like 'My Magic Boot Drive', and just sits there with no timer running) without manually editing it.
The next best alternative would be the ability to, at some point, set the default so it points to a menu title that will essentially do nothing when it times out , thereby making the menu effectively manual so I don't have to reboot if i miss the 10-second timeout window.
Anyway, I appreciate your responses, but I'm probably beating a dead horse with this whole thing- part of my obsessive/compulsive behavior problem. Guess it's time to move on
Posted 06 February 2012 - 10:42 AM
# suppress commands echoing values to display debug off timeout 1 default /default # if Plop is not loaded then always set default to menu 0 and no timeout /plpbt/bios int=0x13 eax=0x504c6f50 ebp=0x43484b44 > (md)0x300+1 && cat --locate="EAX=79657320" (md)0x300+1 || echo Plop driver not present && default 0 && tiimeout 0 /plpbt/bios int=0x13 eax=0x504c6f50 ebp=0x43484b44 > (md)0x300+1 && cat --locate="EAX=79657320" (md)0x300+1 && echo Plop driver is loaded! pause --wait=1 title My Magic Key root () title Run Plop and boot DOS find --set-root /default # save this menu number as the default if Plop is not loaded (avoids error message if Plop is loaded) cat --hex --locate="PoLPu@" (md)0x3d0+0x130 > nul && savedefault # if plop is not installed, then run it to reboot from USB in USB 2.0 mode /plpbt/bios int=0x13 eax=0x504c6f50 ebp=0x43484b44 > (md)0x300+1 && cat --locate="EAX=79657320" (md)0x300+1 || pause --wait=3 loading Plop! && kernel /plpbt/plpbt.bin hiddenusb && boot map /dos622.ima (fd0) map --hook map --floppies=1 root (fd0) chainloader /io.sys
Posted 06 February 2012 - 09:29 PM
I made a few changes:
Had to rem the preceding timeout and default commands, used different 'cat' commands, removed the 'echo' commands, modified the second 'cat' command by adding default and timeout settings, and changed the 'Load Plop & DOS' section by making it only check if loaded and savedefault.
#timeout 10 #default /default #debug 1 debug 0 ### # if Plop is not loaded then always set default to menu 0 and no timeout cat --hex --locate="PoLPu@" (md)0x3d0+0x130 > nul || pause --wait=1 Plop driver not present && default 0 && timeout 0 cat --hex --locate="PoLPu@" (md)0x3d0+0x130 > nul $$ pause --wait=1 Plop driver is loaded! && default /default && timeout 2 pause --wait=2 title Complete Boot KeynUse the cursor keys or type in the menu number 1-24 nScroll down for Live System Disks root () title ------------------ find --set-root /default # save this menu number as the default if Plop is not loaded (avoids error message if Plop is loaded) cat --hex --locate="PoLPu@" (md)0x3d0+0x130 > nul && savedefault ##### clear
Tutorial 21 on the RMPrepUSB website was very helpful in understanding how this was working. The echo commands displayed nothing, but when I hit 'c' for command mode and typed 'echo test' the 'test' displayed. Is this possibly a result of using a splash image?
Also, I used Tutorial 63 and was wondering if adding the Plop driver would improve install times for W7 and XP (obviously only for the first copying phase) or would it mess up something like drive designations during the process?
Anyway, the end result is it's working just exactly as I envisioned it, thanks to your help.
Posted 06 February 2012 - 09:51 PM
Your menu makes little sense. The statement default /default declares to grub4dos that it should use the file /default to keep the default menu number, but you only set this when plop is loaded, so the default 0 and savedefault statements should give an error?
You also have $$ instead of && - is this a typo?
try it without a splashimage as it may be hiding error messages too.
Posted 07 February 2012 - 01:40 AM
My guess would be that when there is no Plop loaded it sets the variables default and timeout both to zero. It probably doesn't know to look for any 'default' file and just goes to the first menu item (same as when using a virgin default file file with just nulls in the first line). My guess that when I select the 'Win7PE using Plop' and it hits the 'savedefault' command it's default is set to use the /default file. It must be ignoring the '$$' typo and continues executing the rest of the statement and sets the variables, then uses them after the pause --wait=2 line. I'm using 3 or 4 menu items to load different live OS's with Plop (LiveXP, a full version of Win7PE, a minimal version of Win7PE, etc.) and it always goes to the one I've selected after rebooting and loading Plop so I'm guessing it's using the /default location. And after I reboot again it always goes to the first line without any timeout countdown.
It's obviously pure dumb luck that I got it to do what I wanted. But I'm happy.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users