Print this page
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
    loader: pxe receive cleanup
    9475 libefi: Do not return only if ReceiveFilter
    installboot: should support efi system partition
    8931 boot1.efi: scan all display modes rather than
    loader: spinconsole updates
    loader: gfx experiment to try GOP Blt() function.
    sha1 build test
    loader: add sha1 hash calculation
    common/sha1: update for loader build
    loader: biosdisk rework
    uts: 32-bit kernel FB needs mapping in low memory
    uts: add diag-device
    uts: boot console mirror with diag-device
    uts: enable very early console on ttya
    kmdb: add diag-device as input/output device
    uts: test VGA memory exclusion from mapping
    uts: clear boot mapping and protect boot pages test
    uts: add dboot map debug printf
    uts: need to release FB pages in release_bootstrap()
    uts: add screenmap ioctl
    uts: update sys/queue.h
    loader: add illumos uts/common to include path
    loader: tem/gfx font cleanup
    loader: vbe checks
    uts: gfx_private set KD_TEXT when KD_RESETTEXT is
    uts: gfx 8-bit update
    loader: gfx 8-bit fix
    loader: always set media size from partition.
    uts: MB2 support for 32-bit kernel
    loader: x86 should have tem 80x25
    uts: x86 should have tem 80x25
    uts: font update
    loader: font update
    uts: tem attributes
    loader: tem.c comment added
    uts: use font module
    loader: add font module
    loader: build rules for new font setup
    uts: gfx_private update for new font structure
    uts: early boot update for new font structure
    uts: font update
    uts: font build rules update for new fonts
    uts: tem update to new font structure
    loader: module.c needs to include tem_impl.h
    uts: gfx_private 8x16 font rework
    uts: make font_lookup public
    loader: font rework
    uts: font rework
    9259 libefi: efi_alloc_and_read should check for PMBR
    uts: tem utf-8 support
    loader: implement tem utf-8 support
    loader: tem should be able to display UTF-8
    7784 uts: console input should support utf-8
    7796 uts: ldterm default to utf-8
    uts: do not reset serial console
    uts: set up colors even if tem is not console
    uts: add type for early boot properties
    uts: gfx_private experiment with drm and vga
    uts: gfx_private should use setmode drm callback.
    uts: identify FB types and set up gfx_private based
    loader: replace gop and vesa with framebuffer
    uts: boot needs simple tem to support mdb
    uts: boot_keyboard should emit esc sequences for
    uts: gfx_private FB showuld be written by line
    kmdb: set terminal window size
    uts: gfx_private needs to keep track of early boot FB
    pnglite: move pnglite to usr/src/common
    loader: gfx_fb
    ficl-sys: add gfx primitives
    loader: add illumos.png logo
    ficl: add fb-putimage
    loader: add png support
    loader: add alpha blending for gfx_fb
    loader: use term-drawrect for menu frame
    ficl: add simple gfx words
    uts: provide fb_info via fbgattr dev_specific array.
    uts: gfx_private add alpha blending
    uts: update sys/ascii.h
    uts: tem OSC support (incomplete)
    uts: implement env module support and use data from
    uts: tem get colors from early boot data
    loader: use crc32 from libstand (libz)
    loader: optimize for size
    loader: pass tem info to the environment
    loader: import tem for loader console
    loader: UEFI loader needs to set ISADIR based on
    loader: need UEFI32 support
    8918 loader.efi: add vesa edid support
    uts: tem_safe_pix_clear_prom_output() should only
    uts: tem_safe_pix_clear_entire_screen() should use
    uts: tem_safe_check_first_time() should query cursor
    uts: tem implement cls callback & visual_io v4
    uts: gfx_vgatext use block cursor for vgatext
    uts: gfx_private implement cls callback & visual_io
    uts: gfx_private bitmap framebuffer implementation
    uts: early start frame buffer console support
    uts: font functions should check the input char
    uts: font rendering should support 16/24/32bit depths
    uts: use smallest font as fallback default.
    uts: update terminal dimensions based on selected
    7834 uts: vgatext should use gfx_private
    uts: add spacing property to 8859-1.bdf
    terminfo: add underline for sun-color
    terminfo: sun-color has 16 colors
    uts: add font load callback type
    loader: do not repeat int13 calls with error 0x20 and
    8905 loader: add skein/edonr support
    8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Revert "NEX-16819 loader UEFI support"
