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/uts/common/io/kbtrans/kbtrans_streams.c
          +++ new/usr/src/uts/common/io/kbtrans/kbtrans_streams.c
↓ open down ↓ 1257 lines elided ↑ open up ↑
1258 1258          }
1259 1259          return (bp);
1260 1260  }
1261 1261  
1262 1262  /*
1263 1263   * kbtrans_keypressed:
1264 1264   *      Modify Firm event to be sent up the stream
1265 1265   */
1266 1266  static void
1267 1267  kbtrans_keypressed(struct kbtrans *upper, uchar_t key_station,
1268      -                    Firm_event *fe, ushort_t base)
     1268 +    Firm_event *fe, ushort_t base)
1269 1269  {
1270 1270  
1271 1271          register short  id_addr;
1272 1272          struct kbtrans_lower    *lower = &upper->kbtrans_lower;
1273 1273  
1274 1274          /* Set pair values */
1275 1275          if (fe->id < (ushort_t)VKEY_FIRST) {
1276 1276                  /*
1277 1277                   * If CTRLed, find the ID that would have been used had it
1278 1278                   * not been CTRLed.
1279 1279                   */
1280 1280                  if (lower->kbtrans_shiftmask & (CTRLMASK | CTLSMASK)) {
1281      -                        unsigned short *ke;
     1281 +                        keymap_entry_t *ke;
1282 1282                          unsigned int mask;
1283 1283  
1284 1284                          mask = lower->kbtrans_shiftmask &
1285 1285                              ~(CTRLMASK | CTLSMASK | UPMASK);
1286 1286  
1287 1287                          ke = kbtrans_find_entry(lower, mask, key_station);
1288 1288                          if (ke == NULL)
1289 1289                                  return;
1290 1290  
1291 1291                          base = *ke;
↓ open down ↓ 28 lines elided ↑ open up ↑
1320 1320  
1321 1321          kbtrans_queuepress(upper, key_station, fe);
1322 1322  }
1323 1323  
1324 1324  /*
1325 1325   * kbtrans_queuepress:
1326 1326   *      Add keypress to the "downs" table
1327 1327   */
1328 1328  static void
1329 1329  kbtrans_queuepress(struct kbtrans *upper,
1330      -                    uchar_t key_station, Firm_event *fe)
     1330 +    uchar_t key_station, Firm_event *fe)
1331 1331  {
1332 1332          register struct key_event *ke, *ke_free;
1333 1333          register int i;
1334 1334  
1335 1335          DPRINTF(PRINT_L0, PRINT_MASK_ALL, (NULL, "kbtrans_queuepress:"
1336 1336              " key=%d", key_station));
1337 1337  
1338 1338          ke_free = 0;
1339 1339  
1340 1340          /* Scan table of down key stations */
↓ open down ↓ 91 lines elided ↑ open up ↑
1432 1432          if ((bp = allocb(sizeof (uint_t), BPRI_HI)) == NULL) {
1433 1433  
1434 1434                  cmn_err(CE_WARN, "kbtrans_putcode: Can't allocate block\
1435 1435                          for keycode.");
1436 1436  
1437 1437                  return;
1438 1438          }
1439 1439  
1440 1440          /*
1441 1441           * We will strip out any high order information here.
     1442 +         * Convert to UTF-8.
1442 1443           */
1443      -        /* NOTE the implicit cast here */
1444      -        *bp->b_wptr++ = (uchar_t)code;
     1444 +        code = KEYCHAR(code);
     1445 +        if (code < 0x80) {
     1446 +                *bp->b_wptr++ = (char)code;
     1447 +        } else if (code < 0x800) {
     1448 +                *bp->b_wptr++ = 0xc0 | (code >> 6);
     1449 +                *bp->b_wptr++ = 0x80 | (code & 0x3f);
     1450 +        } else if (code < 0x10000) {
     1451 +                *bp->b_wptr++ = 0xe0 | (code >> 12);
     1452 +                *bp->b_wptr++ = 0x80 | ((code >> 6) & 0x3f);
     1453 +                *bp->b_wptr++ = 0x80 | (code & 0x3f);
     1454 +        } else {
     1455 +                *bp->b_wptr++ = 0xf0 | (code >> 18);
     1456 +                *bp->b_wptr++ = 0x80 | ((code >> 12) & 0x3f);
     1457 +                *bp->b_wptr++ = 0x80 | ((code >> 6) & 0x3f);
     1458 +                *bp->b_wptr++ = 0x80 | (code & 0x3f);
     1459 +        }
1445 1460  
1446 1461          /*
1447 1462           * Send the message up.
1448 1463           */
1449 1464          (void) putnext(upper->kbtrans_streams_readq, bp);
1450 1465  }
1451 1466  
1452 1467  
1453 1468  /*
1454 1469   * kbtrans_putbuf:
↓ open down ↓ 326 lines elided ↑ open up ↑
1781 1796                      lower->kbtrans_numlock_table[entry&0x1F]);
1782 1797  
1783 1798                  return;
1784 1799  
1785 1800          case 0: /* normal character */
1786 1801          default:
1787 1802                  break;
1788 1803          }
1789 1804  
1790 1805          /*
1791      -         * Send the byte upstream.
     1806 +         * Send the char upstream.
1792 1807           */
1793 1808          kbtrans_putcode(upper, entry);
1794 1809  
1795 1810  }
1796 1811  
1797 1812  #define KB_SCANCODE_ALT         0xe2
1798 1813  #define KB_SCANCODE_ALTGRAPH    0xe6
1799 1814  
1800 1815  /*
1801 1816   * kbtrans_ascii_keyreleased:
↓ open down ↓ 280 lines elided ↑ open up ↑
2082 2097  #define OLD_STRING      0xB0
2083 2098  #define OLD_LEFTFUNC    0xC0
2084 2099  #define OLD_RIGHTFUNC   0xD0
2085 2100  #define OLD_TOPFUNC     0xE0
2086 2101  #define OLD_BOTTOMFUNC  0xF0
2087 2102  
2088 2103  /*
2089 2104   * Map old special codes to new ones.
2090 2105   * Indexed by ((old special code) >> 4) & 0x07; add (old special code) & 0x0F.
2091 2106   */
2092      -static ushort_t  special_old_to_new[] = {
     2107 +static keymap_entry_t  special_old_to_new[] = {
2093 2108          SHIFTKEYS,
2094 2109          BUCKYBITS,
2095 2110          FUNNY,
2096 2111          STRING,
2097 2112          LEFTFUNC,
2098 2113          RIGHTFUNC,
2099 2114          TOPFUNC,
2100 2115          BOTTOMFUNC,
2101 2116  };
2102 2117  
2103 2118  
2104 2119  /*
2105 2120   * kbtrans_setkey:
2106 2121   *       Set individual keystation translation from old-style entry.
2107 2122   */
2108 2123  static int
2109 2124  kbtrans_setkey(struct kbtrans_lower *lower, struct kiockey *key, cred_t *cr)
2110 2125  {
2111 2126          int     strtabindex, i;
2112      -        unsigned short  *ke;
     2127 +        keymap_entry_t  *ke;
2113 2128          register int tablemask;
2114      -        register ushort_t entry;
     2129 +        register keymap_entry_t entry;
2115 2130          register struct keyboard *kp;
2116 2131  
2117 2132          kp = lower->kbtrans_keyboard;
2118 2133  
2119 2134          if (key->kio_station >= kp->k_keymap_size)
2120      -
2121 2135                  return (EINVAL);
2122 2136  
2123 2137          if (lower->kbtrans_keyboard == NULL)
2124 2138  
2125 2139                  return (EINVAL);
2126 2140  
2127 2141          tablemask = key->kio_tablemask;
2128 2142  
2129 2143          switch (tablemask) {
2130 2144          case KIOCABORT1:
↓ open down ↓ 70 lines elided ↑ open up ↑
2201 2215  
2202 2216  
2203 2217  /*
2204 2218   * kbtrans_getkey:
2205 2219   *      Get individual keystation translation as old-style entry.
2206 2220   */
2207 2221  static int
2208 2222  kbtrans_getkey(struct kbtrans_lower *lower, struct kiockey *key)
2209 2223  {
2210 2224          int     strtabindex;
2211      -        unsigned short  *ke;
2212      -        register ushort_t entry;
     2225 +        keymap_entry_t  *ke;
     2226 +        register keymap_entry_t entry;
2213 2227          struct keyboard *kp;
2214 2228  
2215 2229          kp = lower->kbtrans_keyboard;
2216 2230  
2217 2231          if (key->kio_station >= kp->k_keymap_size)
2218 2232                  return (EINVAL);
2219 2233  
2220 2234          if (lower->kbtrans_keyboard == NULL)
2221 2235                  return (EINVAL);
2222 2236  
↓ open down ↓ 37 lines elided ↑ open up ↑
2260 2274  
2261 2275  
2262 2276  /*
2263 2277   * kbtrans_skey:
2264 2278   *      Set individual keystation translation from new-style entry.
2265 2279   */
2266 2280  static int
2267 2281  kbtrans_skey(struct kbtrans_lower *lower, struct kiockeymap *key, cred_t *cr)
2268 2282  {
2269 2283          int     strtabindex, i;
2270      -        unsigned short *ke;
     2284 +        keymap_entry_t *ke;
2271 2285          struct keyboard *kp;
2272 2286  
2273 2287          kp = lower->kbtrans_keyboard;
2274 2288  
2275 2289          if (key->kio_station >= kp->k_keymap_size) {
2276 2290                  return (EINVAL);
2277 2291  
2278 2292          }
2279 2293  
2280 2294          if (lower->kbtrans_keyboard == NULL) {
↓ open down ↓ 20 lines elided ↑ open up ↑
2301 2315                  }
2302 2316                  return (0);
2303 2317          }
2304 2318  
2305 2319          ke = kbtrans_find_entry(lower, (uint_t)key->kio_tablemask,
2306 2320              key->kio_station);
2307 2321          if (ke == NULL)
2308 2322                  return (EINVAL);
2309 2323  
2310 2324          if (key->kio_entry >= STRING &&
2311      -            key->kio_entry <= (ushort_t)(STRING + 15)) {
     2325 +            key->kio_entry <= (STRING + 15)) {
2312 2326                  strtabindex = key->kio_entry-STRING;
2313 2327                  bcopy(key->kio_string,
2314 2328                      lower->kbtrans_keystringtab[strtabindex], KTAB_STRLEN);
2315 2329                  lower->kbtrans_keystringtab[strtabindex][KTAB_STRLEN-1] = '\0';
2316 2330          }
2317 2331  
2318 2332          *ke = key->kio_entry;
2319 2333  
2320 2334          return (0);
2321 2335  }
2322 2336  
2323 2337  
2324 2338  /*
2325 2339   * kbtrans_gkey:
2326 2340   *      Get individual keystation translation as new-style entry.
2327 2341   */
2328 2342  static int
2329      -kbtrans_gkey(struct kbtrans_lower *lower, struct        kiockeymap *key)
     2343 +kbtrans_gkey(struct kbtrans_lower *lower, struct kiockeymap *key)
2330 2344  {
2331 2345          int     strtabindex;
2332      -        unsigned short *ke;
     2346 +        keymap_entry_t *ke;
2333 2347          struct keyboard *kp;
2334 2348  
2335 2349          kp = lower->kbtrans_keyboard;
2336 2350  
2337 2351          if (key->kio_station >= kp->k_keymap_size)
2338 2352                  return (EINVAL);
2339 2353  
2340 2354          if (lower->kbtrans_keyboard == NULL)
2341 2355                  return (EINVAL);
2342 2356  
↓ open down ↓ 10 lines elided ↑ open up ↑
2353 2367          }
2354 2368  
2355 2369          ke = kbtrans_find_entry(lower, (uint_t)key->kio_tablemask,
2356 2370              key->kio_station);
2357 2371          if (ke == NULL)
2358 2372                  return (EINVAL);
2359 2373  
2360 2374          key->kio_entry = *ke;
2361 2375  
2362 2376          if (key->kio_entry >= STRING &&
2363      -            key->kio_entry <= (ushort_t)(STRING + 15)) {
     2377 +            key->kio_entry <= (STRING + 15)) {
2364 2378                  strtabindex = key->kio_entry-STRING;
2365 2379                  bcopy(lower->kbtrans_keystringtab[strtabindex],
2366 2380                      key->kio_string, KTAB_STRLEN);
2367 2381          }
2368 2382          return (0);
2369 2383  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX