core: set QUIET_FLAG if we load Linux "quiet"
authorH. Peter Anvin <hpa@zytor.com>
Mon, 1 Feb 2010 17:45:23 +0000 (09:45 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 1 Feb 2010 17:45:23 +0000 (09:45 -0800)
If we see the "quiet" flag for the Linux kernel, also suppress the
early Linux kernel messages; for people who want a completely clean
boot.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/kernel.inc
core/runkernel.inc

index 9b888cc..5e1c7a3 100644 (file)
@@ -85,6 +85,8 @@ HEADER_ID       equ 'HdrS'            ; HdrS (in littleendian hex)
 ; Flags for the su_loadflags field
 ;
 LOAD_HIGH      equ 01h                 ; Large kernel, load high
+QUIET_FLAG     equ 20h                 ; Quiet the kernel
+KEEP_SEGMENTS  equ 40h                 ; Don't reload segments
 CAN_USE_HEAP    equ 80h                 ; Boot loader reports heap size
 
 ;
index f32fe1d..e738706 100644 (file)
@@ -1,7 +1,7 @@
 ;; -----------------------------------------------------------------------
 ;;
 ;;   Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
-;;   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+;;   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
 ;;
 ;;   This program is free software; you can redistribute it and/or modify
 ;;   it under the terms of the GNU General Public License as published by
@@ -168,7 +168,7 @@ opt_mem:
                ret
 
 opt_quiet:
-               mov byte [QuietBoot],1
+               mov byte [QuietBoot],QUIET_FLAG
                ret
 
 %if IS_PXELINUX
@@ -228,6 +228,8 @@ new_kernel:
 ; we were provided.
 ;
                 mov al,[es:su_loadflags]
+               or al,[QuietBoot]               ; Set QUIET_FLAG if needed
+               mov [es:su_loadflags],al
                mov [LoadFlags],al
 
 any_kernel:
@@ -458,7 +460,7 @@ setup_move:
                ; BX points to the final real mode segment, and will be loaded
                ; into DS.
 
-               test byte [QuietBoot],01h       ; Don't clear the mode if quiet
+               test byte [QuietBoot],QUIET_FLAG
                jz replace_bootstrap
                jmp replace_bootstrap_noclearmode
 
@@ -631,7 +633,7 @@ loadinitrd:
 ;              assumes CS == DS
 ;
 writestr_qchk:
-               test byte [QuietBoot],01h
+               test byte [QuietBoot],QUIET_FLAG
                jz writestr
                ret