History log of /haiku-fatelf/src/system/kernel/fs/vfs_boot.cpp
Revision Date Author Comments
# d7ec2fa3 20-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

A couple of format string fixes for tracing printfs.


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

Code style fixes.


# 5915eeb4 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Some improvements to the previous changes made to vfs_boot.cpp suggested by Ingo.


# d8efc6ca 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changes to kernel_args to make it identical for x86 and x86_64.

* Added a FixedWidthPointer template class which uses 64-bit storage to hold
a pointer. This is used in place of raw pointers in kernel_args.
* Added __attribute__((packed)) to kernel_args and all structures contained
within it. This is necessary due to different alignment behaviour for
32-bit and 64-bit compilation with GCC.
* With these changes, kernel_args will now come out the same size for both
the x86_64 kernel and the loader, excluding the preloaded_image structure
which has not yet been changed.
* Tested both an x86 GCC2 and GCC4 build, no problems caused by these changes.


# 192af9e0 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changed addr_range to use uint64.

I've tested this change on x86, causing no issues. I've checked over the code
for all other platforms and made the necessary changes and to the best of my
knowledge they should also still work, but I haven't actually built and
tested them. Once I've completed the kernel_args changes the other platforms
will need testing.


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


# 4be4fc6b 15-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

More 64-bit compilation/safety fixes.


# bde19722 10-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move <directories.h> to headers/private/system


# 323b6546 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 63fe660c 21-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced a few hardcoded partitioning/file system type names by the
respective constants.
* compare_image_boot(): Compare volume names case insensitively.
* DiskBootMethod::IsBootDevice(): For BOOT_METHOD_CD only accept devices with
removable media.
* DiskBootMethod::IsBootPartition(): Added special recognition for anyboot
CDs. Since their partition types aren't kPartitionTypeDataSession,
compare_cd_boot() didn't prefer them and it was more or less random whether
it was chosen when other Haiku installations where available. Moreover
selecting the CD in the boot loader menu would cause the kernel not to find
it.


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


# 29ddbdbb 16-Jan-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved the "var" directory to /boot/common/.
* Moved the "tmp" directory out of /var, and to /boot/common/cache/.


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


# 492dd892 10-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed /system/etc directory.
* /etc now points to /boot/common/etc/, and the remaining contents of the former
"etc" are put there now, as well.


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


# 1dd63455 06-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

If the boot volume is BFS and read-only mount it with the write_overlay. This
allows for BFS based LiveCDs. Still this whole name matching feels hacky.


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


# c39811b8 18-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed stupid typo with big consequences as pointed out by Rene. Thanks!


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


