History log of /haiku/src/system/boot/loader/Jamfile
Revision Date Author Comments
# 4865dc87 21-Mar-2024 Augustin Cavalier <waddlesplash@gmail.com>

bootloader: Add a debugger() function.

Just like the kernel has.

Put in the same file with the user_memcpy wrapper,
and rename the file to "misc.cpp" (which is a name
also used in libroot_build for a file containing
miscellaneous wrapper functions.)


# f6166140 29-Nov-2022 Augustin Cavalier <waddlesplash@gmail.com>

build: Define _BOOT_MODE once and for all in ArchitectureRules+BootRules.

Previously it was spread all around the tree, and was not defined
consistently for all boot objects (there were a number of boot modules
which did not define it, but did include headers which checked for it.)

Now, as it is handled in SetupBoot which is invoked for all boot objects,
it will be applied consistently throughout. We can thus drop the manual
additions of it from all Jamfiles.


# 2ca24be6 30-Sep-2022 David Karoly <karolyd577@gmail.com>

boot: embed Haiku revision in loader binary

Change-Id: I9f71fba6c2c4fdaa63e118825c5fd00d51b556fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5693
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# c2dcf106 29-Sep-2022 Alexander von Gluck IV <kallisti5@unixzen.com>

Revert "boot/efi/x86: enable support for 64-bit ELF"

This reverts commit 5897f7b6235d36a58582513ad5db270d9b1ce926.

See #17961 for additional information. This breaks the official
builds by growing the bios_ia32 loader too much.

Change-Id: I63bc0c95839ef681a260efdd6ddf527d6699c1f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5704
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 5897f7b6 22-Sep-2022 David Karoly <karolyd577@gmail.com>

boot/efi/x86: enable support for 64-bit ELF

Change-Id: Id3b207444b55041dc83ee1afdd61b467ce13ff70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5665
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 61790bdb 09-Sep-2022 Jérôme Duval <jerome.duval@gmail.com>

partitioning_systems: create libpartitioning_systemscommon for common files

Change-Id: I1b3c2f9bad60024a7a07ae4bbfe3970ac5ae42b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5632
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 182eaee9 30-Nov-2021 David Karoly <karolyd577@gmail.com>

boot/loader/x86: select between 32-bit and 64-bit ELF support based on arch and platform

Build both when building BIOS loader.
Build only 32-bit ELF support for 32-bit EFI loader.
Build only 64-bit ELF support for 64-bit EFI loader.

Change-Id: I88bb287fbb9a4b6618b365b2d03f85f64021f499
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4818
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# c4eec9f1 01-Oct-2021 Augustin Cavalier <waddlesplash@gmail.com>

Distinguish KERNEL_ARCH_DIR from KERNEL_ARCH.

On x86_64, the KERNEL_ARCH should really be "x86_64", but it was "x86"
as the architecture sources/headers directory is shared between 32 and 64 bit.

Should not be a functional change on any platform outside x86_64.


# 5e567c10 21-Aug-2021 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

ARM64 Jamfiles, missed in previous commit

* Use generic c versions of memset and memcpy
Wwrite fast asm for that later, therefore no need for arch_string.S
* Disable FDT and DTB until ARM64 is ready
(WIP: do it later)
* use ELF64


# 35fad4a4 11-Jun-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

bootloader: Enable GPT partition support in EFI loader

This was enabled per-architecture, but it is reasonable to always
enable GPT support for all EFI systems, no matter which CPU is used.

Change-Id: I53ca2caf048fbc4ead6cfb74c8734ac9ad382224
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4085
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 560961ee 11-Aug-2020 Murai Takashi <tmurai01@gmail.com>

Bootloader: replace blacklist with blocklist

Various projects, both commercial and OSS, began to use inclusive
terminology. There is no reason to not do it.

In Haiku, bootloader uses Blacklist, which is recommended to replace
with Denylist or Blocklist. I think Blocklist is appropriate here,
since it's a list used to block offending driver at boot.

Some strings remain unchanged for compatibility with previous naming,
but this change prepares for later removal of these (once everyone has
updated their kernel and bootloader).

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


# 170aff0a 23-Jan-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

kernel/arch/riscv64: Fix elf image loading / add basic relocations

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


# 03c037b9 30-Dec-2020 Jérôme Duval <jerome.duval@gmail.com>

bootloader: defines _BOOT_PLATFORM_BIOS on x86/bios_ia32


# ed7204fa 13-Dec-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

gpt: Correct naming. efi_* also conflicts with some efi headers

Change-Id: I19b5b2c4609da8474b26588ae8d7d4caf72a826b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2018
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 09b40d16 03-Dec-2019 Ynoga <ynoga@protonmail.com>

ppc: Minor tweaks to get the arch compile again (WIP)

- Factor in types changes (introduction of intptr_t)
- Align JamFiles syntax with in progress architectures (arm/sparc)
- Xorriso doesn't support much of the mkisofs options (anymore ?)
- (After a correct bootstrap) one should be able to build @minimum-raw and haiku-boot-cd again
Change-Id: I4f779ad8f2210389fa9b7f7c0a98c3652a64c257
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1983
Reviewed-by: François Revol <revol@free.fr>


# ddf7e72f 25-Mar-2019 PulkoMandy <pulkomandy@pulkomandy.tk>

loader: Do not assume ELF32 for any non-EFI target.

sparc is 64bit even at the bootloader stage.

Change-Id: Idbf39497503aac08e72c691cf655e97f95347784
Reviewed-on: https://review.haiku-os.org/c/1324
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 1f96a3cb 08-Oct-2018 Jessica Hamilton <jessica.l.hamilton@gmail.com>

system/boot: Add support for multiple bootloaders


# 25fa3b1b 14-Nov-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

loader: fix defines affecting elf.cpp for other platforms


# b3215a62 21-Oct-2014 Henry Harrington <henry.harrington@gmail.com>

EFI: preliminary support for starting the kernel.

Enough to let the kernel to print hello, but not much beyond that.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# c0bdc8be 22-Apr-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

bootloader: build objects in $(TARGET_BOOT_PLATFORM)

This separates the objects required for the various boot
loaders, allowing the build system to be able to build
for different targets alongside each other. Currently
only done for bios_ia32 vs efi, as both loaders will be
needed for the x86_64 images.


# bd060476 06-Nov-2013 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Setup -fno-pic or -fpic in Architecture Rules.

EFI boot needs -fpic but all boot code was built with -fno-pic.
This is now set accordingly in HAIKU_BOOT_CCFLAGS and
HAIKU_BOOT_C++FLAGS.

Also setup compile flags for EFI platform.


# 211483cb 14-Apr-2016 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

EFI: Initial test EFI application

* Only set HAIKU_BOOT_PLATFORM to bios_ia32 if not defined
* Add gnuefi build feature
* Introduce BOOT_LDFLAGS, and move options for passing to linker
into ArchitectureSetup
* x86_64 compile fixes for warnings in boot loader
* loader/elf.cpp: don't include ELF32 support when targeting EFI
* relocation_func.cpp: copy of the relocation code from gnuefi
to make _relocate extern "C", and avoid including <efilib.h>
* boot_loader_efi.ld: copy of gnuefi's elf_x86_64_efi.lds,
modified to include support for C++ constructors, etc. Keep in
sync with the gnuefi package

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# 32832cbe 23-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove BPackageKit::BDataOutput

Use BDataIO instead.


# 5c0f8450 14-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Boot loader: Add support for choosing an old packages state

For potential boot volumes with older packages states the respective
item in the boot volume menu now has a sub menu for selecting a state.
The boot loader functionality for this feature is complete -- i.e. the
respective kernel is loaded and the name of the old state is added to
the kernel args -- but kernel packagefs and package daemon support is
still missing.


# c04f3a62 20-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Add safe mode blacklist submenu

It's a browser for the system package content, where entries can be
selected to blacklist them. The selected entries are removed from the
packagefs instance in the boot loader, so that e.g. selected drivers
won't be picked up. The paths are also added to the safe mode driver
settings and will be interpreted when the system packagefs instance is
mounted by the kernel.


# 3a7e0b00 19-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Support blacklisting entries in packages

In each installation location, it is now possible to create a settings
file "packages" that allows to blacklist entries contained in packages.
The format is:

Package <package name> {
EntryBlacklist {
<entry path>
...
}
}
...

<package name> is the base name (no version) of the respective package
(e.g. "haiku"), <entry path> is an installation location relative path
(e.g. "add-ons/Translators/FooTranslator").

Blacklisted entries will be ignored by packagefs, i.e. they won't appear
in the file system. This addresses the issue that it may be necessary to
remove a problematic file (e.g. driver, add-on, or library), which would
otherwise require editing the containing package file.

The settings file is not not "live". Changes take effect only after
reboot (respectively when remounting the concerned packagefs volume).


# ab313893 25-Jan-2013 Axel Dörfler <axeld@pinc-software.de>

Implemented write support, reorganized source files.

* Moved some functionality into their own files so that they can easily
be reused by other code.
* Added crc32() function from FreeBSD. Implemented CRC handling and
validation.
* Implemented missing write functionality.


# 61ba1259 23-Jan-2013 Axel Dörfler <axeld@pinc-software.de>

Renamed partitioning system "efi" directory to "gpt".


# da80a050 02-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Preparation for merge of x86 and x86_64 kernel sources.

Since x86 and x86_64 share a lot of common code, x86_64 kernel sources/headers
are going to reside under headers/private/kernel/arch/x86 and
src/system/kernel/arch/x86 along with the existing x86 code. This commit
changes the build system to handle this. A new variable, TARGET_KERNEL_ARCH,
has been added. This is the name of the kernel/boot architecture directory
name, set to x86 on both x86 and x86_64. This is now used in all places where
TARGET_ARCH was used to get to kernel arch sources/headers (I've changed
everything necessary as far as I can tell). Kernel won't build for x86_64
at the moment as the sources have not been merged, loader does.


# f6a34444 24-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Added x86_64 ELF64 relocation functions for the bootloader. All that's left to do now is handle the 64-bit load address properly.


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

Changed the boot ELF code to use templates and added ELF64 support.

The actual implementation of the ELF loading methods have been put into
an ELFLoader template class that takes a single template parameter, which
is a structure containing all the necessary ELF typedefs. It's a bit
verbose, but I thought it was a neater solution than using a bunch of
standalone functions with a huge number of template parameters. There is
no change to code outside of elf.cpp, the ELF32/ELF64 differences are
handled internally.


# 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.


# 7417d5ed 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Made the bootloader search for both kernel_x86 and kernel_x86_64 when built for x86 or x86_64.


# 65ad1ba3 26-May-2012 Alex Smith <alex@alex-smith.me.uk>

Made it possible to build the bootloader when targetting x86_64.

* x86_64 is using the existing *_ia32 boot platforms.
* Special flags are required when compiling the loader to get GCC to compile
32-bit code. This adds a new set of rules for compiling boot code rather
than using the kernel rules, which compile using the necessary flags.
* Some x86_64 private headers have been stubbed by #include'ing the x86
versions. These will be replaced later.


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

Add BReferenceable to boot loader

Also force include kernel_cpp.h, so it doesn't have to be included in
every file (still is included in most, though).


# 08e6655a 05-Nov-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by kaliber (ticket #6333): Removed many instances of
passing an additional -Wall to the compiler, which may actually
have unwanted effects. -Wall is standard by the build system.
Also, -Wno-multichar was passed unnecessarily for Haiku targets.
I didn't remove it for the bfs_shell, hope this is what Ingo meant
in the ticket.


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


# 85db3873 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

find_directory.c, driver_settings.c: Converted to C++.


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


# 085cf27b 16-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added Directory::CreateFile() which can be implemented by file systems to
support file creation.
* Extended open() and open_from() to support O_CREAT to create files.
open_from() has got an optional "permissions" parameter for that purpose.
* Fixed errno. It would crash when being used. Also changed the POSIX functions
to return their error code via errno as expected.
* Added writev().
* FAT file system:
- Added support for reading long file names.
- Added support for creating files (8.3 name only) and writing to them.
- Enabled scanning partitions with it.
* Boot loader menu:
- Enabled the "Reboot" menu item unconditionally.
- Added "Save syslog from previous session" menu item to the debug menu.
Currently saving the syslog to FAT32 volumes is supported.


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


