summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc/boot
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/i86pc/boot')
-rw-r--r--usr/src/uts/i86pc/boot/boot_console.c1
-rw-r--r--usr/src/uts/i86pc/boot/boot_fb.c43
-rw-r--r--usr/src/uts/i86pc/boot/boot_gdt.s36
-rw-r--r--usr/src/uts/i86pc/boot/boot_keyboard.c5
4 files changed, 46 insertions, 39 deletions
diff --git a/usr/src/uts/i86pc/boot/boot_console.c b/usr/src/uts/i86pc/boot/boot_console.c
index cfd4da40d0..541d974d1a 100644
--- a/usr/src/uts/i86pc/boot/boot_console.c
+++ b/usr/src/uts/i86pc/boot/boot_console.c
@@ -1203,7 +1203,6 @@ bcons_post_bootenvrc(char *inputdev, char *outputdev, char *consoledev)
int cons = CONS_INVALID;
int ttyn;
char *devnames[] = { consoledev, outputdev, inputdev, NULL };
- console_value_t *consolep;
int i;
extern int post_fastreboot;
diff --git a/usr/src/uts/i86pc/boot/boot_fb.c b/usr/src/uts/i86pc/boot/boot_fb.c
index 1ac4789af7..8894f9f23b 100644
--- a/usr/src/uts/i86pc/boot/boot_fb.c
+++ b/usr/src/uts/i86pc/boot/boot_fb.c
@@ -206,6 +206,7 @@ xbi_fb_init(struct xboot_info *xbi, bcons_dev_t *bcons_dev)
fb_info.rgb.green.pos = tag->u.fb2.framebuffer_green_field_position;
fb_info.rgb.blue.size = tag->u.fb2.framebuffer_blue_mask_size;
fb_info.rgb.blue.pos = tag->u.fb2.framebuffer_blue_field_position;
+ rgb_info = fb_info.rgb;
return (B_TRUE);
}
@@ -354,28 +355,44 @@ boot_get_color(uint32_t *fg, uint32_t *bg)
/* ansi to solaris colors, see also boot_console.c */
if (fb_info.inverse == B_TRUE ||
fb_info.inverse_screen == B_TRUE) {
- if (fb_info.fg_color < 16)
- *bg = dim_xlate[fb_info.fg_color];
- else
+ if (fb_info.fg_color < XLATE_NCOLORS) {
+ /*
+ * white fg -> bright white bg
+ */
+ if (fb_info.fg_color == pc_white)
+ *bg = brt_xlate[fb_info.fg_color];
+ else
+ *bg = dim_xlate[fb_info.fg_color];
+ } else {
*bg = fb_info.fg_color;
+ }
- if (fb_info.bg_color < 16)
- *fg = brt_xlate[fb_info.bg_color];
- else
+ if (fb_info.bg_color < XLATE_NCOLORS) {
+ if (fb_info.bg_color == pc_white)
+ *fg = brt_xlate[fb_info.bg_color];
+ else
+ *fg = dim_xlate[fb_info.bg_color];
+ } else {
*fg = fb_info.bg_color;
+ }
} else {
- if (fb_info.bg_color < 16) {
- if (fb_info.bg_color == 7)
+ if (fb_info.fg_color < XLATE_NCOLORS) {
+ if (fb_info.fg_color == pc_white)
+ *fg = brt_xlate[fb_info.fg_color];
+ else
+ *fg = dim_xlate[fb_info.fg_color];
+ } else {
+ *fg = fb_info.fg_color;
+ }
+
+ if (fb_info.bg_color < XLATE_NCOLORS) {
+ if (fb_info.bg_color == pc_white)
*bg = brt_xlate[fb_info.bg_color];
else
*bg = dim_xlate[fb_info.bg_color];
} else {
*bg = fb_info.bg_color;
}
- if (fb_info.fg_color < 16)
- *fg = dim_xlate[fb_info.fg_color];
- else
- *fg = fb_info.fg_color;
}
}
@@ -392,7 +409,7 @@ boot_color_map(uint8_t index)
return (index);
}
- return (rgb_color_map(&fb_info.rgb, index));
+ return (rgb_color_map(&fb_info.rgb, index, 0));
}
/* set up out simple console. */
diff --git a/usr/src/uts/i86pc/boot/boot_gdt.s b/usr/src/uts/i86pc/boot/boot_gdt.s
index 58c74c6f41..84bad4b9c7 100644
--- a/usr/src/uts/i86pc/boot/boot_gdt.s
+++ b/usr/src/uts/i86pc/boot/boot_gdt.s
@@ -22,34 +22,21 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2020 Joyent, Inc.
*/
-#if defined(__lint)
-#pragma pack(1)
-struct {
- uint16_t limit_low;
- uint16_t base_low;
- uint8_t base_middle;
- uint8_t attr;
- uint8_t attr_and_limit;
- uint8_t base_high;
-} global_descriptor_table[8];
-struct {
- uint16_t limit; /* sizeof (global_descriptor_table) - 1 */
- void *base; /* &global_descriptor_table */
-} gdt_info;
-#pragma pack()
-
-#else /* __lint */
+/*
+ * The boot GDT must remain in sync with the entries in intel/sys/segments.h; in
+ * particular kmdb uses B64CODE_SEL or B32CODE_SEL in perpetuity for its IDT
+ * entries (they're copied to the kernel's GDT in init_idt()).
+ *
+ * The GDT is effectively an array of user_desc_t entries.
+ */
.align 16
.data
- /*
- * This must remain in sync with the entries in intel/sys/gdt.h; in
- * particular kmdb uses B64CODE_SEL or B32CODE_SEL in perpetuity for
- * its IDT entries (they're copied to the kernel's GDT in init_idt()).
- */
global_descriptor_table:
.long 0
@@ -129,6 +116,10 @@ fake_cpu_gdt_base_24_31:
/ .long 0
/ .long 0
+
+/*
+ * This is a desctbr_t.
+ */
gdt_info:
.value gdt_info - global_descriptor_table - 1
.long global_descriptor_table
@@ -143,4 +134,3 @@ fake_cpu_ptr:
.4byte 0
.skip 0x6c0, 0
-#endif /* __lint */
diff --git a/usr/src/uts/i86pc/boot/boot_keyboard.c b/usr/src/uts/i86pc/boot/boot_keyboard.c
index 3bf27243aa..e568a7bd9b 100644
--- a/usr/src/uts/i86pc/boot/boot_keyboard.c
+++ b/usr/src/uts/i86pc/boot/boot_keyboard.c
@@ -80,8 +80,9 @@ extern unsigned short *kb_status;
#else /* __xpv && _BOOT */
/* Device memory addresses */
-#define kb_flag ((unsigned char *)BIOS_KB_FLAG)
-#define kb_flag_1 ((unsigned char *)BIOS_KB_FLAG_1)
+static unsigned char *kb_status = ((unsigned char *)BIOS_KB_FLAG);
+#define kb_flag (&kb_status[0])
+#define kb_flag_1 (&kb_status[1])
#endif /* __xpv && _BOOT */