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/boot/sys/boot/i386/libi386/spinconsole.c
          +++ new/usr/src/boot/sys/boot/i386/libi386/spinconsole.c
   1      -/*-
        1 +/*
   2    2   * spinconsole.c
   3    3   *
   4    4   * Author: Maksym Sobolyev <sobomax@sippysoft.com>
   5    5   * Copyright (c) 2009 Sippy Software, Inc.
   6    6   * All rights reserved.
   7    7   * 
   8    8   * Subject to the following obligations and disclaimer of warranty, use and
   9    9   * redistribution of this software, in source or object code forms, with or
  10   10   * without modifications are expressly permitted by Whistle Communications;
  11   11   * provided, however, that:
↓ open down ↓ 21 lines elided ↑ open up ↑
  33   33   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  34   34   * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
  35   35   * OF SUCH DAMAGE.
  36   36   */
  37   37  
  38   38  #include <sys/cdefs.h>
  39   39  
  40   40  #include <stand.h>
  41   41  #include <bootstrap.h>
  42   42  
  43      -extern void get_pos(int *x, int *y);
  44      -extern void curs_move(int *_x, int *_y, int x, int y);
  45      -#if defined(EFI)
  46      -extern void efi_cons_efiputchar(int c);
  47      -#else
  48      -extern void vidc_biosputchar(int c);
  49      -#endif
  50   43  
  51   44  static void     spinc_probe(struct console *cp);
  52   45  static int      spinc_init(struct console *cp, int arg);
  53   46  static void     spinc_putchar(struct console *cp, int c);
  54   47  static int      spinc_getchar(struct console *cp);
  55   48  static int      spinc_ischar(struct console *cp);
  56   49  
  57   50  struct console spinconsole = {
  58   51          .c_name = "spin",
  59   52          .c_desc = "spin port",
  60   53          .c_flags = 0,
  61   54          .c_probe = spinc_probe,
  62   55          .c_init = spinc_init,
  63   56          .c_out = spinc_putchar,
  64   57          .c_in = spinc_getchar,
  65   58          .c_ready = spinc_ischar,
       59 +        .c_ioctl = NULL,
  66   60          .c_private = NULL
  67   61  };
  68   62  
  69   63  static void
  70   64  spinc_probe(struct console *cp)
  71   65  {
  72      -        cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT);
       66 +        int i;
       67 +        struct console *parent;
       68 +
       69 +        if (cp->c_private == NULL) {
       70 +                for (i = 0; consoles[i] != NULL; i++)
       71 +                        if (strcmp(consoles[i]->c_name, "text") == 0)
       72 +                                break;
       73 +                cp->c_private = consoles[i];
       74 +        }
       75 +
       76 +        parent = cp->c_private;
       77 +        parent->c_probe(cp);
  73   78  }
  74   79  
  75   80  static int
  76      -spinc_init(struct console *cp __attribute((unused)),
  77      -    int arg __attribute((unused)))
       81 +spinc_init(struct console *cp, int arg)
  78   82  {
  79      -        return(0);
       83 +        struct console *parent;
       84 +
       85 +        parent = cp->c_private;
       86 +        return (parent->c_init(cp, arg));
  80   87  }
  81   88  
  82   89  static void
  83      -spinc_putchar(struct console *cp __attribute((unused)),
  84      -    int c __attribute((unused)))
       90 +spinc_putchar(struct console *cp, int c __unused)
  85   91  {
  86      -#ifdef TERM_EMU
  87      -        static int curx, cury;
  88      -#endif
  89   92          static unsigned tw_chars = 0x5C2D2F7C;    /* "\-/|" */
  90      -        static time_t lasttime;
       93 +        static time_t lasttime = 0;
       94 +        struct console *parent;
  91   95          time_t now;
  92   96  
  93   97          now = time(NULL);
  94   98          if (now < (lasttime + 1))
  95   99                  return;
  96  100          lasttime = now;
  97      -#ifdef TERM_EMU
  98      -        get_pos(&curx, &cury);
  99      -        if (curx > 0)
 100      -                curs_move(&curx, &cury, curx - 1, cury);
 101      -#endif
 102      -#if defined(EFI)
 103      -        efi_cons_efiputchar((char)tw_chars);
 104      -#else
 105      -        vidc_biosputchar((char)tw_chars);
 106      -#endif
      101 +        parent = cp->c_private;
      102 +
      103 +        parent->c_out(parent, (char)tw_chars);
      104 +        parent->c_out(parent, '\b');
 107  105          tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24);
 108  106  }
 109  107  
 110  108  static int
 111      -spinc_getchar(struct console *cp __attribute((unused)))
      109 +spinc_getchar(struct console *cp __unused)
 112  110  {
 113      -        return(-1);
      111 +
      112 +        return (-1);
 114  113  }
 115  114  
 116  115  static int
 117      -spinc_ischar(struct console *cp __attribute((unused)))
      116 +spinc_ischar(struct console *cp __unused)
 118  117  {
 119      -        return(0);
      118 +
      119 +        return (0);
 120  120  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX