History log of /haiku/src/system/boot/platform/bios_ia32/start.cpp
Revision Date Author Comments
# 367beefa 13-Jan-2022 David Karoly <karolyd577@gmail.com>

boot/x86: move HPET initialization to arch folder

Change-Id: Iac3f4923f132c4c3328fde5af1dad75af5b2efbd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4864
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# d2986cb6 21-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

system/boot: More cleanup and shuffling

* arm efi additions
* cleanup some cpu headers which were oddly
split between efi and bios_ia32
* Move calculate_cpu_conversion_factor over to
arch_timer since it is timerish, and x86 only
* Drop some duplicated code from efi start. Move
hpet init code into efi timer/hpet code

Change-Id: Ia4264a5690ba8c09417b06788febc4f572f111ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2259
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 7b4d924f 04-Dec-2019 Andrej Antunovikj <tunas@cryptolab.net>

cpu: Extract shared x86 code from efi & bios_ia32

This issue was initially detected by PVS Studio (issue number V547) and fixed
as part of Google Code-in 2019.

The initial problem was the calculate_cpu_conversion_factor function
which had been copied in the BIOS and EFI versions of the boot code.
Further investigation led to more duplicated or very similar functions
being identified.

Introduce an arch_cpu.h for the x86 boot platform to group these things
in a single place, and adjust the BIOS and EFI code to call into that.
Note that the BIOS and EFI code is still a little platform specific,
ideally there should be a boot_arch_cpu_init() function for each
architecture as already done for openfirmware and u-boot.

Also remove some irrelevant comments from copypasted files for other
architectures, as that was filling my git grep with useless noise.

Change-Id: I16d815f0bf015cec0b4e03cc14f3cc447c7164c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1985
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 01a479da 28-Jan-2014 Pawel Dziepak <pdziepak@quarnos.org>

boot/x86: Fix unused variable warning


# 527da4ca 27-Jan-2014 Pawel Dziepak <pdziepak@quarnos.org>

x86[_64]: Separate bootloader and kernel GDT and IDT logic

From now on bootloader sets up its own minimal valid GDT and IDT. Then
the kernel replaces them with its own tables.


# f132bdfe 08-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Add 256 KB additional heap

packagefs is using quite a bit additional memory for the MIME DB
entries and with all files identified.


# 76a1175d 11-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Support for SMP on x86_64.

No major changes to the kernel: just compiled in arch_smp.cpp and fixed the
IDT load in arch_cpu_init_percpu to use the correct limit for x86_64 (uses
sizeof(interrupt_descriptor)). In the boot loader, changed smp_boot_other_cpus
to construct a temporary GDT and get the page directory address from CR3, as
what's in kernel_args will be 64-bit stuff and will not work to switch the
CPUs into 32-bit mode in the trampoline code. Refactored 64-bit kernel entry
code to not use the stack after disabling paging, as the secondary CPUs are
given a 32-bit virtual stack address by the SMP trampoline code which will
no longer work.


# e5fc2bfc 26-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Implemented long mode setup/switch code, the bootloader can now start the 64-bit kernel!

The setup procedure is fairly simple: create a 64-bit GDT and 64-bit page
tables that include all kernel mappings from the 32-bit address space, but at
the correct 64-bit address, then go through kernel_args and changes all virtual
addresses to 64-bit addresses, and finally switch to long mode and jump to the
kernel.


# 69a8b954 23-Jun-2012 Ingo Weinhold <ingo_weinhold@gmx.de>

FixedWidthPointer: Fix ==/!= operators, remove OtherType casts

* FixedWidthPointer:
- operators ==/!=: Change second operand type from void* to const
Type*. Also add non-const version to resolve ambiguity warning when
comparing with non-const pointer.
- Add Pointer() getter.
- Remove templatized cast operators. They are nice for casting the
pointer directly to another pointer type, but result in ambiguity.
* Make preloaded_image::debug_string_table non-const. Avoids clashes of
the const and non-coast FixedWidthPointer comparison operators. A
cleaner (but more verbose) solution would be to spezialize
FixedWidthPointer for const types.


# 3a2a3367 22-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Support static_cast on FixedWidthPointer.


# f1244978 22-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Added an ELF64 version of preloaded_image.

* There is now 2 structures, preloaded_elf32_image and preloaded_elf64_image,
which both inherit from preloaded_image.
* For now I've just hardcoded in use of preloaded_elf32_image, but the
bootloader ELF code will shortly be converted to use templates which use
the appropriate structure. The kernel will be changed later when I add
ELF64 support to it.
* All kernel_args data is now compatible between 32-bit and 64-bit kernels.


# 02b57b32 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Bump boot loader heap size


# 898396ef 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Increase boot loader heap size

We need more for packagefs support.