# 28a2172c 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel:
* The kernel syslog ring buffer is no longer emptied by the syslog sender
thread. Instead we only drop the oldest data from the buffer when we're
writing to it and there's not enough free space in it.
Advantages: We drop old data rather than the most recent data when the buffer
is full. The "syslog" KDL command has more data available now. So the odds
are that kernel syslog messages not written to disk yet are at least still
in the kernel buffer.
* Changed dprintf_no_syslog() semantics: Now it writes to the syslog, but
doesn't notify the syslog sender thread.

boot loader:
* Added the ring_buffer implementation and a dummy user_memcpy().
* bios_x86: Moved the syslog stuff from serial.{cpp,h} to debug.{cpp.h}.
* Moved the debug options from the "Select safe mode options" menu to a new
"Select debug options" menu.
* Added option "Enable debug syslog" to the new menu (ATM available on x86
only). It allocates a 1 MB in-memory buffer for the syslog for this session
in such a way that it can be accessed by the boot loader after a reset.
* Added item "Display syslog from previous session" to the new menu, doing
what its name suggests.


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


# bd185b41 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

*.c -> *.cpp


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


# 89294b50 26-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added option for enabling serial debug output.
* Moved device_manager/settings.cpp to debug/safemode_settings.cpp.
* Removed the somewhat hacky concatenation of kernel settings and safemode
settings in the boot loader. Instead, get_safemode_option() will now fall
back to the kernel settings, if it couldn't spot a setting in the safemode
settings. This allows for more control, and also makes enabling serial
debug output actually work (ie. overriding the kernel settings via safemode
options).
* Adjusted debug_init_post_vm(), and smp_init_other_cpus() to use
get_safemode_boolean().
* Therefore, I added safemode_settings.cpp to the boot loader as well.


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


# 9e90c30e 12-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings.
* Removed FAT support from the boot loader for now.


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


# f335531b 04-Aug-2009 François Revol <revol@free.fr>

Remove file map disk support by default, it's not used anyway, and we'll use layers for CD anyway. Doesn't spare that many bytes though...


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


# c06e68d0 22-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added partitioning system modules efi_gpt, amiga_rdb, and apple to the image.
* Changed the boot loader to have architecture dependent partition/file system
support. Amiga/Apple partitions, and the AmigaFFS file system are now only
supported on PPC, while EFI GPT, and the FAT file system is now only supported
on x86.


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


# 2cf4975b 15-Oct-2008 François Revol <revol@free.fr>

Add FAT32 support. This allows the bootloader to find a BFS image file (currently named BEOS\IMAGE.BE) and start booting for it, until the kernel tries to mount the boot partition.


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


# 0bdaf028 09-Aug-2008 François Revol <revol@free.fr>

Start of a file map disk driver for the bootloader.


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


