History log of /openbsd-current/sys/arch/amd64/stand/libsa/diskprobe.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.28 04-Jun-2024 krw

Enable hibernate/resume to nvme(4) disks with 4096 byte sectors.

testing by florian@ mglocker@ mlarkin@

ok deraadt@ mglocker@ mlarkin@


Revision tags: OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.27 01-Sep-2022 krw

Stop setting d_bbsize and d_sbsize. Nobody has paid
any attention for some time.

ok otto@ as part of larger diff


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.26 09-Dec-2020 krw

Use daddr_t and not daddr32_t in boot media.

At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks.

More daddr32_t terminations with extreme prejudice to follow.

Tested by various, in snaps for a few days.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.25 24-Jun-2019 mlarkin

Remove a 15 year old #if 0 and wrap a long line (KNF)


# 1.24 10-May-2019 mlarkin

Disentangle #ifdef EFIBOOT.

Separate out files used by both BIOS and EFI boot modes. These files
had many #ifdef EFIBOOT code paths that make it difficult to move forward
with changes needed to support random base VA linked kernels.

ok deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.23 18-Jun-2018 krw

"a = 1; b = 100; c = a * b; if (c == 0) c = 100;"

is pretty silly. Nuke the if's.

ok millert@


Revision tags: OPENBSD_6_3_BASE
# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386


# 1.27 01-Sep-2022 krw

Stop setting d_bbsize and d_sbsize. Nobody has paid
any attention for some time.

ok otto@ as part of larger diff


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.26 09-Dec-2020 krw

Use daddr_t and not daddr32_t in boot media.

At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks.

More daddr32_t terminations with extreme prejudice to follow.

Tested by various, in snaps for a few days.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.25 24-Jun-2019 mlarkin

Remove a 15 year old #if 0 and wrap a long line (KNF)


# 1.24 10-May-2019 mlarkin

Disentangle #ifdef EFIBOOT.

Separate out files used by both BIOS and EFI boot modes. These files
had many #ifdef EFIBOOT code paths that make it difficult to move forward
with changes needed to support random base VA linked kernels.

ok deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.23 18-Jun-2018 krw

"a = 1; b = 100; c = a * b; if (c == 0) c = 100;"

is pretty silly. Nuke the if's.

ok millert@


Revision tags: OPENBSD_6_3_BASE
# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386


# 1.26 09-Dec-2020 krw

Use daddr_t and not daddr32_t in boot media.

At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks.

More daddr32_t terminations with extreme prejudice to follow.

Tested by various, in snaps for a few days.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.25 24-Jun-2019 mlarkin

Remove a 15 year old #if 0 and wrap a long line (KNF)


# 1.24 10-May-2019 mlarkin

Disentangle #ifdef EFIBOOT.

Separate out files used by both BIOS and EFI boot modes. These files
had many #ifdef EFIBOOT code paths that make it difficult to move forward
with changes needed to support random base VA linked kernels.

ok deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.23 18-Jun-2018 krw

"a = 1; b = 100; c = a * b; if (c == 0) c = 100;"

is pretty silly. Nuke the if's.

ok millert@


Revision tags: OPENBSD_6_3_BASE
# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386


# 1.25 24-Jun-2019 mlarkin

Remove a 15 year old #if 0 and wrap a long line (KNF)


# 1.24 10-May-2019 mlarkin

Disentangle #ifdef EFIBOOT.

Separate out files used by both BIOS and EFI boot modes. These files
had many #ifdef EFIBOOT code paths that make it difficult to move forward
with changes needed to support random base VA linked kernels.

ok deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.23 18-Jun-2018 krw

"a = 1; b = 100; c = a * b; if (c == 0) c = 100;"

is pretty silly. Nuke the if's.

ok millert@


Revision tags: OPENBSD_6_3_BASE
# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386


# 1.24 10-May-2019 mlarkin

Disentangle #ifdef EFIBOOT.

Separate out files used by both BIOS and EFI boot modes. These files
had many #ifdef EFIBOOT code paths that make it difficult to move forward
with changes needed to support random base VA linked kernels.

ok deraadt@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.23 18-Jun-2018 krw

"a = 1; b = 100; c = a * b; if (c == 0) c = 100;"

is pretty silly. Nuke the if's.

ok millert@


Revision tags: OPENBSD_6_3_BASE
# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386


# 1.23 18-Jun-2018 krw

