History log of /openbsd-current/sys/arch/amd64/include/biosvar.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.32 08-Sep-2023 kn

Clean up old console bootargs

7.3 is long gone, you must have new bootloaders and new kernels.
Zaps both condition and else block, unindent and merge lines where fit.

Feedback OK kettenis
Tests OK denis


Revision tags: OPENBSD_7_3_BASE
# 1.31 18-Jan-2023 jsg

change BIOSF_SMBIOS bit flag from 6 to 8
matches tom@'s i386 rev 1.47 change


# 1.30 02-Jan-2023 kettenis

Let the EFI bootloader make a copy of the EFI System Resource Table (ESRT)
and pass it to the kernel.

ok jca@, patrick@


# 1.29 29-Nov-2022 guenther

Move the generic variable definitions from the ASM at the top of
locore.S to be in C in cpu.c, machdep.c, pmap.c, or bus_space.c for
better typing/debug info. Delete REALBASEMEM, REALEXTMEM, and
biosextmem as unused/ignored.

ok mpi@ krw@ mlarkin@


Revision tags: OPENBSD_7_2_BASE
# 1.28 29-Jun-2022 kettenis

Add support for using non-standard UARTs (such as the Synopsys DesignWare
UART found on AMD's Ryzen Embedded V1000 family) as an early console.
This requires additional parameters to be passed by the bootloader to the
kernel so it changes the struct for the BOOTARG_CONSDEV boot argument.
The old struct will still be supported until OpenBSD 7.3 has been released
such that new kernels boot with the old bootloader.

ok anton@, deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.27 29-Nov-2019 kettenis

Pass the EFI memory map to the kernel.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE
# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.31 18-Jan-2023 jsg

change BIOSF_SMBIOS bit flag from 6 to 8
matches tom@'s i386 rev 1.47 change


# 1.30 02-Jan-2023 kettenis

Let the EFI bootloader make a copy of the EFI System Resource Table (ESRT)
and pass it to the kernel.

ok jca@, patrick@


# 1.29 29-Nov-2022 guenther

Move the generic variable definitions from the ASM at the top of
locore.S to be in C in cpu.c, machdep.c, pmap.c, or bus_space.c for
better typing/debug info. Delete REALBASEMEM, REALEXTMEM, and
biosextmem as unused/ignored.

ok mpi@ krw@ mlarkin@


Revision tags: OPENBSD_7_2_BASE
# 1.28 29-Jun-2022 kettenis

Add support for using non-standard UARTs (such as the Synopsys DesignWare
UART found on AMD's Ryzen Embedded V1000 family) as an early console.
This requires additional parameters to be passed by the bootloader to the
kernel so it changes the struct for the BOOTARG_CONSDEV boot argument.
The old struct will still be supported until OpenBSD 7.3 has been released
such that new kernels boot with the old bootloader.

ok anton@, deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.27 29-Nov-2019 kettenis

Pass the EFI memory map to the kernel.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE
# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.30 02-Jan-2023 kettenis

Let the EFI bootloader make a copy of the EFI System Resource Table (ESRT)
and pass it to the kernel.

ok jca@, patrick@


# 1.29 29-Nov-2022 guenther

Move the generic variable definitions from the ASM at the top of
locore.S to be in C in cpu.c, machdep.c, pmap.c, or bus_space.c for
better typing/debug info. Delete REALBASEMEM, REALEXTMEM, and
biosextmem as unused/ignored.

ok mpi@ krw@ mlarkin@


Revision tags: OPENBSD_7_2_BASE
# 1.28 29-Jun-2022 kettenis

Add support for using non-standard UARTs (such as the Synopsys DesignWare
UART found on AMD's Ryzen Embedded V1000 family) as an early console.
This requires additional parameters to be passed by the bootloader to the
kernel so it changes the struct for the BOOTARG_CONSDEV boot argument.
The old struct will still be supported until OpenBSD 7.3 has been released
such that new kernels boot with the old bootloader.

ok anton@, deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.27 29-Nov-2019 kettenis

Pass the EFI memory map to the kernel.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE
# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.29 29-Nov-2022 guenther

Move the generic variable definitions from the ASM at the top of
locore.S to be in C in cpu.c, machdep.c, pmap.c, or bus_space.c for
better typing/debug info. Delete REALBASEMEM, REALEXTMEM, and
biosextmem as unused/ignored.

ok mpi@ krw@ mlarkin@


Revision tags: OPENBSD_7_2_BASE
# 1.28 29-Jun-2022 kettenis

Add support for using non-standard UARTs (such as the Synopsys DesignWare
UART found on AMD's Ryzen Embedded V1000 family) as an early console.
This requires additional parameters to be passed by the bootloader to the
kernel so it changes the struct for the BOOTARG_CONSDEV boot argument.
The old struct will still be supported until OpenBSD 7.3 has been released
such that new kernels boot with the old bootloader.

ok anton@, deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.27 29-Nov-2019 kettenis

Pass the EFI memory map to the kernel.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE
# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.28 29-Jun-2022 kettenis

Add support for using non-standard UARTs (such as the Synopsys DesignWare
UART found on AMD's Ryzen Embedded V1000 family) as an early console.
This requires additional parameters to be passed by the bootloader to the
kernel so it changes the struct for the BOOTARG_CONSDEV boot argument.
The old struct will still be supported until OpenBSD 7.3 has been released
such that new kernels boot with the old bootloader.

ok anton@, deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.27 29-Nov-2019 kettenis

Pass the EFI memory map to the kernel.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE
# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.27 29-Nov-2019 kettenis

Pass the EFI memory map to the kernel.

ok deraadt@


Revision tags: OPENBSD_6_6_BASE
# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.26 04-Aug-2019 kettenis

Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduce
differences between the i386 and amd64 versions of the code and
switch to using the standard C integer exact width integer types.

ok deraadt@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


# 1.25 06-Feb-2018 patrick

Load the Intel microcode much earlier. So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier. Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg. This way we can update
the cores' microcode before we identify them.

ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)


Revision tags: OPENBSD_6_2_BASE
# 1.24 20-Jun-2017 tom

Fix a couple of comment typos in amd64 and i386 biosvar.h


# 1.23 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_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.22 30-Aug-2015 yasuoka

Modify kernel to prepare boot from UEFI.

- Add new boot arg "bios_efi_info_t" to pass the paramters from UEFI
- Make bios(4) and acpi(4) be able to probe with the parameters from
UEFI
- Add efifb(8). It uses the framebuffer from UEFI and it will work as
a backend of wsdisplay(4) and wsfb (X11 video driver). Disabled by
the kernel config for this moment

input and ok kettenis


Revision tags: OPENBSD_5_8_BASE
# 1.21 17-Jul-2015 mlarkin

Remove (unused) references to bios32, which is not present in amd64.

ok deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.20 27-Jan-2015 mlarkin

Remove an odd comment in the first line of the file

ok deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.19 02-Nov-2013 kettenis

Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing
your serial console.

ok deraadt@


Revision tags: OPENBSD_5_4_BASE
# 1.18 23-Mar-2013 deraadt

refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant
order -- all namespace intrusion is at the tail can be cleaned up
independently. locore, bootblocks, and libkvm still see enough visibility to
build. Checked on 90% of platforms...


Revision tags: OPENBSD_5_3_BASE
# 1.17 09-Oct-2012 jsing

Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.


Revision tags: OPENBSD_5_2_BASE
# 1.16 03-Jun-2012 kettenis

Add support for serial consoles at non-standard addresses. This implements
a new "machine comaddr" command that makes it possible to configure the
io port used to access the serial port. This can be used to use serial ports
on a puc(4) device as serial console.


Revision tags: OPENBSD_5_1_BASE
# 1.15 11-Jan-2012 jsing

Pass the DUID of the boot disk via bootduid instead of rootduid, since it
is the DUID that we booted from, which is not always going to be the same
as the DUID that we mount root on.


Revision tags: OPENBSD_5_0_BASE
# 1.14 26-Apr-2011 jsing

Make amd64/i386 boot(8) pass the DUID of the selected boot device to the
kernel so that it can use it to identify the root disk. This will be
needed in order to correctly boot from a softraid volume.

ok deraadt@ marco@ krw@


# 1.13 23-Mar-2011 pirofti

Normalize sentinel. Use _MACHINE_*_H_ and _<ARCH>_*_H_ properly and consitently.

Discussed and okay drahn@. Okay deraadt@.


# 1.12 14-Mar-2011 krw

Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.

Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.

I can now install and boot from the 7th extended partition below
128GB.

Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.

ok deraadt@ (less a couple of minor tweaks found in testing)


Revision tags: OPENBSD_4_9_BASE
# 1.11 22-Nov-2010 miod

Remove prototypes for missing (removed) functions or already found in a
MI header file.


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.10 30-Apr-2009 dlg

pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.

requested by art@
no problem! deraadt@


Revision tags: OPENBSD_4_5_BASE
# 1.9 01-Sep-2008 deraadt

Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must
independently request that they themselves become __packed, too.
worked on with toby
CVS: ----------------------------------------------------------------------


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.8 05-Dec-2007 deraadt

Hang acpi(4) below bios(4) instead of mainbus(4). This lets us move acpi(4)
before pcibios(4), and then.... if acpi(4) attaches, skip pcibios(4) since
it messes the machines up. Fixes claudio's HP dl320 G5, and almost assuredly
others.
ok kettenis


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.7 20-May-2006 deraadt

add bios_bootmac_t and BOOTARG_BOOTMAC


# 1.6 08-May-2006 gwk

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.5 13-Dec-2005 mickey

remove ad clause that got copied from older versions of the files; pto by jsg@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.4 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.3 27-Feb-2004 deraadt

put a bit more flesh in the sysctl machdep; parts from tom


# 1.2 03-Feb-2004 mickey

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


# 1.1 28-Jan-2004 mickey

an amd64 arch support.
hacked by art@ from netbsd sources and then later debugged
by me into the shape where it can host itself.
no bootloader yet as needs redoing from the
recent advanced i386 sources (anyone? ;)