# 477a4ca7 05-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* vfs_boot.cpp now also exports gReadOnlyBootDevice which is true when the
boot device is actually read-only (even if it's using the write overlay).
* Do not create a swap file on a read-only device - this would really be a
stupid use of the write overlay (just saw this happening on an older
machine).
* Made swap_file_{add|delete}() take a const char* path - there was no reason
this was writable, and this also avoids casting away the const when adding
the default swap file.
* Minor cleanup.


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


# 317bd7dd 03-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed directory structure as suggested on the mailing list.
* Made the TimeZoneView less error prone, and also actually use Haiku code (the
previous check didn't work since it used #if, not #ifdef).
* Also took the liberty to rename our boot loader to haiku_loader, since I had
to update the nasm binary anyway. Updated the assembly sources to nasm 2.0.
* I haven't found where the synth location in the MIDI code is specified,
though.
* Also, NetBootArchive, and FloppyBootImage haven't been updated yet. Will do
so next.
* Some optional packages still put their license to beos/etc/licenses. I didn't
update them yet, as we'll probably do so anyway at some point. Also, I think
we might want to introduce a common/data/licenses instead for those.
* If you encounter any problems, please tell!


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


# c41ac5b0 19-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Remove the original overlay filesystem.
* Add attribute_overlay and write_overlay to the image/floppy instead.
* Mount a iso9660 boot volume with both write and attribute overlay for now.


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


# bea22f62 14-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Add overlay filesystem to the boot floppy and normal image.
* When booting from an iso, mount the boot volume with the overlay layer.


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


# a079780e 13-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Add the iso9660 filesystem to the floppy image.
* Allow iso9660 partitions to be boot partitions.


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


# 6075e354 26-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Call module_init_post_boot_device() right after the boot volume has
been mounted, before anyone could try to load any modules from it.
Also pass it a flag whether the boot volume is where the boot loader
pre-loaded the modules from.
* module_init_post_boot_device() changes the pre-loaded module image
paths to normalized boot volume paths, now. Got rid of the code in
register_preloaded_module_image() which tried something like this.
* Changed module image ref counting. A referenced module has single
reference to its image, which is released when the module becomes
unreferenced.
* get_module() for a reference module will not try to re-get and re-set
the module's image anymore. That could lead to a similar module (from
different paths) being loaded at the same time. A module from a new
file can only be loaded when the old one has been put completely.
* Simplified B_KEEP_ALIVE module handling a bit. When the module is
initialized, we add another reference, which we'll never free. Thus
the module remains loaded without special handling. Removed
module_image::keep_loaded. A B_KEEP_ALIVE module remains referenced
and thus its image remains referenced, too.
* Removed module::file, a cached path to the module's image. An
optimization that wouldn't work with multiple root directories for
modules (/boot/beos/..., /boot/common/...) or when module files were
moved. get_module() does now always search the image file, when the
module is still unreferenced. This should be a bit slower than before,
but I didn't notice any difference in VMware at least. If it turns out
to be a problem we could introduce a more intelligent cache that stays
up to date by using node monitoring.


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


# a1209343 10-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Moved KMessage field printing from vfs_boot.cpp::get_boot_partitions() into
KMessage::Dump().
* Improved message dump output a bit (more concise).
* get_boot_partitions() now simply calls KMessage::Dump() instead.
* Added a KMessage::IsEmpty() method.


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


# 6e36a49e 05-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added _kern_create_pipe() syscall, creating a pipe as an entryless
FIFO. Reimplemented pipe() to use it.
* pipefs is no longer mounted. Will remove the superfluous code soon.


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


# 06da81f0 03-Apr-2008 Michael Lotz <mmlr@mlotz.ch>

Implement node monitoring in the kernel disk device manager.

* Added {Create|Delete}Device() analogous to {Create|Delete}FileDevice
* Added a small DeviceWatcher class that reacts to entry creation/removal
* Implemented a way to start/stop node monitoring
* Start watching for devices after the boot volume has been mounted and the
the second initial scan was run

The disk device manager now creates and scans a device when a "raw" node is
published and deletes the device on removal. This makes hot-plugging of disk
devices (for example memory sticks using usb_disk) work. Their partitions will
be scanned and published so they can be mounted. Somehow the removal of the
partitions does not yet work however, any insights are welcome.

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


# 51877273 26-Dec-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

dump all found devices and partitions to serial debug output


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


# fe679b9f 19-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

axeld+bonefish:
* Refactored RescanDiskSystems(). Pulled out a function
_RescanDiskSystems() that scans for either file or partitioning
systems. RescanDiskSystems(), which scanned for file systems only
before, is used from the constructor as well (open_module_list()
works in the early boot process since a while).
* Made InitialDeviceScan() and partition scanning safe to be called a second
time. We call it directly after the kernel has mounted the boot
volume, now, so that additional disk systems from the boot volume have a
chance to recognize previously unrecognized partitions. This is a
temporary change only; later the disk device manager shall
automatically find out when new disk systems/devices/whatever are
available.


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


# 1fa400cd 16-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

The partition offset is int64, of course, not bool. Sometimes one wishes,
C++ had a stricter typing.


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


# 3a199128 15-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

* Now checks if the BootMethod allocation succeeds.
* Minor cleanup, reordered header files to go from private/local to public/global.


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


# 43792b9e 12-Jan-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

propagate required settings for the remote disk from boot loader to kernel (client-ip, server-ip, server-port)


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


# f5fa54f7 12-Jan-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Improved error reporting when a failure to find/mount the root device occurs.


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


# 4c3702d4 04-Sep-2006 Jérôme Duval <korli@users.berlios.de>

moved rescan call to vfs_mount_boot_file_system() as suggested by axeld :)


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


# 65bd831c 05-May-2006 Axel Dörfler <axeld@pinc-software.de>

* KDiskDeviceManager::_ScanPartition() can now run synchronously (and execute the
scan job in the calling thread).
* KDiskDeviceManager::InitialDeviceScan() now runs synchronously, so that
get_boot_partitions() doesn't need to do this ugly wait hack.
* KDiskDeviceManager::CreateFileDevice() can now run synchronously as well, which
fixes a deadlock in fs_mount() - note, mounting file devices still doesn't work,
though as Haiku's BFS doesn't allow this right now.


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


# 2a62d0d6 28-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Added a second pass to the boot device retrieval in case nothing has been found.
Right now, the size of the device is ignored in the second pass. Maybe this helps
with bug #357.


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


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

The kernel boot code now supports the unknown bus/device method to identify the
boot volume. The other (better) methods are now disabled in the boot loader.
This fixes bug #241.


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


