<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libstand, branch release/10.3.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F10.3.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F10.3.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2016-01-20T22:05:49Z</updated>
<entry>
<title>Add strlcat and strlcpy to libstand on ia64.  This is conceptually part</title>
<updated>2016-01-20T22:05:49Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2016-01-20T22:05:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2b1117136af79d59c3c2b5bcf16ebab4b379b8ec'/>
<id>urn:sha1:2b1117136af79d59c3c2b5bcf16ebab4b379b8ec</id>
<content type='text'>
of the MFC done in r294342, but since ia64 is gone in -current this is a
direct commit to 10-stable to add the functions.
</content>
</entry>
<entry>
<title>MFC r292583:</title>
<updated>2016-01-19T21:35:09Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2016-01-19T21:35:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b7a92fb8dc851220fe4995b4768f29d4379ceb1c'/>
<id>urn:sha1:b7a92fb8dc851220fe4995b4768f29d4379ceb1c</id>
<content type='text'>
  Allow dhcp/bootp server-provided values to be overriden from environment
  variables in loader(8) and other libstand applications.

  Sometimes a dhcp server provides incorrect information along with the IP
  address. It would be useful to have a way to override this with
  locally-supplied information, such as command line parameters passed from a
  prior-stage bootloader. This change allows pre-existing env vars to take
  precedence over values delivered by the dhcp or bootp server.

  The bootp/dhcp code in libstand automatically creates environment variables
  from the data provided by the server (dhcp.root-path, dhcp.domain-name,
  etc). It also transcribes the values to some global variables such as
  'rootpath' and 'hostname'.

  This change does two things:

      When adding dhcp.* vars to the environment, don't replace existing
      vars/values.

      When setting the global vars rootpath and hostname, use the
      dhcp.root-path and dhcp.host-name env var values if they exist.

  This allows the platform-specific part of loader(8) to obtain override
  values in some platform-specific way and store them in the environment
  before opening the network device. The set of values that can be overriden
  is currently limited to just string options. The values that are delivered
  as binary data are things that probably shouldn't be overridden (IP,
  netmask, gateway, etc).

  The original patch this evolved from was submitted by martymac@

PR:           202098
Relnotes:	Yes
</content>
</entry>
<entry>
<title>MFC r292234, r292527:</title>
<updated>2016-01-19T21:27:25Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2016-01-19T21:27:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c058436e1d0712ea3853783129b6d2589cbca8b3'/>
<id>urn:sha1:c058436e1d0712ea3853783129b6d2589cbca8b3</id>
<content type='text'>
  Add strlcat() and strlcpy() to libstand and libstand32.
</content>
</entry>
<entry>
<title>MFC 279949:</title>
<updated>2015-04-09T19:36:06Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2015-04-09T19:36:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b8712325a911613c974a55087fe5f34cf31ddb15'/>
<id>urn:sha1:b8712325a911613c974a55087fe5f34cf31ddb15</id>
<content type='text'>
The System V ABI for amd64 allows functions to use space in a 128 byte
redzone below the stack pointer for scratch space and requires
interrupt and signal frames to avoid overwriting it. However, EFI uses
the Windows ABI which does not support this. As a result, interrupt
handlers in EFI push their interrupt frames directly on top of the
stack pointer. If the compiler used the red zone in a function in the
EFI loader, then a device interrupt that occurred while that function
was running could trash its local variables.  In practice this happens
fairly reliable when using gzipfs as an interrupt during decompression
can trash the local variables in the inflate_table() function
resulting in corrupted output or hangs.

Fix this by disabling the redzone for amd64 EFI binaries. This
requires building not only the loader but any libraries used by the
loader without redzone support.

Thanks to Jilles for pointing me at the redzone once I found the stack
corruption.
</content>
</entry>
<entry>
<title>MFC 279931:</title>
<updated>2015-04-09T18:45:03Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2015-04-09T18:45:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=677f21fdc0cb95d8a42c0468b761811865357425'/>
<id>urn:sha1:677f21fdc0cb95d8a42c0468b761811865357425</id>
<content type='text'>
Spin the twiddle in dosfs to give visual feedback for disk I/O on
FAT filesystems as is done for other filesystems in the loader.
</content>
</entry>
<entry>
<title>MFC r276079, r276087:</title>
<updated>2015-02-11T22:55:24Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2015-02-11T22:55:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c4537dbd5f655c86ceeb6261056c9de85a5810cf'/>
<id>urn:sha1:c4537dbd5f655c86ceeb6261056c9de85a5810cf</id>
<content type='text'>
  Add a divisor parameter to twiddle() so that callers can request that
  output only happen on every Nth call.

  Add a new loader(8) variable, twiddle_divisor, allowing control over the
  output frequency of the "twiddle" IO progress indicator.
