x86/boot/compressed: Fix serial I/O during compressed boot
PATCH 1/1 x86/boot/compressed: Fix serial I/O during compressed boot
Previously it used early_serial_base from the arch/x86/boot/compressed/early_serial_console.c, and it's zero everytime, so serial I/O didn't work/print anything in the kernel decompressing code.
Let's define early_serial_base in the arch/x86/boot/early_serial_console.c and make it extern, so code from boot/compressed directory can use it.
--- arch/x86/boot/compressed/early_serial_console.c | 2 -- arch/x86/boot/compressed/misc.c | 3 ++- arch/x86/boot/early_serial_console.c | 2 ++ arch/x86/boot/tty.c | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/boot/compressed/early_serial_console.c +0 -2
@@ -1,5 +1,3 @@#include "misc.h" -int early_serial_base; -#include "../early_serial_console.c"
arch/x86/boot/compressed/misc.c +0 -1
@@ -390,7 +390,8 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap, lines = real_mode->screen_info.orig_video_lines; cols = real_mode->screen_info.orig_video_cols; -console_init ();
/* * serial i/o can be already initialized if we runned in 16-bit * real mode and didn't use 32/64-bit boot protocol. */
+ if (!early_serial_base)
+ console_init();
debug_putstr("early console in decompress_kernel\n");
free_mem_ptr = heap; /* Heap */
arch/x86/boot/early_serial_console.c +2 -0
@@ -1,5 +1,7 @@#include "boot.h" +int early_serial_base; +#define DEFAULT_SERIAL_PORT 0x3f8/* ttyS0 */ #define XMTRDY 0x20
arch/x86/boot/tty.c +0 -2
@@ -15,8 +15,6 @@#include "boot.h" -int early_serial_base; -#define XMTRDY 0x20#define TXR 0/* Transmit register (WRITE) */
Signature · 1 line
2.3.0
rejected
2015-02-08 18:33 GMT+06:00 Alexander Kuleshov <[email protected]>:
Quoted 71 lines
Previously it used
early_serial_basefrom thearch/x86/boot/compressed/early_serial_console.c, and it's zero everytime, so serial I/O didn't work/print anything in the kernel decompressing code.Let's define
early_serial_basein thearch/x86/boot/early_serial_console.cand make it extern, so code from boot/compressed directory can use it.Signed-off-by Alexander Kuleshov <[email protected]>--- arch/x86/boot/compressed/early_serial_console.c | 2 -- arch/x86/boot/compressed/misc.c | 3 ++- arch/x86/boot/early_serial_console.c | 2 ++ arch/x86/boot/tty.c | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-)arch/x86/boot/compressed/early_serial_console.c +0
-2@@ -1,5 +1,3 @@#include "misc.h" -int early_serial_base; -#include "../early_serial_console.c" arch/x86/boot/compressed/misc.c +2
-1@@ -390,7 +390,8 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap, lines = real_mode->screen_info.orig_video_lines; cols = real_mode->screen_info.orig_video_cols; -console_init ();/* * serial i/o can be already initialized if we runned in 16-bit * real mode and didn't use 32/64-bit boot protocol. */ +if (!early_serial_base) +console_init ();debug_putstr ("early console in decompress_kernel\n" ); free_mem_ptr = heap;/* Heap */ arch/x86/boot/early_serial_console.c +2
-0@@ -1,5 +1,7 @@#include "boot.h" +int early_serial_base; +#define DEFAULT_SERIAL_PORT 0x3f8/* ttyS0 */ #define XMTRDY 0x20arch/x86/boot/tty.c +0
-3@@ -15,8 +15,6 @@#include "boot.h" -int early_serial_base; -#define XMTRDY 0x20#define TXR 0/* Transmit register (WRITE) */ --2.3.0
Signature · 2 lines
_________________________ 0xAX