# 5a2ad00c 20-Feb-2006 Jérôme Duval <korli@users.berlios.de>

fix a TODO in _user_mount : added an argsLength parameter


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


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

Removed "bootfs" and the support for it in other components.


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


# 888248d4 24-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

The kernel now panics if it didn't found any possible boot partitions.


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


# 3ea780cd 18-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

If booted from an image, the list of possible boot partitions is now ordered by
some heuristic: when you booted from a CD, CDs are preferred; else, volumes with
names like "Haiku" or "System" are preferred - if someone has better ideas, please
shout.
Note, this heuristic will only come into play if the boot loader was loaded from
an image (ie. floppy/CD/network), and you didn't choose any boot device.
Added evil methods to the Stack class that come in handy (you can now directly
access the array) for this.


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


# 2db3fced 17-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

Moved vfs_bootstrap_file_systems() and vfs_mount_boot_file_system() out of vfs.cpp
and into its own file vfs_boot.cpp.

Added basic support for booting from CD - it doesn't give CDs a higher priority,
so you could end up booting from HD when you didn't explicetly select "CD-ROM"
in the boot loader. Eventually, it should only boot from HD in this case, if
booting from CD failed (because of a missing boot partition or whatever).

fs_mount(), _kern_mount(), and _user_mount() will now return the dev_t of the
mounted device, and not just B_OK. Maybe we should have fs_unmount() work on
a dev_t instead of a path as well...


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


# d7ec2fa3bfda5ba1674e97528fba2f4cfec00144 20-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

A couple of format string fixes for tracing printfs.


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

Code style fixes.


# 5915eeb461026dabc5e2ccd61b650cd7fc0e40a7 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Some improvements to the previous changes made to vfs_boot.cpp suggested by Ingo.


# d8efc6caf6babe278c48e8aa3277376fb68ff455 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changes to kernel_args to make it identical for x86 and x86_64.

* Added a FixedWidthPointer template class which uses 64-bit storage to hold
a pointer. This is used in place of raw pointers in kernel_args.
* Added __attribute__((packed)) to kernel_args and all structures contained
within it. This is necessary due to different alignment behaviour for
32-bit and 64-bit compilation with GCC.
* With these changes, kernel_args will now come out the same size for both
the x86_64 kernel and the loader, excluding the preloaded_image structure
which has not yet been changed.
* Tested both an x86 GCC2 and GCC4 build, no problems caused by these changes.


# 192af9e0afd2f3d0cbaf5c935480343a70c8ff53 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changed addr_range to use uint64.

I've tested this change on x86, causing no issues. I've checked over the code
for all other platforms and made the necessary changes and to the best of my
knowledge they should also still work, but I haven't actually built and
tested them. Once I've completed the kernel_args changes the other platforms
will need testing.


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


# 4be4fc6b1faddbd037146214a0011d320842b4f3 15-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

More 64-bit compilation/safety fixes.


# bde197222943d6f975a0d82dbfe263ffcc1834ba 10-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move <directories.h> to headers/private/system


# 323b65468e5836bb27a5e373b14027d902349437 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 63fe660c1bf8ba22be3e0e251108a2512c0fc8b3 21-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced a few hardcoded partitioning/file system type names by the
respective constants.
* compare_image_boot(): Compare volume names case insensitively.
* DiskBootMethod::IsBootDevice(): For BOOT_METHOD_CD only accept devices with
removable media.
* DiskBootMethod::IsBootPartition(): Added special recognition for anyboot
CDs. Since their partition types aren't kPartitionTypeDataSession,
compare_cd_boot() didn't prefer them and it was more or less random whether
it was chosen when other Haiku installations where available. Moreover
selecting the CD in the boot loader menu would cause the kernel not to find
it.


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


# 29ddbdbb53af79445de933b590598e4342a34ae9 16-Jan-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved the "var" directory to /boot/common/.
* Moved the "tmp" directory out of /var, and to /boot/common/cache/.


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


# 492dd892ce90cc1dc4916eb54b656f04cc480ee6 10-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed /system/etc directory.
* /etc now points to /boot/common/etc/, and the remaining contents of the former
"etc" are put there now, as well.


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


# 1dd6345561db3086c54b4cd0f8b8ba69abdb5f10 06-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

If the boot volume is BFS and read-only mount it with the write_overlay. This
allows for BFS based LiveCDs. Still this whole name matching feels hacky.


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


# c39811b8b3ee653affa785867dc51d2cff64fb40 18-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed stupid typo with big consequences as pointed out by Rene. Thanks!


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


