Hi OKUJI,
Nice work, i really appreciate being able to switch from the dumb BIOS
console->serial mapping i'm using now, to a native implementation of
serial access within GRUB. I think your work is really a step forward
for people with embedded/server boxes connected to serial consoles.
Playing around happily with the newest checkout, i found&fixed:
* one small but serious bug
- mistake in --speed handling of builtins.c:serial_func
* some minor deficiencies in stage2.c
- busy loop after grub_timeout stopped
- consistent appearance of the highlighted line
- consistent help text and handling of UP-ARROW and DOWN-ARROW
character
Details see ChangeLog and diffs below.
I played around with a `menu.lst' starting like:
# go to serial device
serial --unit=0 --speed=19200 --word=8 --parity=no --stop=1
terminal --timeout=0 serial
which is all default except SPEED, however, IMHO, some example like
this should go to the manual, anyway.
As i already said once on this list, i'd really like to contribute
more time to this project, however, quiet nights like tonite are rare,
so time is limited.
Keep on hacking,
Klaus
--
email: [EMAIL PROTECTED]
Klaus Reichl [EMAIL PROTECTED]
Danhausergasse 8/16 voice: +43 (1) 27722 / 3884 (job)
A-1040 Wien +43 (1) 94 137 94 (private)
+43 (6991) 94 137 94 (mobile)
$ cvs diff -u grub
cvs server: Diffing grub
Index: grub/ChangeLog
===================================================================
RCS file: /home/cvs/grub/ChangeLog,v
retrieving revision 1.305
diff -u -r1.305 ChangeLog
--- grub/ChangeLog 2000/08/31 12:48:06 1.305
+++ grub/ChangeLog 2000/08/31 22:43:53
@@ -1,3 +1,21 @@
+2000-09-01 Klaus Reichl <[EMAIL PROTECTED]>
+
+ * stage2/stage2.c (run_menu): Setup and use disp_up, disp_down
+ depending on the terminal mode.
+ (run_menu): Allow '^' (resp. 'p') and 'v' (resp 'n') keys we
+ described in our help above (resp. authors preferences).
+
+2000-08-31 Klaus Reichl <[EMAIL PROTECTED]>
+
+ * stage2/stage2.c (set_line): Go back one char, which is
+ consistent with the original situation, when a timeout was
+ running.
+ (run_menu): if GRUB_TIMEOUT is stopped don't loop busy over
+ CHECKKEY, just relax in GETKEY.
+
+ * stage2/builtins.c (serial_func): --speed handling: corrected
+ typo: set SPEED instead of PORT.
+
2000-08-31 OKUJI Yoshinori <[EMAIL PROTECTED]>
* stage2/builtins.c (terminal_func): Added two new options,
cvs server: Diffing grub/debian
cvs server: Diffing grub/docs
cvs server: Diffing grub/e2fs_stage1_5
cvs server: Diffing grub/fat_stage1_5
cvs server: Diffing grub/ffs_stage1_5
cvs server: Diffing grub/grub
cvs server: Diffing grub/lib
cvs server: Diffing grub/netboot
cvs server: Diffing grub/shared_src
cvs server: Diffing grub/stage1
cvs server: Diffing grub/stage2
Index: grub/stage2/builtins.c
===================================================================
RCS file: /home/cvs/grub/stage2/builtins.c,v
retrieving revision 1.75
diff -u -r1.75 builtins.c
--- grub/stage2/builtins.c 2000/08/31 12:48:06 1.75
+++ grub/stage2/builtins.c 2000/08/31 22:44:08
@@ -2685,7 +2685,7 @@
if (! safe_parse_maxint (&p, &num))
return 1;
- port = (unsigned int) num;
+ speed = (unsigned int) num;
}
else if (grub_memcmp (arg, "--port=", sizeof ("--port=") - 1) == 0)
{
Index: grub/stage2/stage2.c
===================================================================
RCS file: /home/cvs/grub/stage2/stage2.c,v
retrieving revision 1.20
diff -u -r1.20 stage2.c
--- grub/stage2/stage2.c 2000/08/26 17:28:27 1.20
+++ grub/stage2/stage2.c 2000/08/31 22:44:10
@@ -195,6 +195,8 @@
set_attrib (attr);
}
}
+
+ gotoxy (74, y);
}
/* Set the attribute of the line Y to normal state. */
@@ -235,6 +237,16 @@
{
int c, time1, time2 = -1, first_entry = 0;
char *cur_entry = 0;
+ int disp_up = DISP_UP;
+ int disp_down = DISP_DOWN;
+
+#ifdef SUPPORT_SERIAL
+ if (terminal & TERMINAL_SERIAL)
+ {
+ disp_up = ACS_UARROW;
+ disp_down = ACS_DARROW;
+ }
+#endif /* SUPPORT_SERIAL */
/*
* Main loop for menu UI.
@@ -303,7 +315,7 @@
#else
grub_printf ("\n\
Use the %c and %c keys to select which entry is highlighted.\n",
- DISP_UP, DISP_DOWN);
+ disp_up, disp_down);
#endif
if (! auth && password)
@@ -356,7 +368,12 @@
grub_timeout--;
}
- if (checkkey () != -1)
+ /* check for a keypress, however if TIMEOUT has been expired
+ (GRUB_TIMEOUT == -1) relax in GETKEY even if no key has been
+ pressed.
+ This avoids polling (relevant in the grub-shell and later on
+ in grub if interrupt driven I/O is done). */
+ if ((checkkey () != -1) || (grub_timeout == -1))
{
c = translate_keycode (getkey ());
@@ -369,7 +386,10 @@
gotoxy (74, 4 + entryno);
}
- if (c == 16)
+ /* We told them above (at least in SUPPORT_SERIAL) to use
+ '^' or 'v' so accept these keys
+ BTW: 'n' & 'p' are also nice */
+ if ((c == 16) || (c == '^') || (c == 'p'))
{
if (entryno > 0)
{
@@ -386,7 +406,8 @@
set_line_highlight (4, first_entry + entryno, menu_entries);
}
}
- if (c == 14 && (first_entry + entryno + 1) < num_entries)
+ if (((c == 14) || (c == 'v') || (c == 'n'))
+ && (first_entry + entryno + 1) < num_entries)
{
if (entryno < 11)
{
cvs server: Diffing grub/stage2_debug
cvs server: Diffing grub/util
--------------------- END OF IT --------------------------------------------