Skip to content

Commit

Permalink
. 修正 timeout 函数 issues #418
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya2007 committed Jul 1, 2023
1 parent f7219af commit 4fe13e6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
3 changes: 3 additions & 0 deletions ChangeLog_chenall.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
更新说明:
2023-07-01 (yaya)
修正 timeout 函数。issues #418

2023-06-23 (yaya)
碎片数由39增加到126。
避免分区项空洞。issues #416
Expand Down
4 changes: 2 additions & 2 deletions stage2/asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -15056,7 +15056,7 @@ ENTRY(console_getkey)

cmpl $0xFFFFFFFF, %edx
jne 1f
pushl $20
pushl $1
call defer
popl %eax
cmpb $0, beep_enable
Expand Down Expand Up @@ -15217,7 +15217,7 @@ ENTRY(console_checkkey)
9:
cmpl $0xFFFFFFFF, %edx
jne 3f
pushl $20
pushl $1
call defer
popl %eax
cmpb $0, beep_enable
Expand Down
21 changes: 9 additions & 12 deletions stage2/stage2.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,10 +978,8 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
if (! show_menu)
{
/* Get current time. */
// while ((time1 = getrtsecs ()) == 0xFF)
// ;
if (grub_timeout >= 0)
timeout_enable = 1;
while ((time1 = getrtsecs ()) == 0xFF)
;

while (1)
{
Expand Down Expand Up @@ -1018,9 +1016,7 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h

/* If GRUB_TIMEOUT is expired, boot the default entry. */
if (grub_timeout >=0
// && (time1 = getrtsecs ()) != time2
&& time1 != time2
/* && time1 != 0xFF */)
&& (time1 = getrtsecs ()) != time2)
{
if (grub_timeout <= 0)
{
Expand Down Expand Up @@ -1187,8 +1183,9 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
if (menu_init_script_file[0] != 0 )
command_func(menu_init_script_file,BUILTIN_MENU);
/* XX using RT clock now, need to initialize value */
// while ((time1 = getrtsecs()) == 0xFF);
if (grub_timeout >= 0)
if (!ext_timer)
while ((time1 = getrtsecs()) == 0xFF);
else if (grub_timeout >= 0)
timeout_enable = 1;

old_c = 0;
Expand All @@ -1202,9 +1199,9 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
/* Initialize to NULL just in case... */
//cur_entry = NULL;
//cur_entry = menu_entries; /* for modified menu */

// if (grub_timeout >= 0 && (time1 = getrtsecs()) != time2 /* && time1 != 0xFF */)
if (grub_timeout >= 0 && time1 != time2 /* && time1 != 0xFF */)
if (grub_timeout >= 0 &&
((!ext_timer && ((time1 = getrtsecs()) != time2)) ||
(ext_timer && time1 != time2)))
{
if (grub_timeout <= 0)
{
Expand Down

0 comments on commit 4fe13e6

Please sign in to comment.