From f4f69c52bfdac6a71e090006198f5f81069c5544 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Thu, 9 Apr 2009 11:09:55 +0200 Subject: gfxboot: parse DEFAULT keywork in syslinux config file The gfxboot COM module currently ignores the DEFAULT entry set in syslinux config file and always default to 0 instead. This patch parses DEFAULT entries in the config file and set the default entry accordingly. Signed-off-by: Christophe Fergeau Signed-off-by: H. Peter Anvin --- modules/gfxboot.asm | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/modules/gfxboot.asm b/modules/gfxboot.asm index 7640914b..e3aed13f 100644 --- a/modules/gfxboot.asm +++ b/modules/gfxboot.asm @@ -544,8 +544,8 @@ gfx_setup_menu: mov di,[menu_seg] mov [menu_desc+menu_ent_list+2],di - mov word [menu_desc+menu_default],0 - mov [menu_desc+menu_default+2],di + mov word [menu_desc+menu_default],dentry_buf + mov [menu_desc+menu_default+2],cs mov di,256 mov [menu_desc+menu_arg_list],di @@ -699,6 +699,17 @@ parse_config: pop si jz .do_label + push si + push di + xor ecx,ecx + mov si,configbuf + mov di,default_keyword+1 + mov cl, byte [default_keyword] + call memcmp + pop di + pop si + jz .do_default + .nextline: call skipline jmp .read @@ -723,6 +734,22 @@ parse_config: jmp .read +.do_default: + call skipspace + jz .eof + jc .noparm + call ungetc + push es + push di + push cs + pop es + mov di,dentry_buf + call getline + pop di + pop es + + jmp .read + .eof: .noparm: ret @@ -854,6 +881,7 @@ configbuf times trackbufsize db 0 ungetc_cnt db 0 ungetcdata db 0 label_keyword db 6,'label',0 +default_keyword db 7,'default',0 label_cnt dw 0 msg_progname db 'gfxboot: ',0 @@ -875,6 +903,8 @@ gfx_slash db '/', 0 db0 db 0 max_cmd_len equ 2047 command_line times max_cmd_len+2 db 0 +dentry_buf times 512 db 0 +dentry_buf_len equ $ - dentry_buf ; menu entry descriptor menu_entries equ 0 -- cgit v1.2.1