From: Randy Dunlap Highlight (reverse video) a few important kernel messages (as a test). Only works to a terminal that supports the control sequences. I.e., I didn't see these during boot on the primary console, but they are displayed on the serial console captured with minicom and they are displayed in an xterm after boot. Photo: http://www.xenotime.net/linux/doc/kernel-msg-hilite.jpg Signed-off-by: Randy Dunlap --- arch/x86_64/mm/init.c | 3 ++- drivers/pci/quirks.c | 3 ++- include/linux/kernel.h | 2 ++ init/main.c | 5 +++-- init/version.c | 4 +++- kernel/panic.c | 4 ++-- kernel/sys.c | 10 +++++----- 7 files changed, 19 insertions(+), 12 deletions(-) --- linux-2619-rc3g3.orig/include/linux/kernel.h +++ linux-2619-rc3g3/include/linux/kernel.h @@ -44,6 +44,8 @@ extern const char linux_banner[]; #define KERN_NOTICE "<5>" /* normal but significant condition */ #define KERN_INFO "<6>" /* informational */ #define KERN_DEBUG "<7>" /* debug-level messages */ +#define KERN_REVERSE_VIDEO_ON "\x1b[7m" +#define KERN_REVERSE_VIDEO_OFF "\x1b[27m" extern int console_printk[]; --- linux-2619-rc3g3.orig/kernel/panic.c +++ linux-2619-rc3g3/kernel/panic.c @@ -77,7 +77,7 @@ NORET_TYPE void panic(const char * fmt, va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "Kernel panic - not syncing: %s" KERN_REVERSE_VIDEO_OFF "\n",buf); bust_spinlocks(0); /* @@ -106,7 +106,7 @@ NORET_TYPE void panic(const char * fmt, * Delay timeout seconds before rebooting the machine. * We can't use the "normal" timers since we just panicked.. */ - printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "Rebooting in %d seconds.." KERN_REVERSE_VIDEO_OFF, panic_timeout); for (i = 0; i < panic_timeout*1000; ) { touch_nmi_watchdog(); i += panic_blink(i); --- linux-2619-rc3g3.orig/kernel/sys.c +++ linux-2619-rc3g3/kernel/sys.c @@ -732,9 +732,9 @@ void kernel_restart(char *cmd) { kernel_restart_prepare(cmd); if (!cmd) - printk(KERN_EMERG "Restarting system.\n"); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "Restarting system." KERN_REVERSE_VIDEO_OFF "\n"); else - printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "Restarting system with command '%s'." KERN_REVERSE_VIDEO_OFF "\n", cmd); machine_restart(cmd); } EXPORT_SYMBOL_GPL(kernel_restart); @@ -753,7 +753,7 @@ static void kernel_kexec(void) if (!image) return; kernel_restart_prepare(NULL); - printk(KERN_EMERG "Starting new kernel\n"); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "Starting new kernel" KERN_REVERSE_VIDEO_OFF "\n"); machine_shutdown(); machine_kexec(image); #endif @@ -774,7 +774,7 @@ void kernel_shutdown_prepare(enum system void kernel_halt(void) { kernel_shutdown_prepare(SYSTEM_HALT); - printk(KERN_EMERG "System halted.\n"); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "System halted." KERN_REVERSE_VIDEO_OFF "\n"); machine_halt(); } @@ -788,7 +788,7 @@ EXPORT_SYMBOL_GPL(kernel_halt); void kernel_power_off(void) { kernel_shutdown_prepare(SYSTEM_POWER_OFF); - printk(KERN_EMERG "Power down.\n"); + printk(KERN_EMERG KERN_REVERSE_VIDEO_ON "Power down." KERN_REVERSE_VIDEO_OFF "\n"); machine_power_off(); } EXPORT_SYMBOL_GPL(kernel_power_off); --- linux-2619-rc3g3.orig/init/main.c +++ linux-2619-rc3g3/init/main.c @@ -500,7 +500,7 @@ asmlinkage void __init start_kernel(void lock_kernel(); boot_cpu_init(); page_address_init(); - printk(KERN_NOTICE); + printk(KERN_NOTICE KERN_REVERSE_VIDEO_ON); printk(linux_banner); setup_arch(&command_line); unwind_setup(); @@ -520,7 +520,8 @@ asmlinkage void __init start_kernel(void preempt_disable(); build_all_zonelists(); page_alloc_init(); - printk(KERN_NOTICE "Kernel command line: %s\n", saved_command_line); + printk(KERN_NOTICE KERN_REVERSE_VIDEO_ON "Kernel command line: %s" + KERN_REVERSE_VIDEO_OFF "\n", saved_command_line); parse_early_param(); parse_args("Booting kernel", command_line, __start___param, __stop___param - __start___param, --- linux-2619-rc3g3.orig/init/version.c +++ linux-2619-rc3g3/init/version.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -36,4 +37,5 @@ EXPORT_SYMBOL_GPL(init_uts_ns); const char linux_banner[] = "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" - LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; + LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION + KERN_REVERSE_VIDEO_OFF "\n"; --- linux-2619-rc3g3.orig/arch/x86_64/mm/init.c +++ linux-2619-rc3g3/arch/x86_64/mm/init.c @@ -604,7 +604,8 @@ void free_init_pages(char *what, unsigne if (begin >= end) return; - printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10); + printk(KERN_INFO KERN_REVERSE_VIDEO_ON "Freeing %s: %ldk freed" + KERN_REVERSE_VIDEO_OFF "\n", what, (end - begin) >> 10); for (addr = begin; addr < end; addr += PAGE_SIZE) { ClearPageReserved(virt_to_page(addr)); init_page_count(virt_to_page(addr)); --- linux-2619-rc3g3.orig/drivers/pci/quirks.c +++ linux-2619-rc3g3/drivers/pci/quirks.c @@ -286,7 +286,8 @@ static void __devinit quirk_io_region(st pcibios_bus_to_resource(dev, res, &bus_region); pci_claim_resource(dev, nr); - printk("PCI quirk: region %04x-%04x claimed by %s\n", region, region + size - 1, name); + printk(KERN_REVERSE_VIDEO_ON "PCI quirk: region %04x-%04x claimed by %s" + KERN_REVERSE_VIDEO_OFF "\n", region, region + size - 1, name); } }