# 477a4ca70ef1e6947178e35c639e16d4c7298f32 05-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* vfs_boot.cpp now also exports gReadOnlyBootDevice which is true when the
boot device is actually read-only (even if it's using the write overlay).
* Do not create a swap file on a read-only device - this would really be a
stupid use of the write overlay (just saw this happening on an older
machine).
* Made swap_file_{add|delete}() take a const char* path - there was no reason
this was writable, and this also avoids casting away the const when adding
the default swap file.
* Minor cleanup.


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


# 317bd7dda3eb26d4d24ba5b0a831461119f70d34 03-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed directory structure as suggested on the mailing list.
* Made the TimeZoneView less error prone, and also actually use Haiku code (the
previous check didn't work since it used #if, not #ifdef).
* Also took the liberty to rename our boot loader to haiku_loader, since I had
to update the nasm binary anyway. Updated the assembly sources to nasm 2.0.
* I haven't found where the synth location in the MIDI code is specified,
though.
* Also, NetBootArchive, and FloppyBootImage haven't been updated yet. Will do
so next.
* Some optional packages still put their license to beos/etc/licenses. I didn't
update them yet, as we'll probably do so anyway at some point. Also, I think
we might want to introduce a common/data/licenses instead for those.
* If you encounter any problems, please tell!


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


# c41ac5b0e1433d84f8519d0c62f8d438f50a80a8 19-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Remove the original overlay filesystem.
* Add attribute_overlay and write_overlay to the image/floppy instead.
* Mount a iso9660 boot volume with both write and attribute overlay for now.


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


# bea22f624015d11d59d3b93d76358e035ccc013a 14-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Add overlay filesystem to the boot floppy and normal image.
* When booting from an iso, mount the boot volume with the overlay layer.


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


# a079780e8a83240e16484ed42103234dd2994a03 13-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Add the iso9660 filesystem to the floppy image.
* Allow iso9660 partitions to be boot partitions.


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


# 6075e354abea9c571e3e74ecdc56662de736c4eb 26-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Call module_init_post_boot_device() right after the boot volume has
been mounted, before anyone could try to load any modules from it.
Also pass it a flag whether the boot volume is where the boot loader
pre-loaded the modules from.
* module_init_post_boot_device() changes the pre-loaded module image
paths to normalized boot volume paths, now. Got rid of the code in
register_preloaded_module_image() which tried something like this.
* Changed module image ref counting. A referenced module has single
reference to its image, which is released when the module becomes
unreferenced.
* get_module() for a reference module will not try to re-get and re-set
the module's image anymore. That could lead to a similar module (from
different paths) being loaded at the same time. A module from a new
file can only be loaded when the old one has been put completely.
* Simplified B_KEEP_ALIVE module handling a bit. When the module is
initialized, we add another reference, which we'll never free. Thus
the module remains loaded without special handling. Removed
module_image::keep_loaded. A B_KEEP_ALIVE module remains referenced
and thus its image remains referenced, too.
* Removed module::file, a cached path to the module's image. An
optimization that wouldn't work with multiple root directories for
modules (/boot/beos/..., /boot/common/...) or when module files were
moved. get_module() does now always search the image file, when the
module is still unreferenced. This should be a bit slower than before,
but I didn't notice any difference in VMware at least. If it turns out
to be a problem we could introduce a more intelligent cache that stays
up to date by using node monitoring.


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


# a1209343884e1b6d0c1bfa79c30e40fdc52bd28b 10-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Moved KMessage field printing from vfs_boot.cpp::get_boot_partitions() into
KMessage::Dump().
* Improved message dump output a bit (more concise).
* get_boot_partitions() now simply calls KMessage::Dump() instead.
* Added a KMessage::IsEmpty() method.


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


# 6e36a49e62cbad57eb5c88dd1a16ca39be3f4e3f 05-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added _kern_create_pipe() syscall, creating a pipe as an entryless
FIFO. Reimplemented pipe() to use it.
* pipefs is no longer mounted. Will remove the superfluous code soon.


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


# 06da81f012843e3aec1bba94dcd5ac837492cafb 03-Apr-2008 Michael Lotz <mmlr@mlotz.ch>

Implement node monitoring in the kernel disk device manager.

* Added {Create|Delete}Device() analogous to {Create|Delete}FileDevice
* Added a small DeviceWatcher class that reacts to entry creation/removal
* Implemented a way to start/stop node monitoring
* Start watching for devices after the boot volume has been mounted and the
the second initial scan was run

The disk device manager now creates and scans a device when a "raw" node is
published and deletes the device on removal. This makes hot-plugging of disk
devices (for example memory sticks using usb_disk) work. Their partitions will
be scanned and published so they can be mounted. Somehow the removal of the
partitions does not yet work however, any insights are welcome.

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


# 518772739f9ef939beff1df7555c8b91c8caf46d 26-Dec-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

dump all found devices and partitions to serial debug output


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


# fe679b9fa7210f8c0622ff33f723d87d8f8732ad 19-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

axeld+bonefish:
* Refactored RescanDiskSystems(). Pulled out a function
_RescanDiskSystems() that scans for either file or partitioning
systems. RescanDiskSystems(), which scanned for file systems only
before, is used from the constructor as well (open_module_list()
works in the early boot process since a while).
* Made InitialDeviceScan() and partition scanning safe to be called a second
time. We call it directly after the kernel has mounted the boot
volume, now, so that additional disk systems from the boot volume have a
chance to recognize previously unrecognized partitions. This is a
temporary change only; later the disk device manager shall
automatically find out when new disk systems/devices/whatever are
available.


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


# 1fa400cd92c55cabc1ef95012068c31b183dae89 16-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

The partition offset is int64, of course, not bool. Sometimes one wishes,
C++ had a stricter typing.


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


# 3a199128dee9d321474ed44a856f2b47dd413ef1 15-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

* Now checks if the BootMethod allocation succeeds.
* Minor cleanup, reordered header files to go from private/local to public/global.


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


# 43792b9eeda5ba6d5fc57b0779537681a022cfeb 12-Jan-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

propagate required settings for the remote disk from boot loader to kernel (client-ip, server-ip, server-port)


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


# f5fa54f79828b9fdf292f3c4c67db108e9f1c420 12-Jan-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Improved error reporting when a failure to find/mount the root device occurs.


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


# 4c3702d42a79c7b69c5e2fcae190196380dfb034 04-Sep-2006 Jérôme Duval <korli@users.berlios.de>

moved rescan call to vfs_mount_boot_file_system() as suggested by axeld :)


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


