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