History log of /haiku/src/system/boot/loader/vfs.cpp
Revision Date Author Comments
# 2532a287 23-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

Avoid using unions for LongDirEntry.

GCC still assumes that the dirent has no data past the end for some
scenarios here and still mis-optimizes things. Therefore, drop the
usages of unions altogether, and instead use a casted character array.

Additionally, use B_FILE_NAME_LENGTH for the array, not B_PATH_NAME_LENGTH,
and make sure to add 1 for the NULL terminator.


# 8f03af00 18-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

Storage: Rework LongDirEntry to be a union.

Our dirent structure is "slim": it has a flexible-length array at the
end which must be allocated to whatever size the consumer wants. However,
we use [1] there and not [0] or [], which meant GCC thought it was not
a flexible-length array, and so it optimized various string accesses
that it assumed must be always false. Among these was BDirectory's
check for "." and "..", and so that resulted in infinite loops.

When changing our dirent structure to a proper FLA instead of [1],
GCC then throws errors on LongDirEntry as it has data "after" the
FLA; which is what we want, but there is no way to tell GCC that.
So now we use a union instead, which is the proper way to statically
allocate a FLA.

This is part of #17389, but the real fix requires changing our dirent
structure, which is coming in a separate commit.


# 6711cd9e 30-Dec-2020 PulkoMandy <pulkomandy@pulkomandy.tk>

bootloader: reduce stack usage

On Sparc Openboot, we get allocated a stack of only 8 kilobytes, and
each called function costs at least 176 bytes for the stack frame.

This means we need to be more careful than usual about stack usage. Move
some large-ish allocations off the stack by either making them static,
or allocated dynamically.

Add a compiler flag to error on functions which use too much stack. The
threshold is at 1023 bytes, because that's what allowed me to find the
two functions that were causing a stack overflow (open_from and
_ParseActivatedPackagesFile)

Change-Id: Ia0d13a9247e1a3fff4ce654bdffd6edb16e7cbc7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2371
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# f1fa58bf 25-Jul-2021 X512 <danger_mail@list.ru>

haiku_loader.efi: update for riscv64

* Added MMU page table generation.
* Added optional FDT device detection and passing to kernel.
* Add platform address translation stubs to bios_ia32
to drop EFI ifdefs

Change-Id: I89257c93c84404fd988f621b29f927ed0df3c3b1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4304
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 62f80a2a 04-Jul-2021 Jessica Hamilton <jessica.l.hamilton@gmail.com>

loader: fetch all potential boot partitions for device

This also keeps the functionality of hrev53848, which simplifies the
list of disks searched for bootable partitions; however, it maintains
the previous behaviour of platform_get_boot_partitions that continues
to iterate over a list of possible boot partitions, which should
allow finding a bootable BFS partition better in more circumstances.

Particularly, there are numerous reports of the UEFI loader entering
the boot menu despite it finding a bootable partition, which this
should address.

EFI's device_contains_partition is also structured such that it
compares the disk GPT table of the partition the loader is
querying of the EFI disk's GPT table, in the case that there are
multiple disks, as the most reliable method of comparison, with
a generic fallback for non-GPT disks, which will be less reliable.

This reverts commit 0d932a49ada8af6314cd3f20c3f597143f1f555d.

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


# fc03b45a 11-Mar-2021 Niels Sascha Reedijk <niels.reedijk@gmail.com>

POSIX: make readv() and writev() conform to IEEE Std 1003.1-2001

The standardized version of readv() and writev() take an int as the third
parameter. Arguably a size_t makes more sense, but the standardization bodies
decided otherwise.

The non-standard functions of readv_pos() and writev_pos() have been updated
for consistency. The corresponding _kern_readv() and _kern_writev() internal
functions continue to take the size_t parameter.

The ABI will not change, even though on 64 bit machines the size of the count
parameter will change from 8 to 4 bytes.

The actual use will be slightly different. Like with the size_t argument type,
it will not be possible to give a count lower than 0. If the value is less than
0, then the B_BAD_VALUE/EINVAL error will be set.

Change-Id: I949c8ed67dbc0b4e209768cbdee554c929fc242e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3770
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 36aafa56 04-Dec-2020 X512 <danger_mail@list.ru>

fix build after CObjectDeleter interface change

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


# 0d932a49 08-Feb-2020 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Revert "loader: fetch all potential boot partitions for boot device."

This reverts commit e888217124fa9fb214ffa790e6a66dca3917f25e.

Change-Id: I06be82ac863f615796d9edc86f5ef903b8123a9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2231
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# e8882171 13-May-2017 Jessica Hamilton <jessica.l.hamilton@gmail.com>

loader: fetch all potential boot partitions for boot device.

This allows the loader to skip BFS partitions that don't contain
a bootable system. Useful when you have a BFS data partition that
comes before the system partition when iterated over.

Currently, only the UEFI loader actually returns more than one
possible partition.


# 35b38c39 06-Jan-2017 Jessica Hamilton <jessica.l.hamilton@gmail.com>

loader: get_boot_file_system() iterate over all devices found.

* This is useful for UEFI, as we can then add the device that
contains the UEFI loader, as well as all CD devices. As a
result, if the device with the UEFI loader doesn't contain
a bootable BFS partition, it will then attempt the same for
CD devices.


# ed1b81b7 17-Sep-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

Boot loader VFS: fix string termination error.

The code was resetting the pointer to NULL, instead of setting the
pointed char to null-terminate the string. The result was resolving the
current directory later on, instead of the parent as requested.

This only happened when calling open_from with O_CREAT, and a name with
sub-directories inside it. The boot loader never does that, so the code
wasn't used until now.

Fixes #12941.

Thanks to mt for spotting the problem.


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


# 01e6d687 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Add pwrite(), lseek(), ftruncate()

ftruncate() is just a stub (needed for BFdIO).


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


# 59ae1c81 14-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Boot loader: Add get_stat(), directory_from()

* Add Node::Stat() and simplify Descriptor::Stat().
* Add get_stat() and directory_from().


# 2f019bd6 01-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Implement subset of <dirent.h> API

* Add opendir(), closedir(), readdir(), rewinddir().
* Add open_directory(), similar to opendir(), but basing the path off a
specified directory.


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


# 63d56be3 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: BootVolume::SetTo(): Fix reference counting

We release the reference for fRootDirectory in Unset() but never
acquired one. Fixes crash when selecting a boot volume in the menu.


# 066d5086 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Support loading haiku-*.hpkg

... i.e. properly canonically named Haiku system packages.


# e1b63b4f 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: mount_file_systems(): Fix warning


# 4b723e3f 06-May-2013 Axel Dörfler <axeld@pinc-software.de>

boot loader: Almost removed use of kernel_cpp.h.

* For some reason that is beyond me, fat/CachedBlock.cpp needs this header,
or else building the boot loader fails.


# 93cb9538 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Don't store a KMessage in kernel_args for the boot volume, only the buffer address/size.

Pointers in kernel_args are going to be changed to unconditionally use 64-bit
storage (to make kernel_args compatible with both the x86 and x86_64 kernels).
KMessage stores a pointer to its buffer, however since KMessage is used
outside of the boot code it is undesirable to change it to use 64-bit storage
for the pointer as it may add additional overhead on 32-bit builds. Therefore,
only store the buffer address and size and then construct a KMessage from
those in the kernel.


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

Add kernel args boot volume "packaged" flag

* Add BOOT_VOLUME_PACKAGED boot volume message field name constant.
* register_boot_file_system():
- Now takes a BootVolume& parameter.
- If the boot volume is packaged, add that info to the boot volume
message.


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

Add boot loader packagefs support

* Add pread().
* Add Node::ReadLink() to read a symbolic link path.
* Add Directory::LookupDontTraverse() and make Lookup() non-abstract.
Lookup() is implemented via LookupDontTraverse() and Node::ReadLink().
* Adjust all FS implementations accordingly.
* Add a packagefs implementation. Unlike other FS implementations it
isn't a pseudo-module, but provides a function to explicitly mount a
package file (packagefs_mount_file()).
* Finish BootVolume::SetTo() implementation, mounting the package file
and replacing fSystemDirectory.

Now the boot loader can load the kernel and boot modules from a packaged
system. The kernel boots up to the point where the boot volume is
mounted.


# 8f583b27 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Build fix


