Some unfinished work-in-progress.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11727 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f8f38c4c4b
commit
4a3b7efb91
12
src/kernel/boot/loader/file_systems/hfs_plus/Jamfile
Normal file
12
src/kernel/boot/loader/file_systems/hfs_plus/Jamfile
Normal file
@ -0,0 +1,12 @@
|
||||
SubDir OBOS_TOP src kernel boot loader file_systems hfs_plus ;
|
||||
|
||||
UsePrivateHeaders [ FDirName kernel boot platform $(OBOS_BOOT_PLATFORM) ] ;
|
||||
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
||||
UsePrivateHeaders [ FDirName storage ] ;
|
||||
|
||||
SubDirC++Flags -fno-rtti ;
|
||||
|
||||
KernelStaticLibrary boot_hfs_plus :
|
||||
hfs_plus.cpp
|
||||
: -fno-pic
|
||||
;
|
60
src/kernel/boot/loader/file_systems/hfs_plus/hfs_plus.cpp
Normal file
60
src/kernel/boot/loader/file_systems/hfs_plus/hfs_plus.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "hfs_plus.h"
|
||||
|
||||
#include <boot/partitions.h>
|
||||
#include <boot/platform.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
using namespace HFSPlus;
|
||||
|
||||
#if 0
|
||||
status_t
|
||||
HFSPlus::get_root_block(int fDevice, char *buffer, int32 blockSize, off_t partitionSize)
|
||||
{
|
||||
hfs_volume_header header;
|
||||
if (read_pos(fDevice, 1024, &header, sizeof(header)) < B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
static status_t
|
||||
hfs_plus_get_file_system(boot::Partition *partition, ::Directory **_root)
|
||||
{
|
||||
/* Volume *volume = new Volume(partition);
|
||||
if (volume == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
if (volume->InitCheck() < B_OK) {
|
||||
delete volume;
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
*_root = volume->Root();
|
||||
*/ return B_OK;
|
||||
}
|
||||
|
||||
|
||||
file_system_module_info gAmigaFFSFileSystemModule = {
|
||||
"file_systems/hfs_plus/v1",
|
||||
kPartitionTypeHFSPlus,
|
||||
hfs_plus_get_file_system
|
||||
};
|
||||
|
69
src/kernel/boot/loader/file_systems/hfs_plus/hfs_plus.h
Normal file
69
src/kernel/boot/loader/file_systems/hfs_plus/hfs_plus.h
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef HFS_PLUS_H
|
||||
#define HFS_PLUS_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
namespace HFSPlus {
|
||||
|
||||
struct hfs_extent_descriptor {
|
||||
uint32 start_block;
|
||||
uint32 block_count;
|
||||
};
|
||||
|
||||
typedef hfs_extent_descriptor hfs_extent_record[8];
|
||||
|
||||
struct hfs_fork_data {
|
||||
uint64 logical_size;
|
||||
uint32 clump_size;
|
||||
uint32 total_blocks;
|
||||
hfs_extent_record extents;
|
||||
};
|
||||
|
||||
|
||||
#define HFS_VOLUME_SIGNATURE 'H+'
|
||||
|
||||
struct hfs_volume_header {
|
||||
uint16 signature;
|
||||
uint16 version;
|
||||
uint32 attributes;
|
||||
uint32 last_mounted_version;
|
||||
uint32 journal_info_block;
|
||||
|
||||
uint32 creation_date;
|
||||
uint32 modification_date;
|
||||
uint32 backup_date;
|
||||
uint32 checked_date;
|
||||
|
||||
uint32 file_count;
|
||||
uint32 folder_count;
|
||||
|
||||
uint32 block_size;
|
||||
uint32 total_blocks;
|
||||
uint32 free_blocks;
|
||||
|
||||
uint32 next_allocation;
|
||||
uint32 resource_clump_size;
|
||||
uint32 data_clump_size;
|
||||
uint32 next_catalog_id;
|
||||
|
||||
uint32 write_count;
|
||||
uint64 encodings_bitmap;
|
||||
|
||||
uint32 finder_info[8];
|
||||
|
||||
hfs_fork_data allocation_file;
|
||||
hfs_fork_data extents_file;
|
||||
hfs_fork_data catalog_file;
|
||||
hfs_fork_data attributes_file;
|
||||
hfs_fork_data startup_file;
|
||||
};
|
||||
|
||||
} // namespace HFSPlus
|
||||
|
||||
#endif /* HFS_PLUS_H */
|
Loading…
Reference in New Issue
Block a user