# 2e8aa19c 10-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* The boot loader does now set up an IDT that allows it to catch processor
exceptions (page faults and the like). The handler dumps possibly interesting
information (registers, a (numerical) stack trace) to the serial output, and,
if possible, also to the screen. That should help debugging boot loader
crashes.
* For the IDT the boot loader sets up for the kernel the descriptors are set up
the same way, so until the kernel initializes the IDT itself (arch_init()) the
facility is still in place and can thus catch very early kernel boot crashes.
Unfortunately the on-screen output doesn't seem to work anymore at that point,
so the output only goes to the serial port...
* ... and to the debug syslog -- dprintf() does now append it there after
debug_cleanup() has been called. Seems to work fine in qemu, but when I tested
it on real hardware the debug syslog was gone.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b6add3ff 25-Jun-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed remaining .c files to .cpp, and made the necessary changes to let
them compile still.
* Some cleanup in ARM's start2.cpp.
* m68k stuff is still missing, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37249 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01a479daa90cb9435857ea086b5ea3dae1a36f8b 28-Jan-2014 Pawel Dziepak <pdziepak@quarnos.org>

boot/x86: Fix unused variable warning


# 527da4ca8a4c008b58da456c01a49dcf16a98fbc 27-Jan-2014 Pawel Dziepak <pdziepak@quarnos.org>

x86[_64]: Separate bootloader and kernel GDT and IDT logic

From now on bootloader sets up its own minimal valid GDT and IDT. Then
the kernel replaces them with its own tables.


# f132bdfe9f0a7e132d1b93e5c117f384ae0527c4 08-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Add 256 KB additional heap

packagefs is using quite a bit additional memory for the MIME DB
entries and with all files identified.


# 76a1175dbe1a314563ca18c0b7fb82695a9730cd 11-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Support for SMP on x86_64.

No major changes to the kernel: just compiled in arch_smp.cpp and fixed the
IDT load in arch_cpu_init_percpu to use the correct limit for x86_64 (uses
sizeof(interrupt_descriptor)). In the boot loader, changed smp_boot_other_cpus
to construct a temporary GDT and get the page directory address from CR3, as
what's in kernel_args will be 64-bit stuff and will not work to switch the
CPUs into 32-bit mode in the trampoline code. Refactored 64-bit kernel entry
code to not use the stack after disabling paging, as the secondary CPUs are
given a 32-bit virtual stack address by the SMP trampoline code which will
no longer work.


# e5fc2bfcab8c15a3ff7d33c358f9aa82ed73c823 26-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Implemented long mode setup/switch code, the bootloader can now start the 64-bit kernel!

The setup procedure is fairly simple: create a 64-bit GDT and 64-bit page
tables that include all kernel mappings from the 32-bit address space, but at
the correct 64-bit address, then go through kernel_args and changes all virtual
addresses to 64-bit addresses, and finally switch to long mode and jump to the
kernel.


# 69a8b95491c160f03a5b0dab0fa8d1899fe42d4b 23-Jun-2012 Ingo Weinhold <ingo_weinhold@gmx.de>

FixedWidthPointer: Fix ==/!= operators, remove OtherType casts

* FixedWidthPointer:
- operators ==/!=: Change second operand type from void* to const
Type*. Also add non-const version to resolve ambiguity warning when
comparing with non-const pointer.
- Add Pointer() getter.
- Remove templatized cast operators. They are nice for casting the
pointer directly to another pointer type, but result in ambiguity.
* Make preloaded_image::debug_string_table non-const. Avoids clashes of
the const and non-coast FixedWidthPointer comparison operators. A
cleaner (but more verbose) solution would be to spezialize
FixedWidthPointer for const types.


# 3a2a3367dc9bec2a5fbcd4ac849da6ac65e74e79 22-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Support static_cast on FixedWidthPointer.


# f1244978152350f9cc010e766d09c2e9ad34dfce 22-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Added an ELF64 version of preloaded_image.

* There is now 2 structures, preloaded_elf32_image and preloaded_elf64_image,
which both inherit from preloaded_image.
* For now I've just hardcoded in use of preloaded_elf32_image, but the
bootloader ELF code will shortly be converted to use templates which use
the appropriate structure. The kernel will be changed later when I add
ELF64 support to it.
* All kernel_args data is now compatible between 32-bit and 64-bit kernels.


# 02b57b32a3ee6a799bc265d95d50f57ebc0886d9 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Bump boot loader heap size


# 898396ef61056cb047741a3fbc5533b418a65666 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Increase boot loader heap size

We need more for packagefs support.


# 2e8aa19c638e27939fd6aaa4e2570b2411e15368 10-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* The boot loader does now set up an IDT that allows it to catch processor
exceptions (page faults and the like). The handler dumps possibly interesting
information (registers, a (numerical) stack trace) to the serial output, and,
if possible, also to the screen. That should help debugging boot loader
crashes.
* For the IDT the boot loader sets up for the kernel the descriptors are set up
the same way, so until the kernel initializes the IDT itself (arch_init()) the
facility is still in place and can thus catch very early kernel boot crashes.
Unfortunately the on-screen output doesn't seem to work anymore at that point,
so the output only goes to the serial port...
* ... and to the debug syslog -- dprintf() does now append it there after
debug_cleanup() has been called. Seems to work fine in qemu, but when I tested
it on real hardware the debug syslog was gone.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b6add3ffb67db23d3c873c4614750a9bd1164be1 25-Jun-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed remaining .c files to .cpp, and made the necessary changes to let
them compile still.
* Some cleanup in ARM's start2.cpp.
* m68k stuff is still missing, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37249 a95241bf-73f2-0310-859d-f6bbb57e9c96