* Copyright 2008, FranΓ§ois Revol <revol@free.fr>
* Distributed under the terms of the MIT License.
*/
#include "fatfs.h"
#include <boot/partitions.h>
#include <boot/platform.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
using namespace FATFS;
#if 0
status_t
FATFS::get_root_block(int fDevice, char *buffer, int32 blockSize, off_t partitionSize)
{
int32 reservedBlocks = 2;
off_t offset = (((partitionSize / blockSize) - 1 - reservedBlocks) / 2) + reservedBlocks;
if (read_pos(fDevice, offset * blockSize, buffer, blockSize) < B_OK)
return B_ERROR;
RootBlock root(buffer, blockSize);
if (root.ValidateCheckSum() < B_OK)
return B_BAD_DATA;
if (!root.IsRootBlock())
return B_BAD_TYPE;
return B_OK;
}
#endif