1 ;; -----------------------------------------------------------------------
3 ;; Copyright 1994-2002 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
97 vk_size equ (vk_end + 3) & ~3
98 VKernelBuf: resb vk_size ; "Current" vkernel
99 AppendBuf resb max_cmd_len+1 ; append=
100 Ontimeout resb max_cmd_len+1 ; ontimeout
101 Onerror resb max_cmd_len+1 ; onerror
102 KbdMap resb 256 ; Keyboard map
103 FKeyName resb 10*FILENAME_MAX ; File names for F-key help
104 KernelCNameLen resw 1 ; Length of unmangled kernel name
105 InitRDCNameLen resw 1 ; Length of unmangled initrd name
107 KernelName resb FILENAME_MAX+1 ; Mangled name for kernel
108 KernelCName resb FILENAME_MAX+2 ; Unmangled kernel name
109 InitRDCName resb FILENAME_MAX+2 ; Unmangled initrd name
111 KernelName resb FILENAME_MAX ; Mangled name for kernel
112 KernelCName resb FILENAME_MAX ; Unmangled kernel name
113 InitRDCName resb FILENAME_MAX ; Unmangled initrd name
115 MNameBuf resb FILENAME_MAX
116 InitRD resb FILENAME_MAX