1 ;; -----------------------------------------------------------------------
3 ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
5 ;; This program is free software; you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ;; Boston MA 02111-1307, USA; either version 2 of the License, or
9 ;; (at your option) any later version; incorporated herein by reference.
11 ;; -----------------------------------------------------------------------
16 ;; Command line parser code
21 ; -------------------------------------------------------------------------
22 ; getcommand: Get a keyword from the current "getc" file and match it
23 ; against a list of keywords (keywd_table). Each entry in
24 ; that table should have the following form:
25 ; <32 bit hash value> <16 bit handler offset>
27 ; The handler is called, and upon return this function
28 ; returns with CF = 0. On EOF, this function returns
30 ; -------------------------------------------------------------------------
34 call skipspace ; Skip leading whitespace
36 jc .find ; End of line: try again
38 ; Do this explicitly so #foo is treated as a comment
39 cmp al,'#' ; Leading hash mark -> comment
42 or al,20h ; Convert to lower case
43 movzx ebx,al ; Hash for a one-char keyword
49 cmp al,' ' ; Whitespace
59 call ungetc ; Return nonwhitespace char to buf
66 lodsd ; Skip entrypoint/argument
69 ; Otherwise unrecognized keyword
76 mov al,10 ; Already at EOL
81 .found_keywd: lodsw ; Load argument into ax
89 .skipline: cmp al,10 ; Search for LF
96 err_badcfg db 'Unknown keyword in configuration file.', CR, LF, 0
97 err_noparm db 'Missing parameter in configuration file.', CR, LF, 0
101 vk_size equ (vk_end + 3) & ~3
102 VKernelBuf: resb vk_size ; "Current" vkernel
103 AppendBuf resb max_cmd_len+1 ; append=
104 Ontimeout resb max_cmd_len+1 ; ontimeout
105 Onerror resb max_cmd_len+1 ; onerror
106 KbdMap resb 256 ; Keyboard map
107 FKeyName resb MAX_FKEYS*FILENAME_MAX ; File names for F-key help
108 KernelCNameLen resw 1 ; Length of unmangled kernel name
109 InitRDCNameLen resw 1 ; Length of unmangled initrd name
111 KernelName resb FILENAME_MAX+1 ; Mangled name for kernel
112 KernelCName resb FILENAME_MAX+2 ; Unmangled kernel name
113 InitRDCName resb FILENAME_MAX+2 ; Unmangled initrd name
115 KernelName resb FILENAME_MAX ; Mangled name for kernel
116 KernelCName resb FILENAME_MAX ; Unmangled kernel name
117 InitRDCName resb FILENAME_MAX ; Unmangled initrd name
119 MNameBuf resb FILENAME_MAX
120 InitRD resb FILENAME_MAX