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>

Split Close
Expand all
Collapse all
          --- old/usr/src/common/ficl/emu/loader_emu.c
          +++ new/usr/src/common/ficl/emu/loader_emu.c
↓ open down ↓ 31 lines elided ↑ open up ↑
  32   32  #include <stdio.h>
  33   33  #include <string.h>
  34   34  #include <strings.h>
  35   35  #include <limits.h>
  36   36  #include <unistd.h>
  37   37  #include <dirent.h>
  38   38  #include <macros.h>
  39   39  #include <sys/systeminfo.h>
  40   40  #include <sys/queue.h>
  41   41  #include <sys/mnttab.h>
       42 +#include "gfx_fb.h"
  42   43  #include "ficl.h"
  43   44  
  44   45  /* Commands and return values; nonzero return sets command_errmsg != NULL */
  45   46  typedef int (bootblk_cmd_t)(int argc, char *argv[]);
  46   47  #define CMD_OK          0
  47   48  #define CMD_ERROR       1
  48   49  
  49   50  /*
  50   51   * Support for commands
  51   52   */
↓ open down ↓ 43 lines elided ↑ open up ↑
  95   96  static int command_echo(int argc, char *argv[]);
  96   97  static int command_read(int argc, char *argv[]);
  97   98  static int command_more(int argc, char *argv[]);
  98   99  static int command_ls(int argc, char *argv[]);
  99  100  static int command_include(int argc, char *argv[]);
 100  101  static int command_autoboot(int argc, char *argv[]);
 101  102  static int command_boot(int argc, char *argv[]);
 102  103  static int command_unload(int argc, char *argv[]);
 103  104  static int command_load(int argc, char *argv[]);
 104  105  static int command_reboot(int argc, char *argv[]);
      106 +static int command_framebuffer(int argc, char *argv[]);
 105  107  
 106  108  #define BF_PARSE        100
 107  109  #define BF_DICTSIZE     30000
 108  110  
 109  111  /* update when loader version will change */
 110  112  static const char bootprog_rev[] = "1.1";
 111  113  STAILQ_HEAD(cmdh, bootblk_command) commands;
 112  114  
 113  115  /*
 114  116   * BootForth   Interface to Ficl Forth interpreter.
↓ open down ↓ 628 lines elided ↑ open up ↑
 743  745          STAILQ_INSERT_TAIL(&commands, cmdp, next);
 744  746          COMMAND_SET(cmdp, "autoboot", "boot automatically after a delay",
 745  747              command_autoboot);
 746  748          STAILQ_INSERT_TAIL(&commands, cmdp, next);
 747  749          COMMAND_SET(cmdp, "load", "load a kernel or module", command_load);
 748  750          STAILQ_INSERT_TAIL(&commands, cmdp, next);
 749  751          COMMAND_SET(cmdp, "unload", "unload all modules", command_unload);
 750  752          STAILQ_INSERT_TAIL(&commands, cmdp, next);
 751  753          COMMAND_SET(cmdp, "reboot", "reboot the system", command_reboot);
 752  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);
 753  758  
 754  759          fsi = malloc(sizeof (ficlSystemInformation));
 755  760          ficlSystemInformationInitialize(fsi);
 756  761          fsi->textOut = out;
 757  762          fsi->dictionarySize = BF_DICTSIZE;
 758  763  
 759  764          bf_sys = ficlSystemCreate(fsi);
 760  765          free(fsi);
 761  766          ficlSystemCompileExtras(bf_sys);
 762  767          bf_vm = ficlSystemCreateVm(bf_sys);
↓ open down ↓ 66 lines elided ↑ open up ↑
 829  834          if (rc == NULL)
 830  835                  rc = "/boot/forth/boot.4th";
 831  836          if (*rc != '\0') {
 832  837                  fd = open(rc, O_RDONLY);
 833  838                  if (fd != -1) {
 834  839                          (void) ficlExecFD(bf_vm, fd);
 835  840                          close(fd);
 836  841                  }
 837  842          }
 838  843  
      844 +        gfx_framework_init();
 839  845          return (bf_vm);
 840  846  }
 841  847  
 842  848  void
 843  849  bf_fini(void)
 844  850  {
 845  851          ficlSystemDestroy(bf_sys);
      852 +        gfx_framework_fini();
 846  853  }
 847  854  
 848  855  /*
 849  856   * Feed a line of user input to the Forth interpreter
 850  857   */
 851  858  int
 852  859  bf_run(char *line)
 853  860  {
 854  861          int result;
 855  862          ficlString s;
↓ open down ↓ 1108 lines elided ↑ open up ↑
1964 1971          unsetenv("kernelname");
1965 1972          return (CMD_OK);
1966 1973  }
1967 1974  
1968 1975  static int
1969 1976  command_reboot(int argc, char *argv[])
1970 1977  {
1971 1978          exit(0);
1972 1979          return (CMD_OK);
1973 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 +}
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX