[syslinux] Problems with menu.c32,and some feature request for menu.c32

Eugene Pressley EPressley at abtech.edu
Mon Mar 28 08:02:06 PST 2005


Well in those three days I did identify and correct the problem with using a number (0-9) as the hot key.  The following is the section of code in menu.c32 responsible for displaying the menu entries:

display_entry(const struct menu_entry *entry, const char *attrib,
	      const char *hotattrib, int width)
{
  const char *p = entry->displayname;

  while ( width ) {
    if ( *p ) {
      if ( *p == '^' ) {
	p++;
/*	if ( *p && (unsigned char)*p == entry->hotkey ) { */
	  fputs(hotattrib, stdout);
	  putchar(*p++);
	  fputs(attrib, stdout);
	  width--;
/*	} */
      } else {
	putchar(*p++);
	width--;
      }
    } else {
      putchar(' ');
      width--;
    }
  }
}

As you can see I have commented out two lines that compse an If statement.  This was preventing numbers from being displayed as highlighted.  With this mod, if you use a number as a hot key it is properly highlighted on the screen.

Regarding the response from Problem #2:
I realize that the menu.c32 is new and most likely a beta program, however I wanted to report the problem that I encountered.  I do not have a lot of knowlege of the C language, however I do have some programming knowledge.  I would suspect that the problem is where the config file is read.  I assume that this is a loop, reading each line in the config file.  I am assuming that during the loop a var used to store the password is not being cleared at the top of each loop.  This would create the result that I am seeing.  I am most likely wrong, since my knowledge of C is lacking.

Regarding the response from Request #1:
I understand the need to keep bloat down, but I am unclear how adding a visible display of a timer that is already a part of the code would add a significant amout of bloat to the code base.

Regarding the response from Request #2:
I had enough menu entries that the default settings of menu.c32 created a scroll bar on the display window.  I did not want this and the only way to correct it was to change the "#define MENU_ROWS	12" to increase the number of rows displayed.

Regarding the response from Request #3
I did not think it would be difficult to modify the code to allow for this.  In the section that process the hotkey what could be done is to first check to see if a global menu command, say "MENU HOTKEYAUTO=TRUE", exists.  If it does then highlight the menu item, as it would normally but instead of jumping back to the key processing section jump to the menu execution section.

I am in tinkering with the original source, as is evidenced by the possible resolution to problem #1, if I resolve any of the above issues on my own I will post the results to the list serve.  However, since I don't have a lot of C knowlegde any help would be greatly appreciated.

>>> "Geert Stappers" <stappers at stappers.nl> 3/28/2005 8:47 AM >>>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Mar 27, 2005 at 01:13:48AM -0500, Eugene Pressley wrote:
> I am resending this message because I have not recieved any response back.

And what have you done in those three days ?

> I have found two bugs in the menu.c32 utility, part of the
> syslinux-3.08-pre5 build, and have a couple of requests.
> 
> Problem 1:
> 
> If you use the ^ symbol to define a number as a hotkey,
> ex. MENU LABEL ^1 Option #1 , the menu will not print the number
> highlighted.  It will use it as a hot key, it just will not highlight
> it.  It does highlight the hotkey if a letter, A-Z, is specified.

You could have reply on the original posting with
chances on the syslinux manual where this behaviour is documented.

> Problem 2:
> 
> When the statement "MENU PASSWD" is used to define a password the label
> that it is used in and all following labels require that password.
> All preceding LABELs do not require a password.

Sounds to me like an interresting feature.
Normal boot doesn't need a password
and special boots do.

Those who want "only boot with password" should place "MENU PASSWD" on
top of the config file.

> 
> Request #1:
> When a timeout is spedified it would be nice if a countdown timer could
> be place on the screen, say the lower right hand corner.
> This could be enabled/disabled through a menu option.

IMNSHO it is very harsh to ignore a polite request.
So less harsh is to say: That is a request for adding bloat.

> Request #2:
> It would be nice if the following vars in the menu.c could be set in
> the config file so the program would not have to be recompiled
> to change these values.
> #define WIDTH		80
> #define MARGIN		10
> #define PASSWD_MARGIN	3
> #define MENU_ROWS	12
> #define TABMSG_ROW	18
> #define CMDLINE_ROW	20
> #define END_ROW		24
> #define PASSWD_ROW	11

And when or how benefits the bootloader from this?
Please elaborate the request.

> Request #3:
> Add an option to the config file that would enable HOTKEYING.
> What is hotkeying?
> Currently when you press a hotkey the menu item is highlighted and
> then you have to press enter to execute the menu item.
> HOTKEYING would, when the hotkey is pressed,
> highlight the menu item and automatically execute the menu item
> without the need to press the enter key.

I have no clue what the impact of that request is.
It will demand a (huge?) change on the user input routines.



Cheers
Geert Stappers

Who thinks that a bootloader should do bootloading.
(and when you want more, then do more)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCSApNOSINbgwa/7sRAvsHAJ49IRziSS5vB7/Wt+M1RVCqJwi2PQCgszSS
b/OgPGMfL6bFCI8jtzeYloY=
=ss0p
-----END PGP SIGNATURE-----

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX at zytor.com 
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux 
Please do not send private replies to mailing list traffic.






More information about the Syslinux mailing list