* New API call to query features.
* Fix for bug in EBIOS code discovered by Arwin Vosselman.
* NOESCAPE security fix.
+ * Comments are now recognized even without a space following #.
Changes in 3.09:
* gcc4 compilation fix.
sti
call cwritestr ; Expects SI -> error msg
- ; If NOESCAPE is active, then execute the default command
- cmp byte [KbdFlagMask],0
- jz auto_boot ; Default command
- jmp enter_command ; Otherwise command prompt
+ ; Return to the command prompt
+ jmp enter_command
;
; End of abort_check
-# hash
menu
append
default
align 4, db 0
keywd_table:
- keyword hash, pc_comment
keyword menu, pc_comment
keyword append, pc_append
keyword default, pc_default
keyword ontimeout, pc_ontimeout
keyword onerror, pc_onerror
keyword allowoptions, pc_setint16, AllowOptions
- keyword noescape, pc_noescape
+ keyword noescape, pc_setint16, NoEscape
keyword f1, pc_fkey, FKeyName+(0<<FILENAME_MAX_LG2)
keyword f2, pc_fkey, FKeyName+(1<<FILENAME_MAX_LG2)
keyword f3, pc_fkey, FKeyName+(2<<FILENAME_MAX_LG2)
jz .eof ; End of file
jc .find ; End of line: try again
+ ; Do this explicitly so #foo is treated as a comment
+ cmp al,'#' ; Leading hash mark -> comment
+ je .skipline
+
or al,20h ; Convert to lower case
movzx ebx,al ; Hash for a one-char keyword
.read_loop:
jmp crlf ; tailcall
;
-; "noescape" command
-;
-pc_noescape:
- mov byte [KbdFlagMask],0 ; No escape route available...
- ; Fall into pc_getline
-
-;
; Comment line
;
pc_comment: ; Fall into pc_getline
KbdTimeOut dw 0 ; Keyboard timeout (if any)
CmdLinePtr dw cmd_line_here ; Command line advancing pointer
ForcePrompt dw 0 ; Force prompt
+NoEscape dw 0 ; No escape
AllowImplicit dw 1 ; Allow implicit kernels
AllowOptions dw 1 ; User-specified options allowed
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
; Check whether or not we are supposed to display the boot prompt.
;
check_for_key:
- cmp word [ForcePrompt],byte 0 ; Force prompt?
+ cmp word [ForcePrompt],0 ; Force prompt?
jnz enter_command
- mov al,[KbdFlags]
- test al,[KbdFlagMask]
+ test byte [KbdFlags],5Bh ; Shift Alt Caps Scroll
jz auto_boot ; If neither, default boot
enter_command:
+ cmp word [NoEscape],0 ; If NOESCAPE, no prompt,
+ je auto_boot ; always run default cmd
+
mov si,boot_prompt
call cwritestr
call cwritestr ; Write command line so far
fk_nofile: pop di
jmp short get_char_2
+
+;
+; Jump here to run the default command line
+;
auto_boot:
mov si,default_cmd
mov di,command_line
mov cx,(max_cmd_len+4) >> 2
rep movsd
jmp short load_kernel
+
+;
+; Jump here when the command line is completed
+;
command_done:
call crlf
cmp di,command_line ; Did we just hit return?
%endif
; Otherwise Linux kernel
- section .data
-KbdFlagMask db 5Bh ; Caps, Scroll, Shift, Alt
-
section .bss
alignb 2
KernelExtPtr resw 1 ; During search, final null pointer