diff --git a/src/kernel/boot/platform/bios_ia32/console.cpp b/src/kernel/boot/platform/bios_ia32/console.cpp index 4072fd6eea..401595e816 100644 --- a/src/kernel/boot/platform/bios_ia32/console.cpp +++ b/src/kernel/boot/platform/bios_ia32/console.cpp @@ -125,7 +125,7 @@ console_set_cursor(int32 x, int32 y) void console_set_color(int32 foreground, int32 background) { - sColor = (background & 0x7) << 12 | (foreground & 0xf) << 8; + sColor = (background & 0xf) << 12 | (foreground & 0xf) << 8; } diff --git a/src/kernel/boot/platform/bios_ia32/console.h b/src/kernel/boot/platform/bios_ia32/console.h index 3084c69d5a..a093a373f1 100644 --- a/src/kernel/boot/platform/bios_ia32/console.h +++ b/src/kernel/boot/platform/bios_ia32/console.h @@ -20,7 +20,7 @@ enum console_color { PURPLE, BROWN, GRAY, - // foreground colors only + // foreground colors only if blinking is enabled DARK_GRAY, BRIGHT_BLUE, BRIGHT_GREEN, diff --git a/src/kernel/boot/platform/bios_ia32/menu.cpp b/src/kernel/boot/platform/bios_ia32/menu.cpp index 9a6c63ddd1..dc27a5c2fd 100644 --- a/src/kernel/boot/platform/bios_ia32/menu.cpp +++ b/src/kernel/boot/platform/bios_ia32/menu.cpp @@ -34,9 +34,9 @@ static const console_color kItemBackgroundColor = kBackgroundColor; static const console_color kSelectedItemBackgroundColor = GRAY; static const console_color kDisabledColor = DARK_GRAY; -static const console_color kSliderColor = GRAY; -static const console_color kSliderBackgroundColor = CYAN; -static const console_color kArrowColor = WHITE; +static const console_color kSliderColor = CYAN; +static const console_color kSliderBackgroundColor = DARK_GRAY; +static const console_color kArrowColor = GRAY; static int32 sMenuOffset = 0; diff --git a/src/kernel/boot/platform/bios_ia32/video.cpp b/src/kernel/boot/platform/bios_ia32/video.cpp index 120cbe8768..0b2793d06f 100644 --- a/src/kernel/boot/platform/bios_ia32/video.cpp +++ b/src/kernel/boot/platform/bios_ia32/video.cpp @@ -56,6 +56,21 @@ vga_set_palette(const uint8 *palette, int32 firstIndex, int32 numEntries) } +static void +vga_enable_bright_background_colors(void) +{ + // reset attribute controller + in8(0x03da); + + // select mode control register + out8(0x30, 0x03c0); + + // read mode control register, change it (we need to clear bit 3), and write it back + uint8 mode = in8(0x03c1) & 0xf7; + out8(mode, 0x3c0); +} + + // #pragma mark - // VESA functions @@ -222,11 +237,10 @@ vesa_set_mode(uint16 mode) static status_t vesa_set_palette(const uint8 *palette, int32 firstIndex, int32 numEntries) { -#if 0 // is this an 8 bit indexed color mode? - if (gKernelArgs.fb.bit_depth = modeInfo.bits_per_pixel != 8) + if (gKernelArgs.frame_buffer.depth != 8) return B_BAD_TYPE; -#endif + #if 0 struct bios_regs regs; regs.eax = 0x4f09; @@ -386,13 +400,18 @@ platform_switch_to_logo(void) extern "C" void platform_switch_to_text_mode(void) { - if (!gKernelArgs.frame_buffer.enabled) + + if (!gKernelArgs.frame_buffer.enabled) { + vga_enable_bright_background_colors(); return; + } bios_regs regs; regs.eax = 3; call_bios(0x10, ®s); gKernelArgs.frame_buffer.enabled = 0; + + vga_enable_bright_background_colors(); }