# 65bd831cbbb39791cefba28f9a343cbe0c7210fe 05-May-2006 Axel Dörfler <axeld@pinc-software.de>

* KDiskDeviceManager::_ScanPartition() can now run synchronously (and execute the
scan job in the calling thread).
* KDiskDeviceManager::InitialDeviceScan() now runs synchronously, so that
get_boot_partitions() doesn't need to do this ugly wait hack.
* KDiskDeviceManager::CreateFileDevice() can now run synchronously as well, which
fixes a deadlock in fs_mount() - note, mounting file devices still doesn't work,
though as Haiku's BFS doesn't allow this right now.


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


# 2a62d0d6c5cb472a842c959adf3bef1ebc0d89fb 28-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Added a second pass to the boot device retrieval in case nothing has been found.
Right now, the size of the device is ignored in the second pass. Maybe this helps
with bug #357.


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


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

The kernel boot code now supports the unknown bus/device method to identify the
boot volume. The other (better) methods are now disabled in the boot loader.
This fixes bug #241.


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


# 5a2ad00cab1adde7fe59540ca5ef692c7e83b3a3 20-Feb-2006 Jérôme Duval <korli@users.berlios.de>

fix a TODO in _user_mount : added an argsLength parameter


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


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

Removed "bootfs" and the support for it in other components.


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


# 888248d42e6550917e46799b8f84c7fcf070e97e 24-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

The kernel now panics if it didn't found any possible boot partitions.


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


# 3ea780cdf9eb1d20ab301d305d5064443e51fc14 18-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

If booted from an image, the list of possible boot partitions is now ordered by
some heuristic: when you booted from a CD, CDs are preferred; else, volumes with
names like "Haiku" or "System" are preferred - if someone has better ideas, please
shout.
Note, this heuristic will only come into play if the boot loader was loaded from
an image (ie. floppy/CD/network), and you didn't choose any boot device.
Added evil methods to the Stack class that come in handy (you can now directly
access the array) for this.


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


# 2db3fced5f119bb3f7c8b8a3ac3fe60190f76e6c 17-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

Moved vfs_bootstrap_file_systems() and vfs_mount_boot_file_system() out of vfs.cpp
and into its own file vfs_boot.cpp.

Added basic support for booting from CD - it doesn't give CDs a higher priority,
so you could end up booting from HD when you didn't explicetly select "CD-ROM"
in the boot loader. Eventually, it should only boot from HD in this case, if
booting from CD failed (because of a missing boot partition or whatever).

fs_mount(), _kern_mount(), and _user_mount() will now return the dev_t of the
mounted device, and not just B_OK. Maybe we should have fs_unmount() work on
a dev_t instead of a path as well...


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