From 81f2f81c21c6389ac327080480c0d8db7b895571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 14 Sep 2004 17:40:23 +0000 Subject: [PATCH] If the kernel_args::cons_line field is not maintained (ie. is zero), the console driver now clears the screen when it's initialized. This improves the first impression of the standard boot process when booting in text mode (which currently happens when you press "escape" in the early boot stage). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8939 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/drivers/arch/x86/console/console.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/kernel/drivers/arch/x86/console/console.c b/src/kernel/drivers/arch/x86/console/console.c index af6bf1e0cc..aa63c4fea0 100755 --- a/src/kernel/drivers/arch/x86/console/console.c +++ b/src/kernel/drivers/arch/x86/console/console.c @@ -85,6 +85,19 @@ scrup(void) } +static void +clear_screen(void) +{ + uint16 *base = (uint16 *)origin; + uint32 i; + + for (i = 0; i < COLUMNS * LINES; i++) + base[i] = 0xf20; + + pos = origin; +} + + static void lf(void) { @@ -306,6 +319,7 @@ console_dev_init(kernel_args *ka) dprintf("con_init: mapping vid mem\n"); vm_map_physical_memory(vm_get_kernel_aspace_id(), "vid_mem", (void *)&origin, B_ANY_KERNEL_ADDRESS, SCREEN_END - SCREEN_START, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, SCREEN_START); + dprintf("con_init: mapped vid mem to virtual address 0x%x\n", origin); pos = origin; @@ -316,7 +330,10 @@ console_dev_init(kernel_args *ka) * access to this information. We probably need to find a * better way of doing this. */ - gotoxy(0, ka->cons_line); + if (ka->cons_line != 0) + gotoxy(0, ka->cons_line); + else + clear_screen(); update_cursor(x, y); mutex_init(&console_lock, "console_lock");