</content>
</entry>
<entry>
<title>MFC r276412:</title>
<updated>2015-01-14T21:23:46Z</updated>
<author>
<name>Nathan Whitehorn</name>
<email>nwhitehorn@FreeBSD.org</email>
</author>
<published>2015-01-14T21:23:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f1bf00b7531d009c95090617122b32da3e9de9ea'/>
<id>urn:sha1:f1bf00b7531d009c95090617122b32da3e9de9ea</id>
<content type='text'>
Fix loader's ability to read the 10.1 release PowerPC ISOs. There appears to
be some kind of problem with the version of makefs used for these disks.
There may be a better way to handle this problem, so I've set the MFC
timer for a fairly long time period.
</content>
</entry>
<entry>
<title>MFC r266878, r266879: Add support for snprintf() to libstand.</title>
<updated>2014-10-26T02:51:56Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2014-10-26T02:51:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=78fa090a911189b8013afc0a42c7e57e12aa903c'/>
<id>urn:sha1:78fa090a911189b8013afc0a42c7e57e12aa903c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MFC UEFI loader</title>
<updated>2014-09-04T21:01:10Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2014-09-04T21:01:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9afd37c57cc4c3ec2952d73def9b2042a81f9119'/>
<id>urn:sha1:9afd37c57cc4c3ec2952d73def9b2042a81f9119</id>
<content type='text'>
This MFC consists of the following SVN revisions:
  258741 261568 261603 261668 263115 263117 263968 264078 264087 264088
  264092 264095 264115 264132 264208 264261 264262 264263 264319 265028
  265057 268974

Detailed commit messages:

r258741: Note that libstand is 32-bit on amd64 and powerpc64

r261568: Build libstand as a 64-bit library on amd64

  The 32-bit bootloaders now link against libstand.a in
  sys/boot/libstand32, so there is no need to force /usr/lib/libstand.a
  to be 32-bit.

r261603: Don't force efi to a 32-bit build on amd64

r261668: Build libstand as a 64-bit library on ppc64

  The 32-bit bootloaders now link against libstand.a in
  sys/boot/libstand32, so there is no need to force /usr/lib/libstand.a
  to be 32-bit.

  This is equivalent to r261568 for amd64.

r263115: Add amd64 EFI headers

r263117: Connect 64-bit boot ficl to the build

  It is not yet used, but this will ensure it doesn't get broken.

r263968: Use EFI types for EFI values (silences warnings).

  EFI UINTN is actually a 64-bit type on 64-bit processors.

r264078: Put each source file on a separate line

  This will simplify rebasing the amd64 UEFI patch set.

r264087: Build boot/ficl as 64-bit library on amd64

  The 32-bit bootloaders on amd64 now use the 32-bit version in ficl32,
  as is done with libstand32.  The native 64-bit ficl will be used by the
  upcoming UEFI loader.

r264088: Merge efilib changes from projects/uefi

  r247216: Add the ability for a device to have an "alias" handle.

  r247379: Fix network device registration.

  r247380: Adjust our load device when we boot from CD under UEFI.

    The process for booting from a CD under UEFI involves adding a FAT
    filesystem containing your loader code as an El Torito boot image.
    When UEFI detects this, it provides a block IO instance that points
    at the FAT filesystem as a child of the device that represents the CD
    itself. The problem being that the CD device is flagged as a "raw
    device" while the boot image is flagged as a "logical partition".
    The existing EFI partition code only looks for logical partitions and
    so the CD filesystem was rendered invisible.

    To fix this, check the type of each block IO device. If it's found to
    be a CD, and thus an El Torito boot image, look up its parent device
    and add that instead so that the loader will then load the kernel from
    the CD filesystem.  This is done by using the handle for the boot
    filesystem as an alias.

    Something similar to this will be required for booting from other media
    as well as the loader will live in the EFI system partition, not on the
    partition containing the kernel.

  r247381: Remove a scatalogical debug printf that crept in.

r264092: Add -fPIC for amd64

