mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Add classes for mounting FAT16/32 without help from OS
Minimal implementation for reading/writing files in the root directory of a FAT16/FAT32 file system. Can read/write from raw disk devices, and no longer relies on operating system support for mounting the file system. Currently assumes Imager will always be run on 'little endian' architectures such as Intel and ARM (at least under Linux). If there is a use-case for big-endian (anybody still using Sparc?) this may be revisited later.
This commit is contained in:
parent
30225187bd
commit
142ddfc037
10 changed files with 1193 additions and 1 deletions
19
src/devicewrapperblockcacheentry.cpp
Normal file
19
src/devicewrapperblockcacheentry.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (C) 2022 Raspberry Pi Ltd
|
||||
*/
|
||||
|
||||
#include "devicewrapperblockcacheentry.h"
|
||||
#include <QObject>
|
||||
|
||||
DeviceWrapperBlockCacheEntry::DeviceWrapperBlockCacheEntry(QObject *parent, size_t blocksize)
|
||||
: QObject(parent), dirty(false)
|
||||
{
|
||||
/* Windows requires buffers to be 4k aligned when reading/writing raw disk devices */
|
||||
block = (char *) qMallocAligned(blocksize, 4096);
|
||||
}
|
||||
|
||||
DeviceWrapperBlockCacheEntry::~DeviceWrapperBlockCacheEntry()
|
||||
{
|
||||
qFreeAligned(block);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue