summaryrefslogtreecommitdiff
path: root/usr/src/boot/sys
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
committerDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
commit267e12a7d9bf6e5fcefb9cc00f46bfff0dc5226e (patch)
tree19a3941920d0039c35d53a5cbee189b5ca51995a /usr/src/boot/sys
parent517abc5c668925e6092495bf332233c3599980d2 (diff)
parente9faba760cdf80d7dfa110fe0830917ab94668c2 (diff)
downloadillumos-joyent-vpc.tar.gz
Merge branch 'master' into vpcvpc
Diffstat (limited to 'usr/src/boot/sys')
-rw-r--r--usr/src/boot/sys/boot/Makefile.inc2
-rw-r--r--usr/src/boot/sys/boot/common/bootstrap.h2
-rw-r--r--usr/src/boot/sys/boot/common/gfx_fb.c269
-rw-r--r--usr/src/boot/sys/boot/common/gfx_fb.h1
-rw-r--r--usr/src/boot/sys/boot/common/module.c9
-rw-r--r--usr/src/boot/sys/boot/common/part.c8
-rw-r--r--usr/src/boot/sys/boot/common/part.h1
-rw-r--r--usr/src/boot/sys/boot/common/tem.c95
-rw-r--r--usr/src/boot/sys/boot/common/ufsread.c363
-rw-r--r--usr/src/boot/sys/boot/efi/libefi/Makefile.com2
-rw-r--r--usr/src/boot/sys/boot/efi/loader/Makefile.com2
-rw-r--r--usr/src/boot/sys/boot/efi/loader/main.c2
-rw-r--r--usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c55
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/Makefile2
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/vbe.c2
-rw-r--r--usr/src/boot/sys/boot/i386/loader/Makefile2
-rw-r--r--usr/src/boot/sys/boot/i386/loader/conf.c3
-rw-r--r--usr/src/boot/sys/boot/i386/loader/main.c2
-rw-r--r--usr/src/boot/sys/sys/disklabel.h2
-rw-r--r--usr/src/boot/sys/sys/gpt.h2
-rw-r--r--usr/src/boot/sys/sys/tem_impl.h1
-rw-r--r--usr/src/boot/sys/sys/vtoc.h1
22 files changed, 295 insertions, 533 deletions
diff --git a/usr/src/boot/sys/boot/Makefile.inc b/usr/src/boot/sys/boot/Makefile.inc
index 674d41ce23..86ea9ca206 100644
--- a/usr/src/boot/sys/boot/Makefile.inc
+++ b/usr/src/boot/sys/boot/Makefile.inc
@@ -31,7 +31,7 @@ LDFLAGS += $(GLDTARGET)
# bare minimum for case we can not load font from the OS root.
FONT= 8x16
-FONT_SRC= ter-u16n.bdf
+FONT_SRC= ter-u16b.bdf
FONT_DIR= $(SRC)/data/consfonts
PNGLITE= $(SRC)/common/pnglite
diff --git a/usr/src/boot/sys/boot/common/bootstrap.h b/usr/src/boot/sys/boot/common/bootstrap.h
index 1da5d6ffe0..7cdeb6d1c4 100644
--- a/usr/src/boot/sys/boot/common/bootstrap.h
+++ b/usr/src/boot/sys/boot/common/bootstrap.h
@@ -123,7 +123,7 @@ struct console
extern struct console *consoles[];
void cons_probe(void);
void cons_mode(int);
-void autoload_font(void);
+void autoload_font(bool);
/*
* Plug-and-play enumerator/configurator interface.
diff --git a/usr/src/boot/sys/boot/common/gfx_fb.c b/usr/src/boot/sys/boot/common/gfx_fb.c
index 9389856ba8..84d5e50fe2 100644
--- a/usr/src/boot/sys/boot/common/gfx_fb.c
+++ b/usr/src/boot/sys/boot/common/gfx_fb.c
@@ -37,6 +37,15 @@
#include <gfx_fb.h>
#include <pnglite.h>
#include <bootstrap.h>
+#include <lz4.h>
+
+/* VGA text mode does use bold font. */
+#if !defined(VGA_8X16_FONT)
+#define VGA_8X16_FONT "/boot/fonts/8x16b.fnt"
+#endif
+#if !defined(DEFAULT_8X16_FONT)
+#define DEFAULT_8X16_FONT "/boot/fonts/8x16.fnt"
+#endif
/*
* Global framebuffer struct, to be updated with mode changes.
@@ -68,6 +77,8 @@ static void gfx_bm_cons_copy(struct vis_conscopy *);
static void gfx_bm_cons_display(struct vis_consdisplay *);
static void gfx_bm_display_cursor(struct vis_conscursor *);
+static bool insert_font(char *, FONT_FLAGS);
+
/*
* Set default operations to use bitmap based implementation.
* In case of UEFI, if GOP is available, we will switch to GOP based
@@ -399,6 +410,11 @@ gfx_framework_init(struct visual_ops *fb_ops)
snprintf(buf, sizeof (buf), "%d", gfx_bg);
env_setenv("tem.bg_color", EV_VOLATILE, buf, gfx_set_colors,
env_nounset);
+
+ /*
+ * Setup font list to have builtin font.
+ */
+ (void) insert_font(NULL, FONT_BUILTIN);
}
/*
@@ -1502,7 +1518,35 @@ load_mapping(int fd, struct font *fp, int n)
return (0);
}
-/* Load font from file. */
+static int
+builtin_mapping(struct font *fp, int n)
+{
+ size_t size;
+ struct font_map *mp;
+
+ if (n >= VFNT_MAPS)
+ return (EINVAL);
+
+ if (fp->vf_map_count[n] == 0)
+ return (0);
+
+ size = fp->vf_map_count[n] * sizeof (*mp);
+ mp = malloc(size);
+ if (mp == NULL)
+ return (ENOMEM);
+ fp->vf_map[n] = mp;
+
+ memcpy(mp, DEFAULT_FONT_DATA.font->vf_map[n], size);
+ return (0);
+}
+
+/*
+ * Load font from builtin or from file.
+ * We do need special case for builtin because the builtin font glyphs
+ * are compressed and we do need to uncompress them.
+ * Having single load_font() for both cases will help us to simplify
+ * font switch handling.
+ */
static bitmap_data_t *
load_font(char *path)
{
@@ -1510,7 +1554,7 @@ load_font(char *path)
uint32_t glyphs;
struct font_header fh;
struct fontlist *fl;
- bitmap_data_t *bp = NULL;
+ bitmap_data_t *bp;
struct font *fp;
size_t size;
ssize_t rv;
@@ -1522,9 +1566,52 @@ load_font(char *path)
}
if (fl == NULL)
return (NULL); /* Should not happen. */
+
bp = fl->font_data;
- if (bp->font != NULL)
+ if (bp->font != NULL && fl->font_flags != FONT_RELOAD)
+ return (bp);
+
+ fd = -1;
+ /*
+ * Special case for builtin font.
+ * Builtin font is the very first font we load, we do not have
+ * previous loads to be released.
+ */
+ if (fl->font_flags == FONT_BUILTIN) {
+ if ((fp = calloc(1, sizeof (struct font))) == NULL)
+ return (NULL);
+
+ fp->vf_width = DEFAULT_FONT_DATA.width;
+ fp->vf_height = DEFAULT_FONT_DATA.height;
+
+ fp->vf_bytes = malloc(DEFAULT_FONT_DATA.uncompressed_size);
+ if (fp->vf_bytes == NULL) {
+ free(fp);
+ return (NULL);
+ }
+
+ bp->uncompressed_size = DEFAULT_FONT_DATA.uncompressed_size;
+ bp->compressed_size = DEFAULT_FONT_DATA.compressed_size;
+
+ if (lz4_decompress(DEFAULT_FONT_DATA.compressed_data,
+ fp->vf_bytes,
+ DEFAULT_FONT_DATA.compressed_size,
+ DEFAULT_FONT_DATA.uncompressed_size, 0) != 0) {
+ free(fp->vf_bytes);
+ free(fp);
+ return (NULL);
+ }
+
+ for (i = 0; i < VFNT_MAPS; i++) {
+ fp->vf_map_count[i] =
+ DEFAULT_FONT_DATA.font->vf_map_count[i];
+ if (builtin_mapping(fp, i) != 0)
+ goto free_done;
+ }
+
+ bp->font = fp;
return (bp);
+ }
fd = open(path, O_RDONLY);
if (fd < 0) {
@@ -1552,8 +1639,8 @@ load_font(char *path)
fp->vf_width = fh.fh_width;
fp->vf_height = fh.fh_height;
- bp->uncompressed_size = howmany(bp->width, 8) * bp->height * glyphs;
- size = bp->uncompressed_size;
+ size = howmany(fp->vf_width, 8) * fp->vf_height * glyphs;
+ bp->uncompressed_size = size;
if ((fp->vf_bytes = malloc(size)) == NULL)
goto free_done;
@@ -1564,42 +1651,36 @@ load_font(char *path)
if (load_mapping(fd, fp, i) != 0)
goto free_done;
}
- bp->font = fp;
/*
- * Release previously loaded entry. We can do this now, as
+ * Reset builtin flag now as we have full font loaded.
+ */
+ if (fl->font_flags == FONT_BUILTIN)
+ fl->font_flags = FONT_AUTO;
+
+ /*
+ * Release previously loaded entries. We can do this now, as
* the new font is loaded. Note, there can be no console
* output till the new font is in place and tem is notified.
* We do need to keep fl->font_data for glyph dimensions.
*/
STAILQ_FOREACH(fl, &fonts, font_next) {
- if (fl->font_data->width == bp->width &&
- fl->font_data->height == bp->height)
+ if (fl->font_data->font == NULL)
continue;
- if (fl->font_data->font != NULL) {
- for (i = 0; i < VFNT_MAPS; i++)
- free(fl->font_data->font->vf_map[i]);
-
- /* Unset vf_bytes pointer in tem. */
- if (tems.ts_font.vf_bytes ==
- fl->font_data->font->vf_bytes) {
- tems.ts_font.vf_bytes = NULL;
- }
- free(fl->font_data->font->vf_bytes);
- free(fl->font_data->font);
- fl->font_data->font = NULL;
- fl->font_data->uncompressed_size = 0;
- fl->font_flags = FONT_AUTO;
- }
+ for (i = 0; i < VFNT_MAPS; i++)
+ free(fl->font_data->font->vf_map[i]);
+ free(fl->font_data->font->vf_bytes);
+ free(fl->font_data->font);
+ fl->font_data->font = NULL;
}
- /* free the uncompressed builtin font data in tem. */
- free(tems.ts_font.vf_bytes);
- tems.ts_font.vf_bytes = NULL;
+ bp->font = fp;
+ bp->compressed_size = 0;
done:
- close(fd);
+ if (fd != -1)
+ close(fd);
return (bp);
free_done:
@@ -1662,7 +1743,7 @@ read_list(char *fonts)
* The font list is built in descending order.
*/
static bool
-insert_font(char *name)
+insert_font(char *name, FONT_FLAGS flags)
{
struct font_header fh;
struct fontlist *fp, *previous, *entry, *next;
@@ -1671,30 +1752,51 @@ insert_font(char *name)
int fd;
char *font_name;
- fd = open(name, O_RDONLY);
- if (fd < 0)
- return (false);
- rv = read(fd, &fh, sizeof (fh));
- close(fd);
- if (rv < 0 || (size_t)rv != sizeof (fh))
- return (false);
+ font_name = NULL;
+ if (flags == FONT_BUILTIN) {
+ /*
+ * We only install builtin font once, while setting up
+ * initial console. Since this will happen very early,
+ * we assume asprintf will not fail. Once we have access to
+ * files, the builtin font will be replaced by font loaded
+ * from file.
+ */
+ if (!STAILQ_EMPTY(&fonts))
+ return (false);
- if (memcmp(fh.fh_magic, FONT_HEADER_MAGIC, sizeof (fh.fh_magic)) != 0)
- return (false);
+ fh.fh_width = DEFAULT_FONT_DATA.width;
+ fh.fh_height = DEFAULT_FONT_DATA.height;
+
+ (void) asprintf(&font_name, "%dx%d",
+ DEFAULT_FONT_DATA.width, DEFAULT_FONT_DATA.height);
+ } else {
+ fd = open(name, O_RDONLY);
+ if (fd < 0)
+ return (false);
+ rv = read(fd, &fh, sizeof (fh));
+ close(fd);
+ if (rv < 0 || (size_t)rv != sizeof (fh))
+ return (false);
+
+ if (memcmp(fh.fh_magic, FONT_HEADER_MAGIC,
+ sizeof (fh.fh_magic)) != 0)
+ return (false);
+ font_name = strdup(name);
+ }
- font_name = strdup(name);
if (font_name == NULL)
return (false);
/*
- * If we have an entry with the same glyph dimensions, just replace
- * the file name. We only support unique dimensions.
+ * If we have an entry with the same glyph dimensions, replace
+ * the file name and mark us. We only support unique dimensions.
*/
STAILQ_FOREACH(entry, &fonts, font_next) {
if (fh.fh_width == entry->font_data->width &&
fh.fh_height == entry->font_data->height) {
free(entry->font_name);
entry->font_name = font_name;
+ entry->font_flags = FONT_RELOAD;
return (true);
}
}
@@ -1711,7 +1813,7 @@ insert_font(char *name)
return (false);
}
fp->font_name = font_name;
- fp->font_flags = FONT_AUTO;
+ fp->font_flags = flags;
fp->font_load = load_font;
fp->font_data->width = fh.fh_width;
fp->font_data->height = fh.fh_height;
@@ -1726,8 +1828,7 @@ insert_font(char *name)
STAILQ_FOREACH(entry, &fonts, font_next) {
/* Should fp be inserted before the entry? */
- if (size >
- entry->font_data->width * entry->font_data->height) {
+ if (size > entry->font_data->width * entry->font_data->height) {
if (previous == NULL) {
STAILQ_INSERT_HEAD(&fonts, fp, font_next);
} else {
@@ -1789,7 +1890,17 @@ font_set(struct env_var *ev __unused, int flags __unused, const void *value)
}
void
-autoload_font(void)
+bios_text_font(bool use_vga_font)
+{
+ if (use_vga_font)
+ (void) insert_font(VGA_8X16_FONT, FONT_MANUAL);
+ else
+ (void) insert_font(DEFAULT_8X16_FONT, FONT_MANUAL);
+ tems.update_font = true;
+}
+
+void
+autoload_font(bool bios)
{
struct name_list *nl;
struct name_entry *np;
@@ -1801,7 +1912,7 @@ autoload_font(void)
while (!SLIST_EMPTY(nl)) {
np = SLIST_FIRST(nl);
SLIST_REMOVE_HEAD(nl, n_entry);
- if (insert_font(np->n_name) == false)
+ if (insert_font(np->n_name, FONT_AUTO) == false)
printf("failed to add font: %s\n", np->n_name);
free(np->n_name);
free(np);
@@ -1809,6 +1920,14 @@ autoload_font(void)
unsetenv("screen-font");
env_setenv("screen-font", EV_VOLATILE, NULL, font_set, env_nounset);
+
+ /*
+ * If vga text mode was requested, load vga.font (8x16 bold) font.
+ */
+ if (bios) {
+ bios_text_font(true);
+ }
+
/* Trigger tem update. */
tems.update_font = true;
plat_cons_update_mode(-1);
@@ -1819,44 +1938,62 @@ COMMAND_SET(load_font, "loadfont", "load console font from file", command_font);
static int
command_font(int argc, char *argv[])
{
- int i, rc = CMD_OK;
+ int i, c, rc = CMD_OK;
struct fontlist *fl;
- bitmap_data_t *bd;
+ bool list;
- if (argc > 2) {
- printf("Usage: loadfont [file.fnt]\n");
- return (CMD_ERROR);
+ list = false;
+ optind = 1;
+ optreset = 1;
+ rc = CMD_OK;
+
+ while ((c = getopt(argc, argv, "l")) != -1) {
+ switch (c) {
+ case 'l':
+ list = true;
+ break;
+ case '?':
+ default:
+ return (CMD_ERROR);
+ }
}
- if (argc == 2) {
- char *name = argv[1];
+ argc -= optind;
+ argv += optind;
- if (insert_font(name) == false) {
- printf("loadfont error: failed to load: %s\n", name);
- return (CMD_ERROR);
+ if (argc > 1 || (list && argc != 0)) {
+ printf("Usage: loadfont [-l] | [file.fnt]\n");
+ return (CMD_ERROR);
+ }
+
+ if (list) {
+ STAILQ_FOREACH(fl, &fonts, font_next) {
+ printf("font %s: %dx%d%s\n", fl->font_name,
+ fl->font_data->width,
+ fl->font_data->height,
+ fl->font_data->font == NULL? "" : " loaded");
}
+ return (CMD_OK);
+ }
+
+ if (argc == 1) {
+ char *name = argv[0];
- bd = load_font(name);
- if (bd == NULL) {
+ if (insert_font(name, FONT_MANUAL) == false) {
printf("loadfont error: failed to load: %s\n", name);
return (CMD_ERROR);
}
- /* Get the font list entry and mark it manually loaded. */
- STAILQ_FOREACH(fl, &fonts, font_next) {
- if (strcmp(fl->font_name, name) == 0)
- fl->font_flags = FONT_MANUAL;
- }
tems.update_font = true;
plat_cons_update_mode(-1);
return (CMD_OK);
}
- if (argc == 1) {
+ if (argc == 0) {
/*
* Walk entire font list, release any loaded font, and set
- * autoload flag. If the font list is empty, the tem will
- * get the builtin default.
+ * autoload flag. The font list does have at least the builtin
+ * default font.
*/
STAILQ_FOREACH(fl, &fonts, font_next) {
if (fl->font_data->font != NULL) {
diff --git a/usr/src/boot/sys/boot/common/gfx_fb.h b/usr/src/boot/sys/boot/common/gfx_fb.h
index 19227151f8..de199d1472 100644
--- a/usr/src/boot/sys/boot/common/gfx_fb.h
+++ b/usr/src/boot/sys/boot/common/gfx_fb.h
@@ -105,6 +105,7 @@ struct vesa_edid_info {
extern multiboot_tag_framebuffer_t gfx_fb;
+void bios_text_font(bool);
void gfx_framework_init(struct visual_ops *);
uint32_t gfx_fb_color_map(uint8_t);
void gfx_fb_display_cursor(struct vis_conscursor *);
diff --git a/usr/src/boot/sys/boot/common/module.c b/usr/src/boot/sys/boot/common/module.c
index 4936ec5a3c..481c07eb58 100644
--- a/usr/src/boot/sys/boot/common/module.c
+++ b/usr/src/boot/sys/boot/common/module.c
@@ -531,7 +531,14 @@ build_font_module(void)
/* helper pointers */
bd = NULL;
STAILQ_FOREACH(fl, &fonts, font_next) {
- if (fl->font_data->font != NULL) {
+ if (tems.ts_font.vf_width == fl->font_data->width &&
+ tems.ts_font.vf_height == fl->font_data->height) {
+ /*
+ * Kernel does have better built in font.
+ */
+ if (fl->font_flags == FONT_BUILTIN)
+ return;
+
bd = fl->font_data;
break;
}
diff --git a/usr/src/boot/sys/boot/common/part.c b/usr/src/boot/sys/boot/common/part.c
index bcc792dcd4..084eb38f80 100644
--- a/usr/src/boot/sys/boot/common/part.c
+++ b/usr/src/boot/sys/boot/common/part.c
@@ -56,7 +56,6 @@ static const uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
static const uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI;
static const uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
static const uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
-static const uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS;
static const uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
static const uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
static const uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
@@ -96,7 +95,6 @@ static struct parttypes {
{ PART_EFI, "EFI" },
{ PART_FREEBSD, "FreeBSD" },
{ PART_FREEBSD_BOOT, "FreeBSD boot" },
- { PART_FREEBSD_NANDFS, "FreeBSD nandfs" },
{ PART_FREEBSD_UFS, "FreeBSD UFS" },
{ PART_FREEBSD_ZFS, "FreeBSD ZFS" },
{ PART_FREEBSD_SWAP, "FreeBSD swap" },
@@ -158,8 +156,6 @@ gpt_parttype(uuid_t type)
return (PART_FREEBSD_SWAP);
else if (uuid_equal(&type, &gpt_uuid_freebsd_vinum, NULL))
return (PART_FREEBSD_VINUM);
- else if (uuid_equal(&type, &gpt_uuid_freebsd_nandfs, NULL))
- return (PART_FREEBSD_NANDFS);
else if (uuid_equal(&type, &gpt_uuid_freebsd, NULL))
return (PART_FREEBSD);
else if (uuid_equal(&type, &gpt_uuid_illumos_boot, NULL))
@@ -473,8 +469,6 @@ bsd_parttype(uint8_t type)
{
switch (type) {
- case FS_NANDFS:
- return (PART_FREEBSD_NANDFS);
case FS_SWAP:
return (PART_FREEBSD_SWAP);
case FS_BSDFFS:
@@ -555,8 +549,6 @@ vtoc8_parttype(uint16_t type)
{
switch (type) {
- case VTOC_TAG_FREEBSD_NANDFS:
- return (PART_FREEBSD_NANDFS);
case VTOC_TAG_FREEBSD_SWAP:
return (PART_FREEBSD_SWAP);
case VTOC_TAG_FREEBSD_UFS:
diff --git a/usr/src/boot/sys/boot/common/part.h b/usr/src/boot/sys/boot/common/part.h
index bed69c4484..bdeddcbd5c 100644
--- a/usr/src/boot/sys/boot/common/part.h
+++ b/usr/src/boot/sys/boot/common/part.h
@@ -44,7 +44,6 @@ enum partition_type {
PART_EFI,
PART_FREEBSD,
PART_FREEBSD_BOOT,
- PART_FREEBSD_NANDFS,
PART_FREEBSD_UFS,
PART_FREEBSD_ZFS,
PART_FREEBSD_SWAP,
diff --git a/usr/src/boot/sys/boot/common/tem.c b/usr/src/boot/sys/boot/common/tem.c
index 9f4a852286..97a7745285 100644
--- a/usr/src/boot/sys/boot/common/tem.c
+++ b/usr/src/boot/sys/boot/common/tem.c
@@ -68,7 +68,6 @@
#include <sys/consplat.h>
#include <sys/kd.h>
#include <stdbool.h>
-#include <lz4.h>
/* Terminal emulator internal helper functions */
static void tems_setup_terminal(struct vis_devinit *, size_t, size_t);
@@ -434,10 +433,9 @@ static void
tems_setup_font(screen_size_t height, screen_size_t width)
{
bitmap_data_t *font_data;
- int i;
/*
- * set_font() will select a appropriate sized font for
+ * set_font() will select an appropriate sized font for
* the number of rows and columns selected. If we don't
* have a font that will fit, then it will use the
* default builtin font and adjust the rows and columns
@@ -446,44 +444,24 @@ tems_setup_font(screen_size_t height, screen_size_t width)
font_data = set_font(&tems.ts_c_dimension.height,
&tems.ts_c_dimension.width, height, width);
+ if (font_data == NULL)
+ panic("out of memory");
+
/*
- * The built in font is compressed, to use it, we
- * uncompress it into the allocated buffer.
- * To use loaded font, we assign the loaded buffer.
- * In case of next load, the previously loaded data
- * is freed by the process of loading the new font.
+ * To use loaded font, we assign the loaded font data to tems.ts_font.
+ * In case of next load, the previously loaded data is freed
+ * when loading the new font.
*/
- if (tems.ts_font.vf_bytes == NULL) {
- for (i = 0; i < VFNT_MAPS; i++) {
- tems.ts_font.vf_map[i] =
- font_data->font->vf_map[i];
- }
-
- if (font_data->compressed_size != 0) {
- /*
- * We only expect this allocation to
- * happen at startup, and therefore not to fail.
- */
- tems.ts_font.vf_bytes =
- malloc(font_data->uncompressed_size);
- if (tems.ts_font.vf_bytes == NULL)
- panic("out of memory");
- (void) lz4_decompress(
- font_data->compressed_data,
- tems.ts_font.vf_bytes,
- font_data->compressed_size,
- font_data->uncompressed_size, 0);
- } else {
- tems.ts_font.vf_bytes =
- font_data->font->vf_bytes;
- }
- tems.ts_font.vf_width = font_data->font->vf_width;
- tems.ts_font.vf_height = font_data->font->vf_height;
- for (i = 0; i < VFNT_MAPS; i++) {
- tems.ts_font.vf_map_count[i] =
- font_data->font->vf_map_count[i];
- }
+ for (int i = 0; i < VFNT_MAPS; i++) {
+ tems.ts_font.vf_map[i] =
+ font_data->font->vf_map[i];
+ tems.ts_font.vf_map_count[i] =
+ font_data->font->vf_map_count[i];
}
+
+ tems.ts_font.vf_bytes = font_data->font->vf_bytes;
+ tems.ts_font.vf_width = font_data->font->vf_width;
+ tems.ts_font.vf_height = font_data->font->vf_height;
}
static void
@@ -900,24 +878,23 @@ tems_get_initial_color(tem_color_t *pcolor)
if (inverse_screen)
flags |= TEM_ATTR_SCREEN_REVERSE;
- /*
- * In case of black on white we want bright white for BG.
- * In case if white on black, to improve readability,
- * we want bold white.
- */
if (flags != 0) {
/*
- * If either reverse flag is set, the screen is in
- * white-on-black mode. We set the bold flag to
- * improve readability.
+ * The reverse attribute is set.
+ * In case of black on white we want bright white for BG.
+ */
+ if (pcolor->fg_color == ANSI_COLOR_WHITE)
+ flags |= TEM_ATTR_BRIGHT_BG;
+
+ /*
+ * For white on black, unset the bright attribute we
+ * had set to have bright white background.
*/
- flags |= TEM_ATTR_BOLD;
+ if (pcolor->fg_color == ANSI_COLOR_BLACK)
+ flags &= ~TEM_ATTR_BRIGHT_BG;
} else {
/*
- * Otherwise, the screen is in black-on-white mode.
- * The SPARC PROM console, which starts in this mode,
- * uses the bright white background colour so we
- * match it here.
+ * In case of black on white we want bright white for BG.
*/
if (pcolor->bg_color == ANSI_COLOR_WHITE)
flags |= TEM_ATTR_BRIGHT_BG;
@@ -2815,19 +2792,29 @@ tem_get_attr(struct tem_vt_state *tem, text_color_t *fg,
static void
tem_get_color(text_color_t *fg, text_color_t *bg, term_char_t c)
{
+ bool bold_font;
+
*fg = c.tc_fg_color;
*bg = c.tc_bg_color;
+ bold_font = tems.ts_font.vf_map_count[VFNT_MAP_BOLD] != 0;
+
+ /*
+ * If we have both normal and bold font components,
+ * we use bold font for TEM_ATTR_BOLD.
+ * The bright color is traditionally used with TEM_ATTR_BOLD,
+ * in case there is no bold font.
+ */
if (c.tc_fg_color < XLATE_NCOLORS) {
- if (TEM_CHAR_ATTR(c.tc_char) &
- (TEM_ATTR_BRIGHT_FG | TEM_ATTR_BOLD))
+ if (TEM_ATTR_ISSET(c.tc_char, TEM_ATTR_BRIGHT_FG) ||
+ (TEM_ATTR_ISSET(c.tc_char, TEM_ATTR_BOLD) && !bold_font))
*fg = brt_xlate[c.tc_fg_color];
else
*fg = dim_xlate[c.tc_fg_color];
}
if (c.tc_bg_color < XLATE_NCOLORS) {
- if (TEM_CHAR_ATTR(c.tc_char) & TEM_ATTR_BRIGHT_BG)
+ if (TEM_ATTR_ISSET(c.tc_char, TEM_ATTR_BRIGHT_BG))
*bg = brt_xlate[c.tc_bg_color];
else
*bg = dim_xlate[c.tc_bg_color];
diff --git a/usr/src/boot/sys/boot/common/ufsread.c b/usr/src/boot/sys/boot/common/ufsread.c
deleted file mode 100644
index 3dee081a80..0000000000
--- a/usr/src/boot/sys/boot/common/ufsread.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * Copyright (c) 2002 McAfee, Inc.
- * All rights reserved.
- *
- * This software was developed for the FreeBSD Project by Marshall
- * Kirk McKusick and McAfee Research,, the Security Research Division of
- * McAfee, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as
- * part of the DARPA CHATS research program
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/*-
- * Copyright (c) 1998 Robert Nordier
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
- *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
- */
-
-#include <sys/cdefs.h>
-
-#include <ufs/ufs/dinode.h>
-#include <ufs/ufs/dir.h>
-#include <ufs/ffs/fs.h>
-
-#ifdef UFS_SMALL_CGBASE
-/* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase
- (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can
- support both UFS1 and UFS2. */
-#undef cgbase
-#define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c)))
-#endif
-
-typedef uint32_t ufs_ino_t;
-
-/*
- * We use 4k `virtual' blocks for filesystem data, whatever the actual
- * filesystem block size. FFS blocks are always a multiple of 4k.
- */
-#define VBLKSHIFT 12
-#define VBLKSIZE (1 << VBLKSHIFT)
-#define VBLKMASK (VBLKSIZE - 1)
-#define DBPERVBLK (VBLKSIZE / DEV_BSIZE)
-#define INDIRPERVBLK(fs) (NINDIR(fs) / ((fs)->fs_bsize >> VBLKSHIFT))
-#define IPERVBLK(fs) (INOPB(fs) / ((fs)->fs_bsize >> VBLKSHIFT))
-#define INO_TO_VBA(fs, ipervblk, x) \
- (fsbtodb(fs, cgimin(fs, ino_to_cg(fs, x))) + \
- (((x) % (fs)->fs_ipg) / (ipervblk) * DBPERVBLK))
-#define INO_TO_VBO(ipervblk, x) ((x) % ipervblk)
-#define FS_TO_VBA(fs, fsb, off) (fsbtodb(fs, fsb) + \
- ((off) / VBLKSIZE) * DBPERVBLK)
-#define FS_TO_VBO(fs, fsb, off) ((off) & VBLKMASK)
-
-/* Buffers that must not span a 64k boundary. */
-struct dmadat {
- char blkbuf[VBLKSIZE]; /* filesystem blocks */
- char indbuf[VBLKSIZE]; /* indir blocks */
- char sbbuf[SBLOCKSIZE]; /* superblock */
- char secbuf[DEV_BSIZE]; /* for MBR/disklabel */
-};
-static struct dmadat *dmadat;
-
-static ufs_ino_t lookup(const char *);
-static ssize_t fsread(ufs_ino_t, void *, size_t);
-static uint8_t inode_type(ufs_ino_t inode);
-
-static uint8_t ls, dsk_meta;
-static uint32_t fs_off;
-
-#ifndef UFS2_ONLY
-static struct ufs1_dinode dp1;
-ufs1_daddr_t addr1;
-#endif
-#ifndef UFS1_ONLY
-static struct ufs2_dinode dp2;
-#endif
-static struct fs fs;
-static ufs_ino_t inomap;
-static ufs2_daddr_t blkmap, indmap;
-
-static __inline uint8_t
-fsfind(const char *name, ufs_ino_t * ino)
-{
- static char buf[DEV_BSIZE];
- struct direct *d;
- char *s;
- ssize_t n;
-
- fs_off = 0;
- while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0)
- for (s = buf; s < buf + DEV_BSIZE;) {
- d = (void *)s;
- if (ls)
- printf("%s ", d->d_name);
- else if (!strcmp(name, d->d_name)) {
- *ino = d->d_ino;
- return inode_type(*ino);
- }
- s += d->d_reclen;
- }
- if (n != -1 && ls)
- printf("\n");
- return 0;
-}
-
-static ufs_ino_t
-lookup(const char *path)
-{
- static char name[UFS_MAXNAMLEN + 1];
- const char *s;
- ufs_ino_t ino;
- ssize_t n;
- uint8_t dt;
-
- ino = ROOTINO;
- dt = DT_DIR;
- for (;;) {
- if (*path == '/')
- path++;
- if (!*path)
- break;
- for (s = path; *s && *s != '/'; s++);
- if ((n = s - path) > UFS_MAXNAMLEN)
- return 0;
- ls = *path == '?' && n == 1 && !*s;
- memcpy(name, path, n);
- name[n] = 0;
- if (dt != DT_DIR) {
- printf("%s: not a directory.\n", name);
- return (0);
- }
- if ((dt = fsfind(name, &ino)) <= 0)
- break;
- path = s;
- }
- return dt == DT_REG ? ino : 0;
-}
-
-/*
- * Possible superblock locations ordered from most to least likely.
- */
-static int sblock_try[] = SBLOCKSEARCH;
-
-#if defined(UFS2_ONLY)
-#define DIP(field) dp2.field
-#elif defined(UFS1_ONLY)
-#define DIP(field) dp1.field
-#else
-#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field
-#endif
-
-static uint8_t
-inode_type(ufs_ino_t inode)
-{
- char *blkbuf;
- size_t n;
-
- blkbuf = dmadat->blkbuf;
-
- if (!inode)
- return (0);
- if (inomap != inode) {
- n = IPERVBLK(&fs);
- if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK))
- return (-1);
- n = INO_TO_VBO(n, inode);
-#if defined(UFS1_ONLY)
- memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n,
- sizeof(struct ufs1_dinode));
-#elif defined(UFS2_ONLY)
- memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n,
- sizeof(struct ufs2_dinode));
-#else
- if (fs.fs_magic == FS_UFS1_MAGIC)
- memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n,
- sizeof(struct ufs1_dinode));
- else
- memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n,
- sizeof(struct ufs2_dinode));
-#endif
- inomap = inode;
- fs_off = 0;
- blkmap = indmap = 0;
- }
- return (IFTODT(DIP(di_mode)));
-}
-
-static ssize_t
-fsread_size(ufs_ino_t inode, void *buf, size_t nbyte, size_t *fsizep)
-{
- char *blkbuf;
- void *indbuf;
- char *s;
- size_t n, nb, size, off, vboff;
- ufs_lbn_t lbn;
- ufs2_daddr_t addr2, vbaddr;
- u_int u;
-
- /* Basic parameter validation. */
- if ((buf == NULL && nbyte != 0) || dmadat == NULL)
- return (-1);
-
- blkbuf = dmadat->blkbuf;
- indbuf = dmadat->indbuf;
-
- /*
- * Force probe if inode is zero to ensure we have a valid fs, otherwise
- * when probing multiple paritions, reads from subsequent parititions
- * will incorrectly succeed.
- */
- if (!dsk_meta || inode == 0) {
- inomap = 0;
- dsk_meta = 0;
- for (n = 0; sblock_try[n] != -1; n++) {
- if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE,
- SBLOCKSIZE / DEV_BSIZE))
- return -1;
- memcpy(&fs, dmadat->sbbuf, sizeof(struct fs));
- if ((
-#if defined(UFS1_ONLY)
- fs.fs_magic == FS_UFS1_MAGIC
-#elif defined(UFS2_ONLY)
- (fs.fs_magic == FS_UFS2_MAGIC &&
- fs.fs_sblockloc == sblock_try[n])
-#else
- fs.fs_magic == FS_UFS1_MAGIC ||
- (fs.fs_magic == FS_UFS2_MAGIC &&
- fs.fs_sblockloc == sblock_try[n])
-#endif
- ) &&
- fs.fs_bsize <= MAXBSIZE &&
- fs.fs_bsize >= (int32_t)sizeof(struct fs))
- break;
- }
- if (sblock_try[n] == -1) {
- return -1;
- }
- dsk_meta++;
- } else
- memcpy(&fs, dmadat->sbbuf, sizeof(struct fs));
- if (!inode)
- return 0;
- if (inomap != inode) {
- n = IPERVBLK(&fs);
- if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK))
- return -1;
- n = INO_TO_VBO(n, inode);
-#if defined(UFS1_ONLY)
- memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n,
- sizeof(dp1));
-#elif defined(UFS2_ONLY)
- memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n,
- sizeof(dp2));
-#else
- if (fs.fs_magic == FS_UFS1_MAGIC)
- memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n,
- sizeof(dp1));
- else
- memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n,
- sizeof(dp2));
-#endif
- inomap = inode;
- fs_off = 0;
- blkmap = indmap = 0;
- }
- s = buf;
- size = DIP(di_size);
- n = size - fs_off;
- if (nbyte > n)
- nbyte = n;
- nb = nbyte;
- while (nb) {
- lbn = lblkno(&fs, fs_off);
- off = blkoff(&fs, fs_off);
- if (lbn < NDADDR) {
- addr2 = DIP(di_db[lbn]);
- } else if (lbn < NDADDR + NINDIR(&fs)) {
- n = INDIRPERVBLK(&fs);
- addr2 = DIP(di_ib[0]);
- u = (u_int)(lbn - NDADDR) / n * DBPERVBLK;
- vbaddr = fsbtodb(&fs, addr2) + u;
- if (indmap != vbaddr) {
- if (dskread(indbuf, vbaddr, DBPERVBLK))
- return -1;
- indmap = vbaddr;
- }
- n = (lbn - NDADDR) & (n - 1);
-#if defined(UFS1_ONLY)
- memcpy(&addr1, (ufs1_daddr_t *)indbuf + n,
- sizeof(ufs1_daddr_t));
- addr2 = addr1;
-#elif defined(UFS2_ONLY)
- memcpy(&addr2, (ufs2_daddr_t *)indbuf + n,
- sizeof(ufs2_daddr_t));
-#else
- if (fs.fs_magic == FS_UFS1_MAGIC) {
- memcpy(&addr1, (ufs1_daddr_t *)indbuf + n,
- sizeof(ufs1_daddr_t));
- addr2 = addr1;
- } else
- memcpy(&addr2, (ufs2_daddr_t *)indbuf + n,
- sizeof(ufs2_daddr_t));
-#endif
- } else
- return -1;
- vbaddr = fsbtodb(&fs, addr2) + (off >> VBLKSHIFT) * DBPERVBLK;
- vboff = off & VBLKMASK;
- n = sblksize(&fs, (off_t)size, lbn) - (off & ~VBLKMASK);
- if (n > VBLKSIZE)
- n = VBLKSIZE;
- if (blkmap != vbaddr) {
- if (dskread(blkbuf, vbaddr, n >> DEV_BSHIFT))
- return -1;
- blkmap = vbaddr;
- }
- n -= vboff;
- if (n > nb)
- n = nb;
- memcpy(s, blkbuf + vboff, n);
- s += n;
- fs_off += n;
- nb -= n;
- }
-
- if (fsizep != NULL)
- *fsizep = size;
-
- return nbyte;
-}
-
-static ssize_t
-fsread(ufs_ino_t inode, void *buf, size_t nbyte)
-{
-
- return fsread_size(inode, buf, nbyte, NULL);
-}
-
diff --git a/usr/src/boot/sys/boot/efi/libefi/Makefile.com b/usr/src/boot/sys/boot/efi/libefi/Makefile.com
index 3e0219aa9a..5d3285db2c 100644
--- a/usr/src/boot/sys/boot/efi/libefi/Makefile.com
+++ b/usr/src/boot/sys/boot/efi/libefi/Makefile.com
@@ -47,7 +47,7 @@ CPPFLAGS += -I../../../../../lib/libstand
CPPFLAGS += -I$(ZFSSRC)
CPPFLAGS += -I../../../../cddl/boot/zfs
-gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
+gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR) -I$(LZ4)
pnglite.o := CPPFLAGS += -I$(ZLIB)
gfx_fb.o pnglite.o efi_console.o := CPPFLAGS += -I$(PNGLITE)
diff --git a/usr/src/boot/sys/boot/efi/loader/Makefile.com b/usr/src/boot/sys/boot/efi/loader/Makefile.com
index e1710ecef6..adb6b80192 100644
--- a/usr/src/boot/sys/boot/efi/loader/Makefile.com
+++ b/usr/src/boot/sys/boot/efi/loader/Makefile.com
@@ -61,7 +61,7 @@ OBJS= \
vers.o
module.o := CPPFLAGS += -I$(BOOTSRC)/libcrypto
-tem.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR) -I$(LZ4)
+tem.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
CPPFLAGS += -I../../../../../include -I../../..../
CPPFLAGS += -I../../../../../lib/libstand
diff --git a/usr/src/boot/sys/boot/efi/loader/main.c b/usr/src/boot/sys/boot/efi/loader/main.c
index 3fd902e78a..b5b310b9ad 100644
--- a/usr/src/boot/sys/boot/efi/loader/main.c
+++ b/usr/src/boot/sys/boot/efi/loader/main.c
@@ -694,7 +694,7 @@ main(int argc, CHAR16 *argv[])
if (!interactive_interrupt("Failed to find bootable partition"))
return (EFI_NOT_FOUND);
- autoload_font(); /* Set up the font list for console. */
+ autoload_font(false); /* Set up the font list for console. */
efi_init_environment();
setenv("ISADIR", "amd64", 1); /* we only build 64bit */
bi_isadir(); /* set ISADIR */
diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c
index 63ba02968a..63086e3cd1 100644
--- a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c
+++ b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c
@@ -30,6 +30,7 @@
#include <machine/pc/bios.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stddef.h>
#include <a.out.h>
@@ -90,6 +91,18 @@ static const unsigned char flags[NOPT] = {
};
uint32_t opts;
+/*
+ * Paths to try loading before falling back to the boot2 prompt.
+ */
+#define PATH_ZFSLOADER "/boot/zfsloader"
+static const struct string {
+ const char *p;
+ size_t len;
+} loadpath[] = {
+ { PATH_LOADER, sizeof (PATH_LOADER) },
+ { PATH_ZFSLOADER, sizeof (PATH_ZFSLOADER) }
+};
+
static const unsigned char dev_maj[NDEV] = {30, 4, 2};
static struct i386_devdesc *bdev;
@@ -130,7 +143,9 @@ struct fs_ops *file_system[] = {
int
main(void)
{
- int auto_boot, i, fd;
+ unsigned i;
+ int fd;
+ bool auto_boot;
struct disk_devdesc devdesc;
bios_getmem();
@@ -198,7 +213,7 @@ main(void)
/* Process configuration file */
setenv("screen-#rows", "24", 1);
- auto_boot = 1;
+ auto_boot = true;
fd = open(PATH_CONFIG, O_RDONLY);
if (fd == -1)
@@ -222,37 +237,29 @@ main(void)
*/
memcpy(cmddup, cmd, sizeof (cmd));
if (parse_cmd())
- auto_boot = 0;
+ auto_boot = false;
if (!OPT_CHECK(RBX_QUIET))
printf("%s: %s\n", PATH_CONFIG, cmddup);
/* Do not process this command twice */
*cmd = 0;
}
- /*
- * Try to exec stage 3 boot loader. If interrupted by a keypress,
- * or in case of failure, switch off auto boot.
- */
-
if (auto_boot && !*kname) {
- memcpy(kname, PATH_LOADER, sizeof (PATH_LOADER));
- if (!keyhit(3)) {
- load();
- auto_boot = 0;
- /*
- * Try to fall back to /boot/zfsloader.
- * This fallback should be eventually removed.
- * Created: 08/03/2018
- */
-#define PATH_ZFSLOADER "/boot/zfsloader"
- memcpy(kname, PATH_ZFSLOADER, sizeof (PATH_ZFSLOADER));
+ /*
+ * Try to exec stage 3 boot loader. If interrupted by a
+ * keypress, or in case of failure, drop the user to the
+ * boot2 prompt..
+ */
+ auto_boot = false;
+ for (i = 0; i < nitems(loadpath); i++) {
+ memcpy(kname, loadpath[i].p, loadpath[i].len);
+ if (keyhit(3))
+ break;
load();
- /*
- * Still there? restore default loader name for prompt.
- */
- memcpy(kname, PATH_LOADER, sizeof (PATH_LOADER));
}
}
+ /* Reset to default */
+ memcpy(kname, loadpath[0].p, loadpath[0].len);
/* Present the user with the boot2 prompt. */
@@ -267,7 +274,7 @@ main(void)
getstr(cmd, sizeof (cmd));
else if (!auto_boot || !OPT_CHECK(RBX_QUIET))
putchar('\n');
- auto_boot = 0;
+ auto_boot = false;
if (parse_cmd())
putchar('\a');
else
diff --git a/usr/src/boot/sys/boot/i386/libi386/Makefile b/usr/src/boot/sys/boot/i386/libi386/Makefile
index 35b98290aa..d28628c0dd 100644
--- a/usr/src/boot/sys/boot/i386/libi386/Makefile
+++ b/usr/src/boot/sys/boot/i386/libi386/Makefile
@@ -98,7 +98,7 @@ CPPFLAGS += -I$(PNGLITE)
SRCS += $(COMMON)/gfx_fb.c $(PNGLITE)/pnglite.c
OBJS += gfx_fb.o pnglite.o
-gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
+gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR) -I$(LZ4)
pnglite.o := CPPFLAGS += -I$(ZLIB)
SRCS += $(ZFSSRC)/devicename_stubs.c
diff --git a/usr/src/boot/sys/boot/i386/libi386/vbe.c b/usr/src/boot/sys/boot/i386/libi386/vbe.c
index ef8770f3c5..d8ad4ed643 100644
--- a/usr/src/boot/sys/boot/i386/libi386/vbe.c
+++ b/usr/src/boot/sys/boot/i386/libi386/vbe.c
@@ -758,6 +758,7 @@ command_vesa(int argc, char *argv[])
return (CMD_OK);
reset_font_flags();
+ bios_text_font(true);
bios_set_text_mode(VGA_TEXT_MODE);
plat_cons_update_mode(0);
return (CMD_OK);
@@ -805,6 +806,7 @@ command_vesa(int argc, char *argv[])
if (modenum >= 0x100) {
if (vbestate.vbe_mode != modenum) {
reset_font_flags();
+ bios_text_font(false);
vbe_set_mode(modenum);
plat_cons_update_mode(1);
}
diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile
index 4d2c68cedd..5071ec31bc 100644
--- a/usr/src/boot/sys/boot/i386/loader/Makefile
+++ b/usr/src/boot/sys/boot/i386/loader/Makefile
@@ -62,7 +62,7 @@ SRCS += zfs_cmd.c
SRCS += font.c $(FONT).c tem.c
module.o := CPPFLAGS += -I$(BOOTSRC)/libcrypto
-tem.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR) -I$(LZ4)
+tem.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
SRCS += load_elf32.c load_elf32_obj.c reloc_elf32.c
SRCS += load_elf64.c load_elf64_obj.c reloc_elf64.c
diff --git a/usr/src/boot/sys/boot/i386/loader/conf.c b/usr/src/boot/sys/boot/i386/loader/conf.c
index 25ce1a8806..d8025b3ef8 100644
--- a/usr/src/boot/sys/boot/i386/loader/conf.c
+++ b/usr/src/boot/sys/boot/i386/loader/conf.c
@@ -72,9 +72,6 @@ struct fs_ops *file_system[] = {
&ext2fs_fsops,
#endif
&cd9660_fsops,
-#if defined(LOADER_NANDFS_SUPPORT)
- &nandfs_fsops,
-#endif
&tftp_fsops,
&nfs_fsops,
#ifdef LOADER_BZIP2_SUPPORT
diff --git a/usr/src/boot/sys/boot/i386/loader/main.c b/usr/src/boot/sys/boot/i386/loader/main.c
index 58ad05e106..169d0e1ce5 100644
--- a/usr/src/boot/sys/boot/i386/loader/main.c
+++ b/usr/src/boot/sys/boot/i386/loader/main.c
@@ -186,7 +186,7 @@ main(void)
printf("\n%s", bootprog_info);
extract_currdev(); /* set $currdev and $loaddev */
- autoload_font(); /* Set up the font list for console. */
+ autoload_font(OPT_CHECK(RBX_TEXT_MODE) != 0);
bi_isadir();
bios_getsmap();
diff --git a/usr/src/boot/sys/sys/disklabel.h b/usr/src/boot/sys/sys/disklabel.h
index 42c757aaf3..7939335673 100644
--- a/usr/src/boot/sys/sys/disklabel.h
+++ b/usr/src/boot/sys/sys/disklabel.h
@@ -234,7 +234,6 @@ static const char *dktypenames[] = {
#define FS_UDF 24 /* UDF */
#define FS_EFS 26 /* SGI's Extent File system */
#define FS_ZFS 27 /* Sun's ZFS */
-#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */
#ifdef FSTYPENAMES
static const char *fstypenames[] = {
@@ -268,7 +267,6 @@ static const char *fstypenames[] = {
"ZFS",
"?",
"?",
- "nandfs",
NULL
};
#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
diff --git a/usr/src/boot/sys/sys/gpt.h b/usr/src/boot/sys/sys/gpt.h
index bb39876e35..f575489a3e 100644
--- a/usr/src/boot/sys/sys/gpt.h
+++ b/usr/src/boot/sys/sys/gpt.h
@@ -79,8 +79,6 @@ struct gpt_ent {
{0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
#define GPT_ENT_TYPE_FREEBSD_BOOT \
{0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}}
-#define GPT_ENT_TYPE_FREEBSD_NANDFS \
- {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}}
#define GPT_ENT_TYPE_FREEBSD_SWAP \
{0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
#define GPT_ENT_TYPE_FREEBSD_UFS \
diff --git a/usr/src/boot/sys/sys/tem_impl.h b/usr/src/boot/sys/sys/tem_impl.h
index d942aecdeb..ee0dcbb28f 100644
--- a/usr/src/boot/sys/sys/tem_impl.h
+++ b/usr/src/boot/sys/sys/tem_impl.h
@@ -63,6 +63,7 @@ typedef uint32_t tem_char_t; /* 32bit char to support UTF-8 */
#define TEM_CHAR(c) ((c) & 0x1fffff)
#define TEM_CHAR_ATTR(c) (((c) >> 21) & TEM_ATTR_MASK)
#define TEM_ATTR(c) (((c) & TEM_ATTR_MASK) << 21)
+#define TEM_ATTR_ISSET(c, a) ((TEM_CHAR_ATTR(c) & (a)) == (a))
#define TEM_MAXPARAMS 5 /* maximum number of ANSI paramters */
#define TEM_MAXTAB 40 /* maximum number of tab stops */
diff --git a/usr/src/boot/sys/sys/vtoc.h b/usr/src/boot/sys/sys/vtoc.h
index 10d83499f8..b1d164e3ee 100644
--- a/usr/src/boot/sys/sys/vtoc.h
+++ b/usr/src/boot/sys/sys/vtoc.h
@@ -51,7 +51,6 @@
#define VTOC_TAG_FREEBSD_UFS 0x0902
#define VTOC_TAG_FREEBSD_VINUM 0x0903
#define VTOC_TAG_FREEBSD_ZFS 0x0904
-#define VTOC_TAG_FREEBSD_NANDFS 0x0905
#define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */
#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */