register_boot_file_system() now also fills in the kernel_args data about

the boot partition, and calls platform_register_boot_device() for the
rest.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9961 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-11-15 18:06:47 +00:00
parent 925f2cab6a
commit 04b9d56a03

View File

@ -1,7 +1,7 @@
/*
** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the Haiku License.
*/
* Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#include "RootFileSystem.h"
@ -11,6 +11,7 @@
#include <boot/platform.h>
#include <boot/partitions.h>
#include <boot/stdio.h>
#include <boot/stage2.h>
#include <util/kernel_cpp.h>
#include <unistd.h>
@ -295,10 +296,27 @@ vfs_init(stage2_args *args)
}
void
status_t
register_boot_file_system(Directory *volume)
{
gRoot->AddLink("boot", volume);
Partition *partition;
status_t status = gRoot->GetPartitionFor(volume, &partition);
if (status != B_OK) {
dprintf("register_boot_file_system(): could not locate boot volume in root!\n");
return status;
}
gKernelArgs.boot_disk.partition_offset = partition->offset;
Node *device = get_node_from(partition->FD());
if (device == NULL) {
dprintf("register_boot_file_system(): could not get boot device!\n");
return B_ERROR;
}
return platform_register_boot_device(device);
}