# d11ea2b5 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Introduce BootVolume abstraction class

BootVolume is initialized from a root directory of a volume. It finds
the system directory, and -- not implemented yet -- mounts the system
package, if the system is packaged, replacing the system directory with
it. Adjusted several functionality (main(), the loader functions,
user_menu()) to use BootVolume instead of the root directory.


# 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


# 9da23568 01-Nov-2008 François Revol <revol@free.fr>

Work in progress to pass the image extents to the kernel,
- code is disabled yet as the bootloader doesn't have add_boot_item.. will need to pass via kernel args
- add a GetFileMap() method to the vfs, and implement it in FAT code.


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


# 0dc4d1e5 26-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Reverted r27685, r27676, r27665, and r27664, the changes related to
letting the boot loader provide full paths for the pre-loaded images.


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


# 6aa2c9ec 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Directory stores its parent directory (if any), now.
* Adjusted used files systems accordingly.
* BFS::Stream::GetName() was broken. It accessed the small data region
which wasn't loaded, since BFS::Stream derived from bfs_inode, which
is a variably-sized structure with the small data region at the end.
Changed that to a ref-counted, shared member instead.
* Implemented RootFileSystem::GetName().
* Added Directory::GetPath() to get a full path of the directory or an
entry.


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


# d0c63aaf 27-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings due to the NULL change.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24608 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


# 82029bda 16-Sep-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added missing nothrow parameter


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


# ecdaf9de 27-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* The boot loader now adds all block devices in case the BIOS doesn't give enough
information to identify the boot volume - if we want to be able to map all BIOS
drive IDs to the disks in the system, we need to do this always, though.
* Forgot to commit the updated disk_identifier.h in the last commit...
* Removed the unused dumpBlock() function from devices.cpp.


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


# e3fcb58e 14-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

The boot loader now has special support for being booted from a boot image
like floppy or CD boot.
This allows it to reduce the number of scans needed to identify the boot
partition - when booted from a real floppy, this speeds up the boot
process by a magnitude.
Also, the loader now has a fall back in case there were no "boot" links
on the disk - the current boot floppy script doesn't create them.
With these changes, I was able to boot into a HD based Haiku installation
from a floppy disk. It's not yet enough to boot from CD (as the boot
device selection is a bit too simplistic right now), but it will eventually
come next. Testing is a lot slower here, though, as neither qemu nor
Bochs support multi-session CDs (at least I have no idea how to get them
to do this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14380 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


# 01e6d687c03d9148783a67a53789e5e96f617a5a 12-Jul-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Add pwrite(), lseek(), ftruncate()

ftruncate() is just a stub (needed for BFdIO).


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


# 59ae1c816d8e64dd22f3ec51fe4f79ac077ea171 14-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Boot loader: Add get_stat(), directory_from()

* Add Node::Stat() and simplify Descriptor::Stat().
* Add get_stat() and directory_from().


# 2f019bd6cae99b4633b21b40565a93517323b1b8 01-Apr-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Implement subset of <dirent.h> API

* Add opendir(), closedir(), readdir(), rewinddir().
* Add open_directory(), similar to opendir(), but basing the path off a
specified directory.


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


# 63d56be3d9572991b7a4ede8feab69c4b4de5152 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: BootVolume::SetTo(): Fix reference counting

We release the reference for fRootDirectory in Unset() but never
acquired one. Fixes crash when selecting a boot volume in the menu.


# 066d508682dd3028eb9b971974b913990811d3a1 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Support loading haiku-*.hpkg

... i.e. properly canonically named Haiku system packages.


# e1b63b4fb869c7128e7da11d76ab0bb8acc58b94 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: mount_file_systems(): Fix warning


# 4b723e3fb86ecc8027728c6c26d782964419f573 06-May-2013 Axel Dörfler <axeld@pinc-software.de>

boot loader: Almost removed use of kernel_cpp.h.

* For some reason that is beyond me, fat/CachedBlock.cpp needs this header,
or else building the boot loader fails.


# 93cb9538be54a2dd4ab6097453ac7d521a9a0b6c 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Don't store a KMessage in kernel_args for the boot volume, only the buffer address/size.

Pointers in kernel_args are going to be changed to unconditionally use 64-bit
storage (to make kernel_args compatible with both the x86 and x86_64 kernels).
KMessage stores a pointer to its buffer, however since KMessage is used
outside of the boot code it is undesirable to change it to use 64-bit storage
for the pointer as it may add additional overhead on 32-bit builds. Therefore,
only store the buffer address and size and then construct a KMessage from
those in the kernel.


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

Add kernel args boot volume "packaged" flag

* Add BOOT_VOLUME_PACKAGED boot volume message field name constant.
* register_boot_file_system():
- Now takes a BootVolume& parameter.
- If the boot volume is packaged, add that info to the boot volume
message.


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

Add boot loader packagefs support

* Add pread().
* Add Node::ReadLink() to read a symbolic link path.
* Add Directory::LookupDontTraverse() and make Lookup() non-abstract.
Lookup() is implemented via LookupDontTraverse() and Node::ReadLink().
* Adjust all FS implementations accordingly.
* Add a packagefs implementation. Unlike other FS implementations it
isn't a pseudo-module, but provides a function to explicitly mount a
package file (packagefs_mount_file()).
* Finish BootVolume::SetTo() implementation, mounting the package file
and replacing fSystemDirectory.

Now the boot loader can load the kernel and boot modules from a packaged
system. The kernel boots up to the point where the boot volume is
mounted.


# 8f583b27712d4c742f7d0f1123d968b8e8b868df 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Build fix


# d11ea2b5edf78d1018b1149a57a593af50687920 17-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Introduce BootVolume abstraction class

BootVolume is initialized from a root directory of a volume. It finds
the system directory, and -- not implemented yet -- mounts the system
package, if the system is packaged, replacing the system directory with
it. Adjusted several functionality (main(), the loader functions,
user_menu()) to use BootVolume instead of the root directory.


# 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


# 9da2356857a48ac7e27b325ba3f69aef9b79dddd 01-Nov-2008 François Revol <revol@free.fr>

Work in progress to pass the image extents to the kernel,
- code is disabled yet as the bootloader doesn't have add_boot_item.. will need to pass via kernel args
- add a GetFileMap() method to the vfs, and implement it in FAT code.


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


# 0dc4d1e5ca08e5fe65c04f40f2628c29a9f4b5e0 26-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Reverted r27685, r27676, r27665, and r27664, the changes related to
letting the boot loader provide full paths for the pre-loaded images.


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


# 6aa2c9ecf151dae2111df60a737ceb266fd18002 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Directory stores its parent directory (if any), now.
* Adjusted used files systems accordingly.
* BFS::Stream::GetName() was broken. It accessed the small data region
which wasn't loaded, since BFS::Stream derived from bfs_inode, which
is a variably-sized structure with the small data region at the end.
Changed that to a ref-counted, shared member instead.
* Implemented RootFileSystem::GetName().
* Added Directory::GetPath() to get a full path of the directory or an
entry.


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


# d0c63aafc22be8e5e95683ef931a15dca778343b 27-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings due to the NULL change.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24608 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


# 82029bdae870b0e257a54929116ddfb6da9efdca 16-Sep-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added missing nothrow parameter


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


# ecdaf9dea851ba14d3d282656258949f7c90dc96 27-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* The boot loader now adds all block devices in case the BIOS doesn't give enough
information to identify the boot volume - if we want to be able to map all BIOS
drive IDs to the disks in the system, we need to do this always, though.
* Forgot to commit the updated disk_identifier.h in the last commit...
* Removed the unused dumpBlock() function from devices.cpp.


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


# e3fcb58ebb7497340ed016d1a5ac4d4f13564d90 14-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

The boot loader now has special support for being booted from a boot image
like floppy or CD boot.
This allows it to reduce the number of scans needed to identify the boot
partition - when booted from a real floppy, this speeds up the boot
process by a magnitude.
Also, the loader now has a fall back in case there were no "boot" links
on the disk - the current boot floppy script doesn't create them.
With these changes, I was able to boot into a HD based Haiku installation
from a floppy disk. It's not yet enough to boot from CD (as the boot
device selection is a bit too simplistic right now), but it will eventually
come next. Testing is a lot slower here, though, as neither qemu nor
Bochs support multi-session CDs (at least I have no idea how to get them
to do this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14380 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