This reverts commit ec06b9fc617b99234e538bf2e7e4d02a24993e0c.
Reverting due to failures in the zfs-tests and the sharefs-tests
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
    loader: pxe receive cleanup
    9475 libefi: Do not return only if ReceiveFilter
    installboot: should support efi system partition
    8931 boot1.efi: scan all display modes rather than
    loader: spinconsole updates
    loader: gfx experiment to try GOP Blt() function.
    sha1 build test
    loader: add sha1 hash calculation
    common/sha1: update for loader build
    loader: biosdisk rework
    uts: 32-bit kernel FB needs mapping in low memory
    uts: add diag-device
    uts: boot console mirror with diag-device
    uts: enable very early console on ttya
    kmdb: add diag-device as input/output device
    uts: test VGA memory exclusion from mapping
    uts: clear boot mapping and protect boot pages test
    uts: add dboot map debug printf
    uts: need to release FB pages in release_bootstrap()
    uts: add screenmap ioctl
    uts: update sys/queue.h
    loader: add illumos uts/common to include path
    loader: tem/gfx font cleanup
    loader: vbe checks
    uts: gfx_private set KD_TEXT when KD_RESETTEXT is
    uts: gfx 8-bit update
    loader: gfx 8-bit fix
    loader: always set media size from partition.
    uts: MB2 support for 32-bit kernel
    loader: x86 should have tem 80x25
    uts: x86 should have tem 80x25
    uts: font update
    loader: font update
    uts: tem attributes
    loader: tem.c comment added
    uts: use font module
    loader: add font module
    loader: build rules for new font setup
    uts: gfx_private update for new font structure
    uts: early boot update for new font structure
    uts: font update
    uts: font build rules update for new fonts
    uts: tem update to new font structure
    loader: module.c needs to include tem_impl.h
    uts: gfx_private 8x16 font rework
    uts: make font_lookup public
    loader: font rework
    uts: font rework
    libefi: efi_alloc_and_read should check for PMBR
    uts: tem utf-8 support
    loader: implement tem utf-8 support
    loader: tem should be able to display UTF-8
    7784 uts: console input should support utf-8
    7796 uts: ldterm default to utf-8
    uts: do not reset serial console
    uts: set up colors even if tem is not console
    uts: add type for early boot properties
    uts: gfx_private experiment with drm and vga
    uts: gfx_private should use setmode drm callback.
    uts: identify FB types and set up gfx_private based
    loader: replace gop and vesa with framebuffer
    uts: boot needs simple tem to support mdb
    uts: boot_keyboard should emit esc sequences for
    uts: gfx_private FB showuld be written by line
    kmdb: set terminal window size
    uts: gfx_private needs to keep track of early boot FB
    pnglite: move pnglite to usr/src/common
    loader: gfx_fb
    ficl-sys: add gfx primitives
    loader: add illumos.png logo
    ficl: add fb-putimage
    loader: add png support
    loader: add alpha blending for gfx_fb
    loader: use term-drawrect for menu frame
    ficl: add simple gfx words
    uts: provide fb_info via fbgattr dev_specific array.
    uts: gfx_private add alpha blending
    uts: update sys/ascii.h
    uts: tem OSC support (incomplete)
    uts: implement env module support and use data from
    uts: tem get colors from early boot data
    loader: use crc32 from libstand (libz)
    loader: optimize for size
    loader: pass tem info to the environment
    loader: import tem for loader console
    loader: UEFI loader needs to set ISADIR based on
    loader: need UEFI32 support
    8918 loader.efi: add vesa edid support
    uts: tem_safe_pix_clear_prom_output() should only
    uts: tem_safe_pix_clear_entire_screen() should use
    uts: tem_safe_check_first_time() should query cursor
    uts: tem implement cls callback & visual_io v4
    uts: gfx_vgatext use block cursor for vgatext
    uts: gfx_private implement cls callback & visual_io
    uts: gfx_private bitmap framebuffer implementation
    uts: early start frame buffer console support
    uts: font functions should check the input char
    uts: font rendering should support 16/24/32bit depths
    uts: use smallest font as fallback default.
    uts: update terminal dimensions based on selected
    7834 uts: vgatext should use gfx_private
    uts: add spacing property to 8859-1.bdf
    terminfo: add underline for sun-color
    terminfo: sun-color has 16 colors
    uts: add font load callback type
    loader: do not repeat int13 calls with error 0x20 and
    8905 loader: add skein/edonr support
    8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>


  22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24  * SUCH DAMAGE.
  25  */
  26 
  27 #include <sys/types.h>
  28 #include <sys/stat.h>
  29 #include <fcntl.h>
  30 #include <errno.h>
  31 #include <stdlib.h>
  32 #include <stdio.h>
  33 #include <string.h>
  34 #include <strings.h>
  35 #include <limits.h>
  36 #include <unistd.h>
  37 #include <dirent.h>
  38 #include <macros.h>
  39 #include <sys/systeminfo.h>
  40 #include <sys/queue.h>
  41 #include <sys/mnttab.h>

  42 #include "ficl.h"
  43 
  44 /* Commands and return values; nonzero return sets command_errmsg != NULL */
  45 typedef int (bootblk_cmd_t)(int argc, char *argv[]);
  46 #define CMD_OK          0
  47 #define CMD_ERROR       1
  48 
  49 /*
  50  * Support for commands
  51  */
  52 struct bootblk_command
  53 {
  54         const char *c_name;
  55         const char *c_desc;
  56         bootblk_cmd_t *c_fn;
  57         STAILQ_ENTRY(bootblk_command) next;
  58 };
  59 
  60 #define MDIR_REMOVED    0x0001
  61 #define MDIR_NOHINTS    0x0002


  85 extern int pager_file(const char *);
  86 static int page_file(char *);
  87 static int include(const char *);
  88 
  89 static int command_help(int argc, char *argv[]);
  90 static int command_commandlist(int argc, char *argv[]);
  91 static int command_show(int argc, char *argv[]);
  92 static int command_set(int argc, char *argv[]);
  93 static int command_setprop(int argc, char *argv[]);
  94 static int command_unset(int argc, char *argv[]);
  95 static int command_echo(int argc, char *argv[]);
  96 static int command_read(int argc, char *argv[]);
  97 static int command_more(int argc, char *argv[]);
  98 static int command_ls(int argc, char *argv[]);
  99 static int command_include(int argc, char *argv[]);
 100 static int command_autoboot(int argc, char *argv[]);
 101 static int command_boot(int argc, char *argv[]);
 102 static int command_unload(int argc, char *argv[]);
 103 static int command_load(int argc, char *argv[]);
 104 static int command_reboot(int argc, char *argv[]);

 105 
 106 #define BF_PARSE        100
 107 #define BF_DICTSIZE     30000
 108 
 109 /* update when loader version will change */
 110 static const char bootprog_rev[] = "1.1";
 111 STAILQ_HEAD(cmdh, bootblk_command) commands;
 112 
 113 /*
 114  * BootForth   Interface to Ficl Forth interpreter.
 115  */
 116 
 117 ficlSystem *bf_sys;
 118 ficlVm  *bf_vm;
 119 
 120 /*
 121  * Redistribution and use in source and binary forms, with or without
 122  * modification, are permitted provided that the following conditions
 123  * are met:
 124  * 1. Redistributions of source code must retain the above copyright


 733         COMMAND_SET(cmdp, "read", "read input from the terminal", command_read);
 734         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 735         COMMAND_SET(cmdp, "more", "show contents of a file", command_more);
 736         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 737         COMMAND_SET(cmdp, "ls", "list files", command_ls);
 738         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 739         COMMAND_SET(cmdp, "include", "read commands from a file",
 740             command_include);
 741         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 742         COMMAND_SET(cmdp, "boot", "boot a file or loaded kernel", command_boot);
 743         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 744         COMMAND_SET(cmdp, "autoboot", "boot automatically after a delay",
 745             command_autoboot);
 746         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 747         COMMAND_SET(cmdp, "load", "load a kernel or module", command_load);
 748         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 749         COMMAND_SET(cmdp, "unload", "unload all modules", command_unload);
 750         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 751         COMMAND_SET(cmdp, "reboot", "reboot the system", command_reboot);
 752         STAILQ_INSERT_TAIL(&commands, cmdp, next);



 753 
 754         fsi = malloc(sizeof (ficlSystemInformation));
 755         ficlSystemInformationInitialize(fsi);
 756         fsi->textOut = out;
 757         fsi->dictionarySize = BF_DICTSIZE;
 758 
 759         bf_sys = ficlSystemCreate(fsi);
 760         free(fsi);
 761         ficlSystemCompileExtras(bf_sys);
 762         bf_vm = ficlSystemCreateVm(bf_sys);
 763 
 764         buf = isadir();
 765         if (buf == NULL || strcmp(buf, "amd64") != 0) {
 766                 (void) setenv("ISADIR", "", 1);
 767         } else {
 768                 (void) setenv("ISADIR", buf, 1);
 769         }
 770         if (buf != NULL)
 771                 free(buf);
 772         buf = get_currdev();


 819 
 820         /*
 821          * Export some version numbers so that code can detect the
 822          * loader/host version
 823          */
 824         env = ficlSystemGetEnvironment(bf_sys);
 825         ficlDictionarySetConstant(env, "loader_version",
 826             (bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0'));
 827 
 828         /* try to load and run init file if present */
 829         if (rc == NULL)
 830                 rc = "/boot/forth/boot.4th";
 831         if (*rc != '\0') {
 832                 fd = open(rc, O_RDONLY);
 833                 if (fd != -1) {
 834                         (void) ficlExecFD(bf_vm, fd);
 835                         close(fd);
 836                 }
 837         }
 838 

 839         return (bf_vm);
 840 }
 841 
 842 void
 843 bf_fini(void)
 844 {
 845         ficlSystemDestroy(bf_sys);

 846 }
 847 
 848 /*
 849  * Feed a line of user input to the Forth interpreter
 850  */
 851 int
 852 bf_run(char *line)
 853 {
 854         int result;
 855         ficlString s;
 856 
 857         FICL_STRING_SET_FROM_CSTRING(s, line);
 858         result = ficlVmExecuteString(bf_vm, s);
 859 
 860         switch (result) {
 861         case FICL_VM_STATUS_OUT_OF_TEXT:
 862         case FICL_VM_STATUS_ABORTQ:
 863         case FICL_VM_STATUS_QUIT:
 864         case FICL_VM_STATUS_ERROR_EXIT:
 865         break;


1954                 return (CMD_ERROR);
1955         }
1956         setenv("kernelname", filename, 1);
1957 
1958         return (CMD_OK);
1959 }
1960 
1961 static int
1962 command_unload(int argc, char *argv[])
1963 {
1964         unsetenv("kernelname");
1965         return (CMD_OK);
1966 }
1967 
1968 static int
1969 command_reboot(int argc, char *argv[])
1970 {
1971         exit(0);
1972         return (CMD_OK);
1973 }
























  22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24  * SUCH DAMAGE.
  25  */
  26 
  27 #include <sys/types.h>
  28 #include <sys/stat.h>
  29 #include <fcntl.h>
  30 #include <errno.h>
  31 #include <stdlib.h>
  32 #include <stdio.h>
  33 #include <string.h>
  34 #include <strings.h>
  35 #include <limits.h>
  36 #include <unistd.h>
  37 #include <dirent.h>
  38 #include <macros.h>
  39 #include <sys/systeminfo.h>
  40 #include <sys/queue.h>
  41 #include <sys/mnttab.h>
  42 #include "gfx_fb.h"
  43 #include "ficl.h"
  44 
  45 /* Commands and return values; nonzero return sets command_errmsg != NULL */
  46 typedef int (bootblk_cmd_t)(int argc, char *argv[]);
  47 #define CMD_OK          0
  48 #define CMD_ERROR       1
  49 
  50 /*
  51  * Support for commands
  52  */
  53 struct bootblk_command
  54 {
  55         const char *c_name;
  56         const char *c_desc;
  57         bootblk_cmd_t *c_fn;
  58         STAILQ_ENTRY(bootblk_command) next;
  59 };
  60 
  61 #define MDIR_REMOVED    0x0001
  62 #define MDIR_NOHINTS    0x0002


  86 extern int pager_file(const char *);
  87 static int page_file(char *);
  88 static int include(const char *);
  89 
  90 static int command_help(int argc, char *argv[]);
  91 static int command_commandlist(int argc, char *argv[]);
  92 static int command_show(int argc, char *argv[]);
  93 static int command_set(int argc, char *argv[]);
  94 static int command_setprop(int argc, char *argv[]);
  95 static int command_unset(int argc, char *argv[]);
  96 static int command_echo(int argc, char *argv[]);
  97 static int command_read(int argc, char *argv[]);
  98 static int command_more(int argc, char *argv[]);
  99 static int command_ls(int argc, char *argv[]);
 100 static int command_include(int argc, char *argv[]);
 101 static int command_autoboot(int argc, char *argv[]);
 102 static int command_boot(int argc, char *argv[]);
 103 static int command_unload(int argc, char *argv[]);
 104 static int command_load(int argc, char *argv[]);
 105 static int command_reboot(int argc, char *argv[]);
 106 static int command_framebuffer(int argc, char *argv[]);
 107 
 108 #define BF_PARSE        100
 109 #define BF_DICTSIZE     30000
 110 
 111 /* update when loader version will change */
 112 static const char bootprog_rev[] = "1.1";
 113 STAILQ_HEAD(cmdh, bootblk_command) commands;
 114 
 115 /*
 116  * BootForth   Interface to Ficl Forth interpreter.
 117  */
 118 
 119 ficlSystem *bf_sys;
 120 ficlVm  *bf_vm;
 121 
 122 /*
 123  * Redistribution and use in source and binary forms, with or without
 124  * modification, are permitted provided that the following conditions
 125  * are met:
 126  * 1. Redistributions of source code must retain the above copyright


 735         COMMAND_SET(cmdp, "read", "read input from the terminal", command_read);
 736         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 737         COMMAND_SET(cmdp, "more", "show contents of a file", command_more);
 738         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 739         COMMAND_SET(cmdp, "ls", "list files", command_ls);
 740         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 741         COMMAND_SET(cmdp, "include", "read commands from a file",
 742             command_include);
 743         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 744         COMMAND_SET(cmdp, "boot", "boot a file or loaded kernel", command_boot);
 745         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 746         COMMAND_SET(cmdp, "autoboot", "boot automatically after a delay",
 747             command_autoboot);
 748         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 749         COMMAND_SET(cmdp, "load", "load a kernel or module", command_load);
 750         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 751         COMMAND_SET(cmdp, "unload", "unload all modules", command_unload);
 752         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 753         COMMAND_SET(cmdp, "reboot", "reboot the system", command_reboot);
 754         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 755         COMMAND_SET(cmdp, "framebuffer", "framebuffer mode management",
 756             command_framebuffer);
 757         STAILQ_INSERT_TAIL(&commands, cmdp, next);
 758 
 759         fsi = malloc(sizeof (ficlSystemInformation));
 760         ficlSystemInformationInitialize(fsi);
 761         fsi->textOut = out;
 762         fsi->dictionarySize = BF_DICTSIZE;
 763 
 764         bf_sys = ficlSystemCreate(fsi);
 765         free(fsi);
 766         ficlSystemCompileExtras(bf_sys);
 767         bf_vm = ficlSystemCreateVm(bf_sys);
 768 
 769         buf = isadir();
 770         if (buf == NULL || strcmp(buf, "amd64") != 0) {
 771                 (void) setenv("ISADIR", "", 1);
 772         } else {
 773                 (void) setenv("ISADIR", buf, 1);
 774         }
 775         if (buf != NULL)
 776                 free(buf);
 777         buf = get_currdev();


 824 
 825         /*
 826          * Export some version numbers so that code can detect the
 827          * loader/host version
 828          */
 829         env = ficlSystemGetEnvironment(bf_sys);
 830         ficlDictionarySetConstant(env, "loader_version",
 831             (bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0'));
 832 
 833         /* try to load and run init file if present */
 834         if (rc == NULL)
 835                 rc = "/boot/forth/boot.4th";
 836         if (*rc != '\0') {
 837                 fd = open(rc, O_RDONLY);
 838                 if (fd != -1) {
 839                         (void) ficlExecFD(bf_vm, fd);
 840                         close(fd);
 841                 }
 842         }
 843 
 844         gfx_framework_init();
 845         return (bf_vm);
 846 }
 847 
 848 void
 849 bf_fini(void)
 850 {
 851         ficlSystemDestroy(bf_sys);
 852         gfx_framework_fini();
 853 }
 854 
 855 /*
 856  * Feed a line of user input to the Forth interpreter
 857  */
 858 int
 859 bf_run(char *line)
 860 {
 861         int result;
 862         ficlString s;
 863 
 864         FICL_STRING_SET_FROM_CSTRING(s, line);
 865         result = ficlVmExecuteString(bf_vm, s);
 866 
 867         switch (result) {
 868         case FICL_VM_STATUS_OUT_OF_TEXT:
 869         case FICL_VM_STATUS_ABORTQ:
 870         case FICL_VM_STATUS_QUIT:
 871         case FICL_VM_STATUS_ERROR_EXIT:
 872         break;


1961                 return (CMD_ERROR);
1962         }
1963         setenv("kernelname", filename, 1);
1964 
1965         return (CMD_OK);
1966 }
1967 
1968 static int
1969 command_unload(int argc, char *argv[])
1970 {
1971         unsetenv("kernelname");
1972         return (CMD_OK);
1973 }
1974 
1975 static int
1976 command_reboot(int argc, char *argv[])
1977 {
1978         exit(0);
1979         return (CMD_OK);
1980 }
1981 
1982 /* Only implement get, ignore other arguments */
1983 static int
1984 command_framebuffer(int argc, char *argv[])
1985 {
1986         if (fb.fd < 0) {
1987                 printf("Framebuffer is not available.\n");
1988                 return (CMD_OK);
1989         }
1990 
1991         if (argc == 2 && strcmp(argv[1], "get") == 0) {
1992                 printf("\nSystem frame buffer: %s\n", fb.ident.name);
1993                 printf("%dx%dx%d, stride=%d\n", fb.fb_width, fb.fb_height,
1994                     fb.fb_depth, (fb.fb_pitch << 3) / fb.fb_depth);
1995                 return (CMD_OK);
1996         }
1997         if (argc == 2 && strcmp(argv[1], "list") == 0) {
1998                 printf("0: %dx%dx%d\n", fb.fb_width, fb.fb_height, fb.fb_depth);
1999                 return (CMD_OK);
2000         }
2001         return (CMD_OK);
2002 }