2019-08-26 03:03:54 +00:00
|
|
|
//
|
|
|
|
// MacintoshVolume.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 25/08/2019.
|
|
|
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef MacintoshVolume_hpp
|
|
|
|
#define MacintoshVolume_hpp
|
|
|
|
|
2022-03-25 20:58:06 +00:00
|
|
|
#include <cstddef>
|
2019-08-26 03:03:54 +00:00
|
|
|
#include <cstdint>
|
2019-09-19 02:04:54 +00:00
|
|
|
#include <sys/types.h>
|
2019-08-26 03:03:54 +00:00
|
|
|
|
2022-08-23 23:39:47 +00:00
|
|
|
#include "ApplePartitionMap.hpp"
|
|
|
|
|
2019-08-26 03:03:54 +00:00
|
|
|
namespace Storage {
|
|
|
|
namespace MassStorage {
|
|
|
|
namespace Encodings {
|
|
|
|
namespace Macintosh {
|
|
|
|
|
2022-08-23 23:39:47 +00:00
|
|
|
using DriveType = Storage::MassStorage::Encodings::Apple::DriveType;
|
2019-08-26 03:03:54 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
On the Macintosh life is slightly complicated by Apple's
|
|
|
|
decision to include device drivers on mass storage drives
|
|
|
|
themselves — therefore a mass-storage device that is
|
|
|
|
connected by SCSI will have different preliminary data on it
|
|
|
|
than the same volume connected by ATA or as an HD20.
|
|
|
|
|
|
|
|
Mass storage devices that respond to @c Volume can be made
|
|
|
|
to provide the proper whole-volume encoding necessary to
|
|
|
|
impersonate different types of Macintosh drive.
|
|
|
|
*/
|
|
|
|
class Volume {
|
|
|
|
public:
|
|
|
|
virtual void set_drive_type(DriveType type) = 0;
|
|
|
|
};
|
|
|
|
|
2022-08-23 23:39:47 +00:00
|
|
|
struct VolumeProvider {
|
2022-08-24 00:56:27 +00:00
|
|
|
static constexpr bool HasDriver = true;
|
2022-08-23 23:39:47 +00:00
|
|
|
size_t driver_size() const;
|
|
|
|
uint16_t driver_checksum() const;
|
|
|
|
const uint8_t *driver() const;
|
|
|
|
const char *driver_target() const;
|
|
|
|
|
|
|
|
const char *name() const;
|
|
|
|
const char *type() const;
|
|
|
|
};
|
|
|
|
|
2019-08-26 03:03:54 +00:00
|
|
|
/*!
|
|
|
|
A Mapper can used by a mass-storage device that knows the
|
2022-08-23 20:19:19 +00:00
|
|
|
contents of an HFS partition to provide the conversion
|
2019-08-26 03:03:54 +00:00
|
|
|
necessary to a particular type of drive.
|
|
|
|
*/
|
2022-08-23 23:39:47 +00:00
|
|
|
using Mapper = Storage::MassStorage::Encodings::Apple::PartitionMap<VolumeProvider>;
|
2019-08-26 03:03:54 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MacintoshVolume_hpp */
|