# 6b202f4e 13-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced new header directory headers/private/system which is supposed
to contain headers shared by kernel and userland (mainly libroot).
* Moved quite a few private kernel headers to the new location. Split
several kernel headers into a shared part and one that is still kernel
private. Adjusted all affected Jamfiles and source in the standard x86
build accordingly. The build for other architectures and for test code
may be broken.
* Quite a bit of userland code still includes private kernel headers.
Mostly those are <util/*> headers. The ones that aren't strictly
kernel-only should be moved to some other place (maybe
headers/private/shared/util).


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


# 9e8dc2a9 14-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

[Sorry, couldn't split this one up any further.]
* Images preloaded by the boot loader had to be modules to be of any use
to the kernel. Extended the mechanism so that any images not accepted
by the module code would later be tried to be added as drivers by the
devfs. This is a little hacky ATM, since the devfs manages the drivers
using a hash map keyed by the drivers inode ID, which those drivers
obviously don't have.
* The devfs emulates read_pages() using read(), if the device driver
doesn't implement the former (all old-style drivers), thus making it
possible to BFS, which uses the file cache which in turn requires
read_pages(), on the device. write_pages() emulation is still missing.
* Replaced the kernel_args::boot_disk structure by a KMessage, which can
more flexibly be extended and deals more gracefully with
arbitrarily-size data. The disk_identifier structure still exists,
though. It is added as message field in cases where needed (non net
boot). Moved the boot_drive_number field of the bios_ia32 platform
specific args into the message.
* Made the stage 1 PXE boot loader superfluous. Moved the relevant
initialization code into the stage 2 loader, which can now be loaded
directly via PXE.
* The PXE boot loader does now download a boot tgz archive via TFTP. It
does no longer use the RemoteDisk protocol (it could actually be
removed from the boot loader). It also parses the DHCP options in the
DHCPACK packet provided by PXE and extracts the root path to be
mounted by the kernel.
* Reorganized the boot volume search in the kernel (vfs_boot.cpp) and
added support for network boot. In this case the net stack is
initialized and the network interface the boot loader used is brought
up and configured. Since NBD and RemoteDisk are our only options for
net boot (and those aren't really configurable dynamically) ATM, the
the boot device is found automatically by the disk device manager.

Booting via PXE does work to some degree now. The most grievous problem
is that loading certain drivers or kernel modules (or related activity)
causes a reboot (likely a triple fault, though one wonders where our
double fault handler is on vacation). Namely the keyboard and mouse input
server add-ons need to be deactivated as well as the media server.
A smaller problem is the net server, which apparently tries to
(re-)configure the network interface we're using to boot, which
obviously doesn't work out that well. So, if all this stuff is disabled
Haiku does fully boot, when using the RemoteDisk protocol (not being
able to use keyboard or mouse doesn't make this a particular fascinating
experience, though ;-)). I had no luck with NBD -- it seemed to have
protocol problems with the servers I tried.


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


# eef8417e 30-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

* Added (non-working) EFI module to the boot loader and its test application.
* Fixed a warning in efi_gpt.cpp.


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


# 44d56753 16-Aug-2006 Jérôme Duval <korli@users.berlios.de>

KernelAddon and KernelStaticLibrary don't include kernel, kernel arch, boot platform headers anymore.
Fixed the build of most of targets using these rules. Though the build can be still broken, feel free to fix.


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


# d561d0ad 27-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a mini networking stack to the boot loader. It speaks basic ARP,
IP, and UDP, as well as a home brewn UDP based protocol, "remote disk",
which provides random access to a single remote file/device. The Open
Firmware flavored boot loader automatically initializes the net stack,
searches for a remote disk, and tries to boot from it, if the boot
device is a network device (e.g. when loading the boot loader via
TFTP).

This is quite nice for developing with a two-machine setup, since one
doesn't even need to install Haiku on the test machine anymore, but can
serve it directly from the development machine. When the networking
support in the kernel is working, this method could even be used to
fully boot, not just for loading kernel and initial modules.



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


# 338b8dc3 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


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


# 85a53ea2 10-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

The boot loader now has tarfs support needed for booting from CD-ROM.
It expects the zipped TAR at offset 192 kB on the boot image.
This work was mostly done by Ingo during BeGeistert.


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


# 718b5114 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

This should fix the build after all the kernel/system renaming.
If anything is still broken (and was not before :)), please shout.


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


# 5af32e75 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed src/kernel to src/system.


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


# 32832cbe47f991cc6d2b29824903181d8baaaa63 23-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove BPackageKit::BDataOutput

Use BDataIO instead.


# 5c0f8450acfa799aaf13a0e86ba8941212a6bfb3 14-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Boot loader: Add support for choosing an old packages state

For potential boot volumes with older packages states the respective
item in the boot volume menu now has a sub menu for selecting a state.
The boot loader functionality for this feature is complete -- i.e. the
respective kernel is loaded and the name of the old state is added to
the kernel args -- but kernel packagefs and package daemon support is
still missing.


# c04f3a625afa73d870e755e27e1ebdf9ea6c8038 20-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Add safe mode blacklist submenu

It's a browser for the system package content, where entries can be
selected to blacklist them. The selected entries are removed from the
packagefs instance in the boot loader, so that e.g. selected drivers
won't be picked up. The paths are also added to the safe mode driver
settings and will be interpreted when the system packagefs instance is
mounted by the kernel.


# 3a7e0b00147f7a33bc52cb75a56bde8d9652d92a 19-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Support blacklisting entries in packages

In each installation location, it is now possible to create a settings
file "packages" that allows to blacklist entries contained in packages.
The format is:

Package <package name> {
EntryBlacklist {
<entry path>
...
}
}
...

<package name> is the base name (no version) of the respective package
(e.g. "haiku"), <entry path> is an installation location relative path
(e.g. "add-ons/Translators/FooTranslator").

Blacklisted entries will be ignored by packagefs, i.e. they won't appear
in the file system. This addresses the issue that it may be necessary to
remove a problematic file (e.g. driver, add-on, or library), which would
otherwise require editing the containing package file.

The settings file is not not "live". Changes take effect only after
reboot (respectively when remounting the concerned packagefs volume).


# ab313893415e1eaed50e2af3b3517b614ee10e8a 25-Jan-2013 Axel Dörfler <axeld@pinc-software.de>

Implemented write support, reorganized source files.

* Moved some functionality into their own files so that they can easily
be reused by other code.
* Added crc32() function from FreeBSD. Implemented CRC handling and
validation.
* Implemented missing write functionality.


# 61ba12594bf9f447b1384bda0bcd8e4b1e56e315 23-Jan-2013 Axel Dörfler <axeld@pinc-software.de>

Renamed partitioning system "efi" directory to "gpt".


# da80a0500c33176998887bcae22828d9e997477f 02-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Preparation for merge of x86 and x86_64 kernel sources.

Since x86 and x86_64 share a lot of common code, x86_64 kernel sources/headers
are going to reside under headers/private/kernel/arch/x86 and
src/system/kernel/arch/x86 along with the existing x86 code. This commit
changes the build system to handle this. A new variable, TARGET_KERNEL_ARCH,
has been added. This is the name of the kernel/boot architecture directory
name, set to x86 on both x86 and x86_64. This is now used in all places where
TARGET_ARCH was used to get to kernel arch sources/headers (I've changed
everything necessary as far as I can tell). Kernel won't build for x86_64
at the moment as the sources have not been merged, loader does.


# f6a3444449c452a63e0e0d91e8480f39bca81aed 24-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Added x86_64 ELF64 relocation functions for the bootloader. All that's left to do now is handle the 64-bit load address properly.


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

Changed the boot ELF code to use templates and added ELF64 support.

The actual implementation of the ELF loading methods have been put into
an ELFLoader template class that takes a single template parameter, which
is a structure containing all the necessary ELF typedefs. It's a bit
verbose, but I thought it was a neater solution than using a bunch of
standalone functions with a huge number of template parameters. There is
no change to code outside of elf.cpp, the ELF32/ELF64 differences are
handled internally.


# 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.


# 7417d5ed8deef641a6941e5a17a47781b8f8959c 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Made the bootloader search for both kernel_x86 and kernel_x86_64 when built for x86 or x86_64.


# 65ad1ba320d945c9626f471c4fb0972ae49440b5 26-May-2012 Alex Smith <alex@alex-smith.me.uk>

Made it possible to build the bootloader when targetting x86_64.

* x86_64 is using the existing *_ia32 boot platforms.
* Special flags are required when compiling the loader to get GCC to compile
32-bit code. This adds a new set of rules for compiling boot code rather
than using the kernel rules, which compile using the necessary flags.
* Some x86_64 private headers have been stubbed by #include'ing the x86
versions. These will be replaced later.


# 305722379690bb207e9cfd76e8cf8d081bbaa5e9 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add BReferenceable to boot loader

Also force include kernel_cpp.h, so it doesn't have to be included in
every file (still is included in most, though).


# 08e6655afee625a44a411570694d0c2e9a024bbc 05-Nov-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by kaliber (ticket #6333): Removed many instances of
passing an additional -Wall to the compiler, which may actually
have unwanted effects. -Wall is standard by the build system.
Also, -Wno-multichar was passed unnecessarily for Haiku targets.
I didn't remove it for the bfs_shell, hope this is what Ingo meant
in the ticket.


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


# 85db3873a90753e45b82e249fb1030768610c390 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

find_directory.c, driver_settings.c: Converted to C++.


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


# 085cf27b40c06dc45f633f33c41258f32bec3a23 16-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added Directory::CreateFile() which can be implemented by file systems to
support file creation.
* Extended open() and open_from() to support O_CREAT to create files.
open_from() has got an optional "permissions" parameter for that purpose.
* Fixed errno. It would crash when being used. Also changed the POSIX functions
to return their error code via errno as expected.
* Added writev().
* FAT file system:
- Added support for reading long file names.
- Added support for creating files (8.3 name only) and writing to them.
- Enabled scanning partitions with it.
* Boot loader menu:
- Enabled the "Reboot" menu item unconditionally.
- Added "Save syslog from previous session" menu item to the debug menu.
Currently saving the syslog to FAT32 volumes is supported.


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


# 28a2172c3f19a34e31ba20085148e5428544823a 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel:
* The kernel syslog ring buffer is no longer emptied by the syslog sender
thread. Instead we only drop the oldest data from the buffer when we're
writing to it and there's not enough free space in it.
Advantages: We drop old data rather than the most recent data when the buffer
is full. The "syslog" KDL command has more data available now. So the odds
are that kernel syslog messages not written to disk yet are at least still
in the kernel buffer.
* Changed dprintf_no_syslog() semantics: Now it writes to the syslog, but
doesn't notify the syslog sender thread.

boot loader:
* Added the ring_buffer implementation and a dummy user_memcpy().
* bios_x86: Moved the syslog stuff from serial.{cpp,h} to debug.{cpp.h}.
* Moved the debug options from the "Select safe mode options" menu to a new
"Select debug options" menu.
* Added option "Enable debug syslog" to the new menu (ATM available on x86
only). It allocates a 1 MB in-memory buffer for the syslog for this session
in such a way that it can be accessed by the boot loader after a reset.
* Added item "Display syslog from previous session" to the new menu, doing
what its name suggests.


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


# bd185b4117e06c1674c4d214abc3917acedc560d 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

*.c -> *.cpp


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


# 89294b508428bd4575a67bd179bceabce7619c08 26-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added option for enabling serial debug output.
* Moved device_manager/settings.cpp to debug/safemode_settings.cpp.
* Removed the somewhat hacky concatenation of kernel settings and safemode
settings in the boot loader. Instead, get_safemode_option() will now fall
back to the kernel settings, if it couldn't spot a setting in the safemode
settings. This allows for more control, and also makes enabling serial
debug output actually work (ie. overriding the kernel settings via safemode
options).
* Adjusted debug_init_post_vm(), and smp_init_other_cpus() to use
get_safemode_boolean().
* Therefore, I added safemode_settings.cpp to the boot loader as well.


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


# 9e90c30ebdb4c7492c60aee5a55c2f0f0c428ff9 12-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings.
* Removed FAT support from the boot loader for now.


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


# f335531bbc3e489df4eb1c085da3cf7426af0a1f 04-Aug-2009 François Revol <revol@free.fr>

Remove file map disk support by default, it's not used anyway, and we'll use layers for CD anyway. Doesn't spare that many bytes though...


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


# c06e68d0c8c5b60b90063dc646ac5c7d0f7c9873 22-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added partitioning system modules efi_gpt, amiga_rdb, and apple to the image.
* Changed the boot loader to have architecture dependent partition/file system
support. Amiga/Apple partitions, and the AmigaFFS file system are now only
supported on PPC, while EFI GPT, and the FAT file system is now only supported
on x86.


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


# 2cf4975b4b706bcfb741d06d0e8deb8a4783a3f6 15-Oct-2008 François Revol <revol@free.fr>

Add FAT32 support. This allows the bootloader to find a BFS image file (currently named BEOS\IMAGE.BE) and start booting for it, until the kernel tries to mount the boot partition.


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


# 0bdaf028211aaefdd328ecc8713c41ca5098fe7d 09-Aug-2008 François Revol <revol@free.fr>

Start of a file map disk driver for the bootloader.


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


# 6b202f4e3da73d4c131355fcd82b792d153f84f6 13-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced new header directory headers/private/system which is supposed
to contain headers shared by kernel and userland (mainly libroot).
* Moved quite a few private kernel headers to the new location. Split
several kernel headers into a shared part and one that is still kernel
private. Adjusted all affected Jamfiles and source in the standard x86
build accordingly. The build for other architectures and for test code
may be broken.
* Quite a bit of userland code still includes private kernel headers.
Mostly those are <util/*> headers. The ones that aren't strictly
kernel-only should be moved to some other place (maybe
headers/private/shared/util).


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


# 9e8dc2a9bbbe768acdfd224a6a4af01918bb4ce0 14-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

[Sorry, couldn't split this one up any further.]
* Images preloaded by the boot loader had to be modules to be of any use
to the kernel. Extended the mechanism so that any images not accepted
by the module code would later be tried to be added as drivers by the
devfs. This is a little hacky ATM, since the devfs manages the drivers
using a hash map keyed by the drivers inode ID, which those drivers
obviously don't have.
* The devfs emulates read_pages() using read(), if the device driver
doesn't implement the former (all old-style drivers), thus making it
possible to BFS, which uses the file cache which in turn requires
read_pages(), on the device. write_pages() emulation is still missing.
* Replaced the kernel_args::boot_disk structure by a KMessage, which can
more flexibly be extended and deals more gracefully with
arbitrarily-size data. The disk_identifier structure still exists,
though. It is added as message field in cases where needed (non net
boot). Moved the boot_drive_number field of the bios_ia32 platform
specific args into the message.
* Made the stage 1 PXE boot loader superfluous. Moved the relevant
initialization code into the stage 2 loader, which can now be loaded
directly via PXE.
* The PXE boot loader does now download a boot tgz archive via TFTP. It
does no longer use the RemoteDisk protocol (it could actually be
removed from the boot loader). It also parses the DHCP options in the
DHCPACK packet provided by PXE and extracts the root path to be
mounted by the kernel.
* Reorganized the boot volume search in the kernel (vfs_boot.cpp) and
added support for network boot. In this case the net stack is
initialized and the network interface the boot loader used is brought
up and configured. Since NBD and RemoteDisk are our only options for
net boot (and those aren't really configurable dynamically) ATM, the
the boot device is found automatically by the disk device manager.

Booting via PXE does work to some degree now. The most grievous problem
is that loading certain drivers or kernel modules (or related activity)
causes a reboot (likely a triple fault, though one wonders where our
double fault handler is on vacation). Namely the keyboard and mouse input
server add-ons need to be deactivated as well as the media server.
A smaller problem is the net server, which apparently tries to
(re-)configure the network interface we're using to boot, which
obviously doesn't work out that well. So, if all this stuff is disabled
Haiku does fully boot, when using the RemoteDisk protocol (not being
able to use keyboard or mouse doesn't make this a particular fascinating
experience, though ;-)). I had no luck with NBD -- it seemed to have
protocol problems with the servers I tried.


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


# eef8417e272495ca9e026a9298167ed4180a1edb 30-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

* Added (non-working) EFI module to the boot loader and its test application.
* Fixed a warning in efi_gpt.cpp.


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


# 44d5675324128d940518aaf7f2096efe9965db3a 16-Aug-2006 Jérôme Duval <korli@users.berlios.de>

KernelAddon and KernelStaticLibrary don't include kernel, kernel arch, boot platform headers anymore.
Fixed the build of most of targets using these rules. Though the build can be still broken, feel free to fix.


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


# d561d0ad6889135e08b83c18dede8872a75c6d75 27-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a mini networking stack to the boot loader. It speaks basic ARP,
IP, and UDP, as well as a home brewn UDP based protocol, "remote disk",
which provides random access to a single remote file/device. The Open
Firmware flavored boot loader automatically initializes the net stack,
searches for a remote disk, and tries to boot from it, if the boot
device is a network device (e.g. when loading the boot loader via
TFTP).

This is quite nice for developing with a two-machine setup, since one
doesn't even need to install Haiku on the test machine anymore, but can
serve it directly from the development machine. When the networking
support in the kernel is working, this method could even be used to
fully boot, not just for loading kernel and initial modules.



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


# 338b8dc301721b1f472e8297a898d4eaa2f2ee3a 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


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


# 85a53ea28069a930c55299069fc9d893eb2da532 10-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

The boot loader now has tarfs support needed for booting from CD-ROM.
It expects the zipped TAR at offset 192 kB on the boot image.
This work was mostly done by Ingo during BeGeistert.


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


# 718b5114e0613a5602d5d6296afeaa7f3ee4b576 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

This should fix the build after all the kernel/system renaming.
If anything is still broken (and was not before :)), please shout.


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


# 5af32e752606778be5dd7379f319fe43cb3f6b8c 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed src/kernel to src/system.


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