Commit Graph

92 Commits

Author SHA1 Message Date
Axel Dörfler
3c3cc60956 Now has support to load the kernel from the boot device, and to open the
user menu if requested (even if there is none yet). It will also mount
all file systems before the user menu is shown in order to get the right
boot volume - it should probably only call user_menu() if there is more
than one possible boot device.
Removed unused parts that won't be needed anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:23:25 +00:00
Axel Dörfler
6072286af6 Dunno why, but CVS didn't pick that up (see CVS comment in loader.h).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:20:21 +00:00
Axel Dörfler
c948f27797 New BOOT_ARCH definition - this is used to create the kernel name (for
looking it up on the disks); it's set to OBOS_ARCH.
Added the new files menu.cpp and loader.cpp to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:19:16 +00:00
Axel Dörfler
7c198b5d2b Made gDescriptors static, and renamed it to sDescriptors (it's private).
vfs_init() now correctly initializes the gPartitions list, and also creates
the root file system (mount_boot_file_systems() did this before). It now
no longer scans the platform for boot devices.
New function get_boot_file_system() which returns the boot file system as
chosen by the platform code.
mount_file_systems() (former mount_boot_file_systems()) now supports the
boot device; it will not scan all partitions again, but only those different
from the boot file system (if any).
get_node_for_path() did not Acquire() the start directory, but released it
(and its callers didn't acquire it, too).
Removed the commented mount() function, since it won't be needed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:17:15 +00:00
Axel Dörfler
221807be72 Added a new variant of add_partitions_for() which takes a device instead
of a file descriptor as first argument.
add_partitions_for() is now able to only mount file systems if requested;
partitions with unknown contents will not be removed from the list if it
doesn't try to mount them.
Moved the file system mounting code to the new Partition::Mount() method.
Partition::Scan() now only mounts file systems if requested.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:10:56 +00:00
Axel Dörfler
8df661e6f8 Some new "barebones" for enhanced boot loader functions for the user menu
and the kernel/module loading.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:06:52 +00:00
Axel Dörfler
1f0aeec0f0 Implemented the new IsEmpty() method.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:05:27 +00:00
Axel Dörfler
c5ccd40caa It's now silent or more verbose depending on how TRACE_BFS is defined.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-17 01:06:43 +00:00
Axel Dörfler
fd5b021f86 Fixed endian issues - it now does work with big endian BFS disks as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 14:36:40 +00:00
Axel Dörfler
434eb84378 Implemented the missing Directory::Lookup() method, since it's now needed
during path parsing.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 02:34:55 +00:00
Axel Dörfler
09fb7d4bbc Implemented hash functions for DirectoryBlock.
Added HashIterator::InitCheck() method (as the allocation of the buffer
might fail).
Added a HashIterator::Goto() method to jump to the specified index in
the hash (handy for hash lookup).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4707 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 02:33:48 +00:00
Axel Dörfler
479e4ab5cf The Volume now stores the type of the file system (as Type()).
Improved constructor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4706 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 02:31:06 +00:00
Axel Dörfler
101bb5d182 Implemented path parsing, open(), and the new open_from().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 02:29:33 +00:00
Axel Dörfler
36c5179a74 Implemented file reading (only slightly tested, but it should be enough
for our purposes [just copied some files in 1024 byte blocks to the Desktop]).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 00:58:04 +00:00
Axel Dörfler
0f8efd8af0 Removed the ExtensionBlock class - it's now completely managed by the
FileBlock class itself.
Added some data related getter methods.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-16 00:56:01 +00:00
Axel Dörfler
50d9710f0d Implemented an Amiga FFS reader for the boot loader. Can only traverse
directories right now, reading from files is not yet implemented.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4695 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-15 22:10:10 +00:00
Axel Dörfler
86f2640947 get_descriptor() can now also safely be called with a descriptor less
than zero.
Supports now up to 64 file descriptors (just in case).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-15 21:58:03 +00:00
Axel Dörfler
3ad474d024 The main partition can now contain file systems as well (it's no longer
created on the stack, and added to the gPartitions list in that case).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-15 21:55:45 +00:00
Axel Dörfler
25a5c7d03d Moved the class definition back to <boot/partitions.h>, since it's now public
again.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4678 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-14 16:41:19 +00:00
Axel Dörfler
5d2ca15280 Class Partition is now part of <boot/partitions.h>.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-14 16:40:35 +00:00
Axel Dörfler
1cd06a2273 Partition class is now part of <boot/partitions.h>.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4676 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-14 16:39:57 +00:00
Axel Dörfler
1b9d001b66 Changed the get_file_system() call to accept a Partition instead of a Node.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-14 16:39:03 +00:00
Axel Dörfler
6151971100 Implemented scanning the whole device tree for bootable devices (that are
understood by the OpenFirmware).
That makes it work on both, the Pegasos and the PowerMac G4 (any Mac with
OpenFirmware v3 should do, though).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-13 15:48:46 +00:00
Axel Dörfler
2f85616f33 Removed strerror(); it's not available in the boot loader.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4668 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-13 00:59:34 +00:00
Axel Dörfler
687cfec3a8 Forgot to include util/kernel_cpp.h in order to not use exceptions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-13 00:39:14 +00:00
Axel Dörfler
52d257607f Added a very simple realloc() implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-13 00:38:45 +00:00
Axel Dörfler
e3505b15f4 Fully implemented Directory including directory traversing and file lookup.
Also implemented the new GetNextEntry() method.
Added some more constructors for convenience.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:39:09 +00:00
Axel Dörfler
0cc97dd615 Implemented File::GetName() using Stream::GetName().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4656 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:37:22 +00:00
Axel Dörfler
c9fad12dca Added the new BPlusTree.cpp and File.cpp to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:36:36 +00:00
Axel Dörfler
8efb3a26d2 Add a simple Node implementation for BFS files (and everything else that
needs access to the stream directly).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:33:42 +00:00
Axel Dörfler
8565a87552 Added some convenience functions, a method to get the node's name, and
a node factory to get the correct type of node (Directory/File).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:32:21 +00:00
Axel Dörfler
a421161e94 Added another ToOffset() convenience method.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4652 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:28:53 +00:00
Axel Dörfler
1e7e9b1284 Cut down the original BFS BPlusTree implementation to the bare minimum
required to have read-only, single-threaded access to a B+tree.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4651 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:28:12 +00:00
Axel Dörfler
8d86e5a30d Now prints out all devices found, and shows their root directory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:17:45 +00:00
Axel Dörfler
1a5a709876 Implemented the new GetNextEntry() method in the root file system.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:16:39 +00:00
Axel Dörfler
3f2188ad1a Partition::AddChild() created its child with the wrong file descriptor; i.e.
it passed partition_data::volume which used to be the correct descriptor
earlier, but is now unused in the boot loader partition support.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 07:10:45 +00:00
Axel Dörfler
50ab1fac08 Somehow forgot to actually include the Stream class in the last commit...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 02:29:01 +00:00
Axel Dörfler
aec0abfd56 Add a new Stream class that handles reading bytes from an inode (retrieved
from the BFS Stream.h file) - it supports all data stream ranges (direct,
indirect, & double indirect).
Moved bfs_inode::InitCheck() to the new Stream class.
The Directory class now has a Stream object instead of a bfs_inode directly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4639 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 02:28:14 +00:00
Axel Dörfler
c966bfdab7 Started to implement the real BFS module for the boot loader.
Currently, it only recognizes a BFS disk, and will print out its name
(and that code is now endian-aware as well).
More to come, though :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 01:22:40 +00:00
Axel Dörfler
e9117d1507 Put Partition and the new (private) NodeOpener class into the "boot" namespace.
Implemented Partition::Size() and Type() to stat its device.
Partition::ReadAt() and WriteAt() now return B_BAD_VALUE if a position smaller
than zero is provided (as Posix actually states).
Partition::Scan() now provides the partitioning system modules with the correct
file descriptor; it now opens itself (using the NodeOpener class) and no longer
the descriptor of its device directly (resulting in wrong positioning).
Debug output can be turned off now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 01:12:53 +00:00
Axel Dörfler
f150614a3b Node::fRefCount is now 1 after creation, so that a following Acquire()/Release()
pair doesn't delete the object anymore (creation is regarded as an Acquire()
equivalent now).
Moved mount_boot_partitions() and vfs_init().
Debug output can be turned off now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4631 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 01:09:22 +00:00
Axel Dörfler
21d6803233 The class partition is now in the namespace "boot". Now overloads Size()
and Type() as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4630 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-12 01:07:03 +00:00
Axel Dörfler
0ccfc3ca29 Added TRACE() macro to be able to make the loader more silent.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-11 18:58:37 +00:00
Axel Dörfler
9225f27c04 Class Node already had a list_link field, so Partition::fNext was not only
wrong, but also completely senseless :-)
Renamed Partition::NextOffset() to LinkOffset() to honour that change.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-11 18:58:05 +00:00
Axel Dörfler
81b8b661c1 dump_chunk() is now only exported when HEAP_TEST is defined.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-11 17:30:12 +00:00
Axel Dörfler
bd75d5b8cf OpenFirmware handles now report a size of 1024 GB for now - so that the
partition modules won't complain about a disk too small to hold a partition.
Should be fixed, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-11 00:31:21 +00:00
Axel Dörfler
b5711c8173 An empty BFS file system for the boot loader for testing purposes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-09 02:22:37 +00:00
Axel Dörfler
16885aac6f Made the Node base class better to use with files and directories, added
Acquire()/Release() support as well.
New Directory base class.
Added basic support for file systems and the root file system, not yet
fully working (no path parsing yet), and not yet tested.
Implemented fstat().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-09 02:21:58 +00:00
Axel Dörfler
6d43a73b2e The very basic root file system for the boot loader, but should be enough.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-09 02:19:08 +00:00
Axel Dörfler
795b832490 Moved the definition of the Partition class in a separate private header file.
Implemented recursive child content scanning.
Added support for file systems, and the root file system.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-09 02:18:26 +00:00