"a = 1; b = 100; c = a * b; if (c == 0) c = 100;"

is pretty silly. Nuke the if's.

ok millert@


Revision tags: OPENBSD_6_3_BASE
# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386


# 1.22 18-Dec-2017 fcambus

Add sizes for free() in libsa for amd64 and i386.

OK tom@, deraadt@


# 1.21 06-Nov-2017 yasuoka

Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM.

Initial diff from FUKAUMI Naoki.


Revision tags: OPENBSD_6_2_BASE
# 1.20 21-Jul-2017 yasuoka

Check the hibernation signature for softraid disks and select valid bsd
for unhibernation. reported by Natasha Kerensikova. tested by Theo Buehler.

ok deraadt


# 1.19 22-Jun-2017 deraadt

Only print the magic '&' letter on a disk if the hibernate partition is
valid. This is an undocumented little debugging diagnostic, much like
the '*'.


# 1.18 19-Jun-2017 deraadt

As early as possible, create a link /bsd.booted to the /bsd kernel we
presume we booted from. If you boot from another kernel, we cannot help
you later with hibernate, sorry -- The kernel does not get a useable
filename from the bootblocks.

In the bootblocks, detect a live hibernate signature and boot from
/bsd.booted instead.

with yasuoka, lots of discussion with mlarkin, ok tom


Revision tags: OPENBSD_6_1_BASE
# 1.17 11-Sep-2016 jsing

Rename softraid boot files, which are currently in an MD location. This
will allow us to bring in a MI softraid.{c,h} in lib/libsa.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 02-Sep-2015 yasuoka

Initial commit of uefi boot loader of OpenBSD.

ok deraadt yuo


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.15 12-Jul-2014 tedu

revert more free fallout


# 1.14 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.13 05-Nov-2013 krw

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.12 30-Oct-2012 jsing

Apply a bunch of style(9) and whitespace fixes to i386/amd64 libsa, making
the code actually diffable. No binary change.


# 1.11 27-Oct-2012 jsing

Move the code for softraid boot into separate files, leaving only minimal
hooks that are called from the normal code path. This allows softraid boot
support to be completely enabled or disabled at compile time. For boot(8)
all softraid boot support is now enabled by default, including support for
booting from crypto volumes. Disable softraid boot support for fdboot,
which further shrinks the binary.


# 1.10 09-Oct-2012 jsing

Teach amd64 boot(8) how to access a softraid crypto volume. This allows for
full disk encryption since the kernel can now be loaded directly from the
crypto volume, instead of needing to be on FFS.

This is currently disabled by default, however can be enabled by compiling
with boot(8) 'make -DBOOT_CRYPTO'.


Revision tags: OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.9 11-Jan-2012 jsing

Teach OpenBSD/amd64 boot(8) how to access softraid(8) volumes. This
allows a kernel to be loaded from a softraid RAID 1 volume. Furthermore,
if you boot from a disk that is a member of a bootable softraid volume
then it will default to booting from the softraid volume (sr[0-9]a:/bsd).

Discussed with deraadt@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.8 23-Apr-2010 jsing

Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.

ok deraadt@ krw@ beck@ marco@ todd@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.7 21-May-2009 krw

The only value that d_npartitions should have is MAXPARTITIONS.


Revision tags: OPENBSD_4_5_BASE
# 1.6 10-Dec-2008 krw

When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.

Tested by Stephan. nick@ has no objections.

ok deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.5 18-Jun-2007 krw

Calculate the disklabel checksum *after* filling in all the fields in
the disklabel.

ok deraadt@


Revision tags: OPENBSD_4_1_BASE
# 1.4 26-Sep-2006 krw

Zap D_REMOVABLE flag from disklabel. If you didn't already know that
floppies and cd's were removable, displaying that fact in disklabel
output was unlikely to help. And the display in disklabel was the only
use of D_REMOVABLE in the tree.

ok marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE
# 1.3 21-Aug-2004 tom

Enter cdboot, a CD-specific second-stage bootrap. Based on the i386
cdboot that Toby and I put together at the hackathon.

"go for it" deraadt@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.2 21-Mar-2004 tom

Enter pxeboot on amd64. Initially intended to support network installs
using bsd.rd over TFTP.

ok deraadt@


# 1.1 03-Feb-2004 mickey

branches: 1.1.2;
das boot; das cloned das from das i386