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/lib/libstand/ufs.c
          +++ new/usr/src/boot/lib/libstand/ufs.c
   1    1  /*      $NetBSD: ufs.c,v 1.20 1998/03/01 07:15:39 ross Exp $    */
   2    2  
   3      -/*-
        3 +/*
   4    4   * Copyright (c) 2002 Networks Associates Technology, Inc.
   5    5   * All rights reserved.
   6    6   *
   7    7   * This software was developed for the FreeBSD Project by Marshall
   8    8   * Kirk McKusick and Network Associates Laboratories, the Security
   9    9   * Research Division of Network Associates, Inc. under DARPA/SPAWAR
  10   10   * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
  11   11   * research program
  12   12   *
  13   13   * Copyright (c) 1982, 1989, 1993
↓ open down ↓ 62 lines elided ↑ open up ↑
  76   76  #include <sys/param.h>
  77   77  #include <sys/disklabel.h>
  78   78  #include <sys/time.h>
  79   79  #include <ufs/ufs/dinode.h>
  80   80  #include <ufs/ufs/dir.h>
  81   81  #include <ufs/ffs/fs.h>
  82   82  #include "stand.h"
  83   83  #include "string.h"
  84   84  
  85   85  static int      ufs_open(const char *path, struct open_file *f);
  86      -static int      ufs_write(struct open_file *f, void *buf, size_t size, size_t *resid);
       86 +static int      ufs_write(struct open_file *f, const void *buf, size_t size,
       87 +        size_t *resid);
  87   88  static int      ufs_close(struct open_file *f);
  88   89  static int      ufs_read(struct open_file *f, void *buf, size_t size, size_t *resid);
  89   90  static off_t    ufs_seek(struct open_file *f, off_t offset, int where);
  90   91  static int      ufs_stat(struct open_file *f, struct stat *sb);
  91   92  static int      ufs_readdir(struct open_file *f, struct dirent *d);
  92   93  
  93   94  struct fs_ops ufs_fsops = {
  94   95          "ufs",
  95   96          ufs_open,
  96   97          ufs_close,
↓ open down ↓ 26 lines elided ↑ open up ↑
 123  124          char            *f_buf;         /* buffer for data block */
 124  125          size_t          f_buf_size;     /* size of data block */
 125  126  };
 126  127  #define DIP(fp, field) \
 127  128          ((fp)->f_fs->fs_magic == FS_UFS1_MAGIC ? \
 128  129          (fp)->f_di.di1.field : (fp)->f_di.di2.field)
 129  130  
 130  131  static int      read_inode(ino_t, struct open_file *);
 131  132  static int      block_map(struct open_file *, ufs2_daddr_t, ufs2_daddr_t *);
 132  133  static int      buf_read_file(struct open_file *, char **, size_t *);
 133      -static int      buf_write_file(struct open_file *, char *, size_t *);
      134 +static int      buf_write_file(struct open_file *, const char *, size_t *);
 134  135  static int      search_directory(char *, struct open_file *, ino_t *);
 135  136  
 136  137  /*
 137  138   * Read a new inode into a file structure.
 138  139   */
 139  140  static int
 140  141  read_inode(inumber, f)
 141  142          ino_t inumber;
 142  143          struct open_file *f;
 143  144  {
↓ open down ↓ 149 lines elided ↑ open up ↑
 293  294  
 294  295          return (0);
 295  296  }
 296  297  
 297  298  /*
 298  299   * Write a portion of a file from an internal buffer.
 299  300   */
 300  301  static int
 301  302  buf_write_file(f, buf_p, size_p)
 302  303          struct open_file *f;
 303      -        char *buf_p;
      304 +        const char *buf_p;
 304  305          size_t *size_p;         /* out */
 305  306  {
 306  307          struct file *fp = (struct file *)f->f_fsdata;
 307  308          struct fs *fs = fp->f_fs;
 308  309          long off;
 309  310          ufs_lbn_t file_block;
 310  311          ufs2_daddr_t disk_block;
 311  312          size_t block_size;
 312  313          int rc;
 313  314  
↓ open down ↓ 437 lines elided ↑ open up ↑
 751  752  }
 752  753  
 753  754  /*
 754  755   * Write to a portion of an already allocated file.
 755  756   * Cross block boundaries when necessary. Can not
 756  757   * extend the file.
 757  758   */
 758  759  static int
 759  760  ufs_write(f, start, size, resid)
 760  761          struct open_file *f;
 761      -        void *start;
      762 +        const void *start;
 762  763          size_t size;
 763  764          size_t *resid;  /* out */
 764  765  {
 765  766          struct file *fp = (struct file *)f->f_fsdata;
 766  767          size_t csize;
 767  768          int rc = 0;
 768      -        char *addr = start;
      769 +        const char *addr = start;
 769  770  
 770  771          csize = size;
 771  772          while ((size != 0) && (csize != 0)) {
 772  773                  if (fp->f_seekp >= DIP(fp, di_size))
 773  774                          break;
 774  775  
 775  776                  if (csize >= 512) csize = 512; /* XXX */
 776  777  
 777  778                  rc = buf_write_file(f, addr, &csize);
 778  779                  if (rc)
↓ open down ↓ 78 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX