[build] Canonicalise console type configuration

Move all console configuration from config/defaults/<platform>.h to
the top-level config/console.h, using indented conditional blocks to
clarify which console types are supported and enabled on each
platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-01-16 16:52:40 +00:00
parent ce6f574a9f
commit f7f685f8c9
5 changed files with 57 additions and 38 deletions

View File

@@ -15,52 +15,76 @@ FILE_SECBOOT ( PERMITTED );
#include <config/defaults.h> #include <config/defaults.h>
/* /*****************************************************************************
* Default console types
* *
* These are all enabled by default for the appropriate platforms. * Console types
* You may disable them if needed.
* *
*/ */
//#undef CONSOLE_PCBIOS /* Default BIOS console */ /* Console types supported on all platforms */
//#undef CONSOLE_EFI /* Default EFI console */
//#undef CONSOLE_LINUX /* Default Linux console */
/*
* Additional console types
*
* These are not enabled by default, but may be useful in your
* environment.
*
*/
//#define CONSOLE_SERIAL /* Serial port console */
//#define CONSOLE_FRAMEBUFFER /* Graphical framebuffer console */ //#define CONSOLE_FRAMEBUFFER /* Graphical framebuffer console */
//#define CONSOLE_SYSLOG /* Syslog console */ //#define CONSOLE_SYSLOG /* Syslog console */
//#define CONSOLE_SYSLOGS /* Encrypted syslog console */ //#define CONSOLE_SYSLOGS /* Encrypted syslog console */
//#define CONSOLE_VMWARE /* VMware logfile console */
//#define CONSOLE_DEBUGCON /* Bochs/QEMU/KVM debug port console */
//#define CONSOLE_INT13 /* INT13 disk log console */
//#define CONSOLE_SBI /* RISC-V SBI debug console */
/* /* Console types supported only on systems with serial ports */
* Very obscure console types #if ! defined ( SERIAL_NULL )
//#define CONSOLE_SERIAL /* Serial port console */
#endif
/* Console types supported only on BIOS platforms */
#if defined ( PLATFORM_pcbios )
//#define CONSOLE_INT13 /* INT13 disk log console */
#define CONSOLE_PCBIOS /* Default BIOS console */
#endif
/* Console types supported only on EFI platforms */
#if defined ( PLATFORM_efi )
#define CONSOLE_EFI /* Default EFI console */
#endif
/* Console types supported only on RISC-V SBI platforms */
#if defined ( PLATFORM_sbi )
#define CONSOLE_SBI /* RISC-V SBI debug console */
#endif
/* Console types supported only on Linux platforms */
#if defined ( PLATFORM_linux )
#define CONSOLE_LINUX /* Default Linux console */
#endif
/* Console types supported only on x86 CPUs */
#if defined ( __i386__ ) || defined ( __x86_64__ )
//#define CONSOLE_DEBUGCON /* Bochs/QEMU/KVM debug port console */
//#define CONSOLE_DIRECT_VGA /* Direct access to VGA card */
//#define CONSOLE_PC_KBD /* Direct access to PC keyboard */
//#define CONSOLE_VMWARE /* VMware logfile console */
#endif
/* Enable serial console on platforms that are typically headless */
#if defined ( CONSOLE_SBI )
#define CONSOLE_SERIAL
#endif
/*****************************************************************************
* *
* You almost certainly do not need to enable these. * Keyboard maps
*
* See hci/keymap/keymap_*.c for available keyboard maps.
* *
*/ */
//#define CONSOLE_DIRECT_VGA /* Direct access to VGA card */ #define KEYBOARD_MAP us /* Default US keyboard map */
//#define CONSOLE_PC_KBD /* Direct access to PC keyboard */ //#define KEYBOARD_MAP dynamic /* Runtime selectable keyboard map */
/* Keyboard map (available maps in hci/keymap/) */ /*****************************************************************************
#define KEYBOARD_MAP us *
* Log levels
/* Control which syslog() messages are generated. *
* Control which syslog() messages are generated. Note that this is
* not related in any way to CONSOLE_SYSLOG.
* *
* Note that this is not related in any way to CONSOLE_SYSLOG.
*/ */
#define LOG_LEVEL LOG_NONE #define LOG_LEVEL LOG_NONE
#include <config/named.h> #include <config/named.h>

View File

@@ -14,7 +14,6 @@ FILE_SECBOOT ( PERMITTED );
#define IOMAP_VIRT #define IOMAP_VIRT
#define PCIAPI_EFI #define PCIAPI_EFI
#define DMAAPI_OP #define DMAAPI_OP
#define CONSOLE_EFI
#define TIMER_EFI #define TIMER_EFI
#define UMALLOC_EFI #define UMALLOC_EFI
#define MEMMAP_NULL #define MEMMAP_NULL

View File

@@ -9,7 +9,6 @@
FILE_LICENCE ( GPL2_OR_LATER ); FILE_LICENCE ( GPL2_OR_LATER );
#define CONSOLE_LINUX
#define TIMER_LINUX #define TIMER_LINUX
#define UACCESS_LINUX #define UACCESS_LINUX
#define UMALLOC_LINUX #define UMALLOC_LINUX

View File

@@ -14,7 +14,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define PCIAPI_PCBIOS #define PCIAPI_PCBIOS
#define DMAAPI_FLAT #define DMAAPI_FLAT
#define TIMER_PCBIOS #define TIMER_PCBIOS
#define CONSOLE_PCBIOS
#define NAP_PCBIOS #define NAP_PCBIOS
#define UMALLOC_UHEAP #define UMALLOC_UHEAP
#define MEMMAP_INT15 #define MEMMAP_INT15

View File

@@ -23,8 +23,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#endif #endif
#define FDT_SBI #define FDT_SBI
#define CONSOLE_SBI
#define CONSOLE_SERIAL
#define REBOOT_SBI #define REBOOT_SBI
#define UMALLOC_UHEAP #define UMALLOC_UHEAP
#define MEMMAP_FDT #define MEMMAP_FDT