r264095: Support UEFI booting on amd64 via loader.efi

  This is largely the work from the projects/uefi branch, with some
  additional refinements.  This is derived from (and replaces) the
  original i386 efi implementation; i386 support will be restored later.

  Specific revisions of note from projects/uefi:

  r247380:

    Adjust our load device when we boot from CD under UEFI.

    The process for booting from a CD under UEFI involves adding a FAT
    filesystem containing your loader code as an El Torito boot image.
    When UEFI detects this, it provides a block IO instance that points at
    the FAT filesystem as a child of the device that represents the CD
    itself. The problem being that the CD device is flagged as a "raw
    device" while the boot image is flagged as a "logical partition". The
    existing EFI partition code only looks for logical partitions and so
    the CD filesystem was rendered invisible.

    To fix this, check the type of each block IO device. If it's found to
    be a CD, and thus an El Torito boot image, look up its parent device
    and add that instead so that the loader will then load the kernel from
    the CD filesystem.  This is done by using the handle for the boot
    filesystem as an alias.

    Something similar to this will be required for booting from other
    media as well as the loader will live in the EFI system partition, not
    on the partition containing the kernel.

  r246231:

    Add necessary code to hand off from loader to an amd64 kernel.

  r246335:

    Grab the EFI memory map and store it as module metadata on the kernel.

    This is the same approach used to provide the BIOS SMAP to the kernel.

  r246336:

    Pass the ACPI table metadata via hints so the kernel ACPI code can
    find them.

  r246608:

    Rework copy routines to ensure we always use memory allocated via EFI.

    The previous code assumed it could copy wherever it liked. This is not
    the case. The approach taken by this code is pretty ham-fisted in that
    it simply allocates a large (32MB) buffer area and stages into that,
    then copies the whole area into place when it's time to execute. A more
    elegant solution could be used but this works for now.

  r247214:

    Fix a number of problems preventing proper handover to the kernel.

    There were two issues at play here. Firstly, there was nothing
    preventing UEFI from placing the loader code above 1GB in RAM. This
    meant that when we switched in the page tables the kernel expects to
    be running on, we are suddenly unmapped and things no longer work. We
    solve this by making our trampoline code not dependent on being at any
    given position and simply copying it to a "safe" location before
    calling it.

    Secondly, UEFI could allocate our stack wherever it wants. As it
    happened on my PC, that was right where I was copying the kernel to.
    This did not cause happiness. The solution to this was to also switch
    to a temporary stack in a safe location before performing the final
    copy of the loaded kernel.

  r246231:

    Add necessary code to hand off from loader to an amd64 kernel.

  r246335:

    Grab the EFI memory map and store it as module metadata on the kernel.

    This is the same approach used to provide the BIOS SMAP to the kernel.

  r246336:

    Pass the ACPI table metadata via hints so the kernel ACPI code can
    find them.

  r246608:

    Rework copy routines to ensure we always use memory allocated via EFI.

    The previous code assumed it could copy wherever it liked. This is not
    the case. The approach taken by this code is pretty ham-fisted in that
    it simply allocates a large (32MB) buffer area and stages into that,
    then copies the whole area into place when it's time to execute. A more
    elegant solution could be used but this works for now.

  r247214:

    Fix a number of problems preventing proper handover to the kernel.

    There were two issues at play here. Firstly, there was nothing
    preventing UEFI from placing the loader code above 1GB in RAM. This
    meant that when we switched in the page tables the kernel expects to
    be running on, we are suddenly unmapped and things no longer work. We
    solve this by making our trampoline code not dependent on being at any
    given position and simply copying it to a "safe" location before
    calling it.

    Secondly, UEFI could allocate our stack wherever it wants. As it
    happened on my PC, that was right where I was copying the kernel to.
    This did not cause happiness. The solution to this was to also switch
    to a temporary stack in a safe location before performing the final
    copy of the loaded kernel.

  r247216:

    Use the UEFI Graphics Output Protocol to get the parameters of the
    framebuffer.

r264115: Fix printf format mismatches

r264132: Connect sys/boot/amd64 to the build

r264208: Do not build the amd64 UEFI loader with GCC

  The UEFI loader causes buildworld to fail when building with (in-tree)
  GCC, due to a typedef redefinition.  As it happens the in-tree GCC
  cannot successfully build the UEFI loader anyhow, as it does not support
  __attribute__((ms_abi)).  Thus, just avoid trying to build it with GCC,
  rather than disconnecting it from the build until the underlying issue
  is fixed.

r264261: Correct a variable's type for 64-bit Ficl

  FICL_INT is long.

r264262: Fix printf args for 64-bit archs

r264263: Add explicit casts to quiet warnings in libefi

r264319: Fix EFI loader object tree creation on 9.x build hosts

  Previously ${COMPILER_TYPE} was checked in sys/boot/amd64, and the efi
  subdirectory was skipped altogether for gcc (since GCC does not support
  a required attribute).  However, during the early buildworld stages
  ${COMPILER_TYPE} is the existing system compiler (i.e., gcc on 9.x build
  hosts), not the compiler that will eventually be used.  This caused
  "make obj" to skip the efi subdirectory.  In later build stages
  ${COMPILER_TYPE} is "clang", and then the efi loader would attempt to
  build in the source directory.

r265028 (dteske): Disable the beastie menu for EFI console ...

  which doesn't support ANSI codes (so things like `at-xy', `clear', and
  other commands don't work making it impossible to generate a living
  menu).

r265057 (nwhitehorn): Turn off various fancy instruction sets...

  as well as deduplicate some options.  This makes the EFI loader build
  work with CPUTYPE=native in make.conf on my Core i5.

r268974 (sbruno): Supress clang warning for FreeBSD printf %b and %D formats

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>MFC r269077 (sbruno): libstand qdivrem warning fixes</title>
<updated>2014-09-04T20:49:11Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2014-09-04T20:49:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7302ebe00401c389a5e67968aaa41d71cdf85e6f'/>
<id>urn:sha1:7302ebe00401c389a5e67968aaa41d71cdf85e6f</id>
<content type='text'>
  libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not
  true on amd64 I'm not quite positive this is the "correct" solution for
  this but it does seem to compile and shut up the spew of warnings when
  compiling libstand for userboot.

  Add two _Static_asserts() so that in the future somebody will get a compile
  failure if an architecture develops that violates the assumptions of this
  code. (strongly suggested by jmg)

  Change commetns to indicate int types instead of long.  (noted by ian in
  phabric review)

  Phabric:    https://phabric.freebsd.org/D443
</content>
</entry>
</feed>
