mirror of
https://github.com/azure-rtos/filex.git
synced 2025-01-18 01:22:52 +08:00
Release 6.2.0
This commit is contained in:
parent
89976978ff
commit
ef128829b4
149
README.md
149
README.md
@ -2,111 +2,110 @@
|
||||
|
||||
This is a high-performance, file allocation table (FAT)-compatible file system that’s fully integrated with Azure RTOS ThreadX and available for all supported processors. Like Azure RTOS ThreadX, Azure RTOS FileX is designed to have a small footprint and high performance, making it ideal for today’s deeply embedded applications that require file management operations. FileX supports most physical media, including RAM, Azure RTOS USBX, SD CARD, and NAND/NOR flash memories via Azure RTOS LevelX.
|
||||
|
||||
## Documentation
|
||||
Here are the key features and modules of FileX:
|
||||
|
||||
Documentation for this library can be found here: http://docs.microsoft.com/azure/rtos/filex
|
||||
![FileX Key Features](./docs/filex-features.png)
|
||||
|
||||
## Getting Started
|
||||
|
||||
Azure RTOS FileX as part of Azure RTOS has been integrated to the semiconductor's SDKs and development environment. You can develop using the tools of choice from [STMicroelectronics](https://www.st.com/content/st_com/en/campaigns/x-cube-azrtos-azure-rtos-stm32.html), [NXP](https://www.nxp.com/design/software/embedded-software/azure-rtos-for-nxp-microcontrollers:AZURE-RTOS), [Renesas](https://github.com/renesas/azure-rtos) and [Microchip](https://mu.microchip.com/get-started-simplifying-your-iot-design-with-azure-rtos).
|
||||
|
||||
We also provide [samples](https://github.com/azure-rtos/samples) using hero development boards from semiconductors you can build and test with.
|
||||
|
||||
See [Overview of Azure RTOS FileX](https://learn.microsoft.com/azure/rtos/filex/overview-filex) for the high-level overview, and all documentation and APIs can be found in: [Azure RTOS FileX documentation](https://learn.microsoft.com/azure/rtos/filex).
|
||||
|
||||
## Repository Structure and Usage
|
||||
|
||||
### Directory layout
|
||||
|
||||
.
|
||||
├── cmake # CMakeList files for building the project
|
||||
├── common # Core FileX files
|
||||
├── ports # Architecture and compiler specific files
|
||||
├── samples # Sample codes
|
||||
├── LICENSE.txt # License terms
|
||||
├── LICENSE-HARDWARE.txt # Licensed hardware from semiconductors
|
||||
├── CONTRIBUTING.md # Contribution guidance
|
||||
└── SECURITY.md # Microsoft repo security guidance
|
||||
|
||||
### Branches & Releases
|
||||
|
||||
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library. Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.2-rel`.
|
||||
|
||||
## exFAT Licensing
|
||||
|
||||
FileX supports the Microsoft exFAT file system format using the FX_ENABLE_EXFAT define. See [common/inc/fx_user_sample.h](common/inc/fx_user_sample.h) for more information about configuration of FileX.
|
||||
FileX supports the Microsoft exFAT file system format using the `FX_ENABLE_EXFAT` define. See [`fx_user_sample.h`](common/inc/fx_user_sample.h) for more information about configuration of FileX.
|
||||
|
||||
The Azure RTOS FileX implementation of exFAT technology is licensed when used in [listed components](https://github.com/azure-rtos/filex/blob/master/LICENSED-HARDWARE.txt) obtained through a licensed partner. Other implementations of exFAT technology in your products may require a separate license from Microsoft. Please see the following link for further details on exFAT licensing from Microsoft [here](https://www.microsoft.com/en-us/legal/intellectualproperty/tech-licensing/programs?activetab=pivot1:primaryr5).
|
||||
|
||||
# Understanding inter-component dependencies
|
||||
## Component dependencies
|
||||
|
||||
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them--shown in the following graph--that are important to understand when setting up your builds.
|
||||
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them, as shown in the following graph. This is important to understand when setting up your builds.
|
||||
|
||||
![dependency graph](docs/deps.png)
|
||||
|
||||
# Building and using the library
|
||||
> You will have to take the dependency graph above into account when building anything other than ThreadX itself.
|
||||
|
||||
## Prerequisites
|
||||
### Building and using the library
|
||||
|
||||
Install the following tools:
|
||||
Instruction for building the FileX as static library using Arm GNU Toolchain and CMake. If you are using toolchain and IDE from semiconductor, you might follow its own instructions to use Azure RTOS components as explained in the [Getting Started](#getting-started) section.
|
||||
|
||||
* [CMake](https://cmake.org/download/) version 3.0 or later
|
||||
* [GCC compilers for arm-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
|
||||
* [Ninja](https://ninja-build.org/)
|
||||
1. Install the following tools:
|
||||
|
||||
## Cloning the repo
|
||||
* [CMake](https://cmake.org/download/) version 3.0 or later
|
||||
* [Arm GNU Toolchain for arm-none-eabi](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads)
|
||||
* [Ninja](https://ninja-build.org/)
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/azure-rtos/filex.git
|
||||
```
|
||||
1. Build the [ThreadX library](https://github.com/azure-rtos/threadx#building-and-using-the-library) as the dependency.
|
||||
|
||||
## Building as a static library
|
||||
1. Cloning the repo.
|
||||
|
||||
Each component of Azure RTOS comes with a composible CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake command `add_subdirectory()`.
|
||||
```bash
|
||||
$ git clone https://github.com/azure-rtos/filex.git
|
||||
```
|
||||
|
||||
While the typical usage pattern is to include threadx into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
|
||||
1. Define the features and addons you need in `fx_user.h` and build together with the component source code. You can refer to [`fx_user_sample.h`](https://github.com/azure-rtos/filex/blob/master/common/inc/fx_user_sample.h) as an example.
|
||||
|
||||
```bash
|
||||
$ cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake -GNinja .
|
||||
1. Building as a static library
|
||||
|
||||
$ cmake --build ./build
|
||||
```
|
||||
Each component of Azure RTOS comes with a composable CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake `add_subdirectory()`.
|
||||
|
||||
NOTE: You will have to take the dependency graph above into account when building anything other than threadx itself.
|
||||
While the typical usage pattern is to include FileX into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
|
||||
|
||||
# Repository Structure and Usage
|
||||
An example of building the library for Cortex-M4:
|
||||
|
||||
## Branches & Releases
|
||||
```bash
|
||||
$ cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake .
|
||||
|
||||
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library.
|
||||
$ cmake --build ./build
|
||||
```
|
||||
|
||||
## Releases
|
||||
## Professional support
|
||||
|
||||
Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.0-rel`.
|
||||
[Professional support plans](https://azure.microsoft.com/support/options/) are available from Microsoft. For community support and others, see the [Resources](#resources) section below.
|
||||
|
||||
## Directory layout
|
||||
## Licensing
|
||||
|
||||
```
|
||||
- cmake
|
||||
- common
|
||||
- inc
|
||||
- src
|
||||
- ports
|
||||
- cortex_m0/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m3/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m4/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m7/gnu
|
||||
- inc
|
||||
- src
|
||||
- samples
|
||||
```
|
||||
# Security
|
||||
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the [LICENSED-HARDWARE.txt](./LICENSED-HARDWARE.txt) file. If you are using hardware not listed in the file or having licensing questions in general, please contact Microsoft directly at https://aka.ms/azrtos-license.
|
||||
|
||||
## Resources
|
||||
|
||||
The following are references to additional Azure RTOS resources:
|
||||
|
||||
- **Product introduction and white papers**: https://azure.com/rtos
|
||||
- **General technical questions**: https://aka.ms/QnA/azure-rtos
|
||||
- **Product issues and bugs, or feature requests**: https://github.com/azure-rtos/filex/issues
|
||||
- **Licensing and sales questions**: https://aka.ms/azrtos-license
|
||||
- **Product roadmap and support policy**: https://aka.ms/azrtos/lts
|
||||
- **Blogs and videos**: http://msiotblog.com and https://aka.ms/iotshow
|
||||
- **Azure RTOS TraceX Installer**: https://aka.ms/azrtos-tracex-installer
|
||||
|
||||
You can also check [previous questions](https://stackoverflow.com/questions/tagged/azure-rtos+filex) or ask new ones on StackOverflow using the `azure-rtos` and `filex` tags.
|
||||
|
||||
## Security
|
||||
|
||||
Azure RTOS provides OEMs with components to secure communication and to create code and data isolation using underlying MCU/MPU hardware protection mechanisms. It is ultimately the responsibility of the device builder to ensure the device fully meets the evolving security requirements associated with its specific use case.
|
||||
|
||||
# Licensing
|
||||
## Contribution
|
||||
|
||||
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the LICENSED-HARDWARE.txt file. If you are using hardware not defined in the LICENSED-HARDWARE.txt file or have licensing questions in general, please contact Microsoft directly at https://aka.ms/azrtos-license.
|
||||
|
||||
# Contribution, feedback, issues, and professional support
|
||||
|
||||
If you encounter any bugs, have suggestions for new features, or if you would like to become an active contributor to this project, please follow the instructions provided in the contribution guideline for the corresponding repo.
|
||||
|
||||
For basic support, click Issues in the command bar or post a question to [Stack Overflow](http://stackoverflow.com/questions/tagged/azure-rtos+threadx) using the `threadx` and `azure-rtos` tags.
|
||||
|
||||
Professional support plans (https://azure.microsoft.com/en-us/support/options/) are available from Microsoft.
|
||||
|
||||
# Additional Resources
|
||||
|
||||
The following are references to additional Azure RTOS and Azure IoT in general:
|
||||
| Content | Link |
|
||||
|---|---|
|
||||
| TraceX Installer | https://aka.ms/azrtos-tracex-installer |
|
||||
| Azure RTOS Documentation and Guides: | https://docs.microsoft.com/azure/rtos |
|
||||
| Azure RTOS Website: | https://azure.microsoft.com/services/rtos/ |
|
||||
| Azure RTOS Sales Questions: | https://aka.ms/azrtos-license |
|
||||
| Azure RTOS Product Support Policy | https://aka.ms/azrtos/lts |
|
||||
| Azure RTOS Functional Safety Artifacts | https://aka.ms/azrtos/tuv |
|
||||
| For technical questions check out Microsoft Q/A for Azure IoT | https://aka.ms/QnA/azure-rtos |
|
||||
| Internet of Things Show for latest announcements and online training | https://aka.ms/iotshow |
|
||||
| IoT Tech Community | https://aka.ms/community/azure-rtos |
|
||||
Please follow the instructions provided in the [CONTRIBUTING.md](./CONTRIBUTING.md) for the corresponding repository.
|
||||
|
@ -26,7 +26,7 @@
|
||||
/* APPLICATION INTERFACE DEFINITION RELEASE */
|
||||
/* */
|
||||
/* fx_api.h PORTABLE C */
|
||||
/* 6.1.12 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -77,6 +77,9 @@
|
||||
/* 07-29-2022 William E. Lamie Modified comment(s), and */
|
||||
/* updated product constants, */
|
||||
/* resulting in version 6.1.12 */
|
||||
/* 10-31-2022 Xiuwen Cai Modified comment(s), and */
|
||||
/* updated product constants, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@ -125,8 +128,8 @@ extern "C" {
|
||||
|
||||
#define AZURE_RTOS_FILEX
|
||||
#define FILEX_MAJOR_VERSION 6
|
||||
#define FILEX_MINOR_VERSION 1
|
||||
#define FILEX_PATCH_VERSION 12
|
||||
#define FILEX_MINOR_VERSION 2
|
||||
#define FILEX_PATCH_VERSION 0
|
||||
|
||||
/* Define the following symbols for backward compatibility */
|
||||
#define EL_PRODUCT_FILEX
|
||||
|
@ -33,7 +33,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_fault_tolerant_apply_logs PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -81,6 +81,9 @@
|
||||
/* 09-30-2020 William E. Lamie Modified comment(s), verified */
|
||||
/* memcpy usage, */
|
||||
/* resulting in version 6.1 */
|
||||
/* 10-31-2022 Tiejun Zhou Modified comment(s), fixed */
|
||||
/* overflow in log size check, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_fault_tolerant_apply_logs(FX_MEDIA *media_ptr)
|
||||
@ -215,7 +218,7 @@ ULONG tail_cluster;
|
||||
|
||||
copy_size = log_len - FX_FAULT_TOLERANT_DIR_LOG_ENTRY_SIZE;
|
||||
|
||||
if ((copy_offset + copy_size) > media_ptr -> fx_media_memory_size)
|
||||
if (((ULONG64)copy_offset + (ULONG64)copy_size) > (ULONG64)(media_ptr -> fx_media_memory_size))
|
||||
{
|
||||
return(FX_FILE_CORRUPT);
|
||||
}
|
||||
|
@ -29,12 +29,94 @@
|
||||
|
||||
#ifdef FX_ENABLE_FAULT_TOLERANT
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_utility_FAT_entry_multiple_sectors_check PORTABLE C */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Tiejun Zhou, Microsoft Corporation */
|
||||
/* */
|
||||
/* DESCRIPTION */
|
||||
/* */
|
||||
/* This function checks whether the FAT entry spans multiple sectors. */
|
||||
/* It is only possible when the file system is FAT12. */
|
||||
/* */
|
||||
/* INPUT */
|
||||
/* */
|
||||
/* media_ptr Media control block pointer */
|
||||
/* cluster Cluster entry number */
|
||||
/* */
|
||||
/* OUTPUT */
|
||||
/* */
|
||||
/* FX_TRUE FAT entry spans two sectors */
|
||||
/* FX_FALSE FAT entry in one sector */
|
||||
/* */
|
||||
/* CALLS */
|
||||
/* */
|
||||
/* None */
|
||||
/* */
|
||||
/* CALLED BY */
|
||||
/* */
|
||||
/* _fx_fault_tolerant_cleanup_FAT_chain */
|
||||
/* */
|
||||
/* RELEASE HISTORY */
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 10-31-2022 Tiejun Zhou Initial Version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
static UINT _fx_utility_FAT_entry_multiple_sectors_check(FX_MEDIA *media_ptr, ULONG cluster)
|
||||
{
|
||||
ULONG byte_offset;
|
||||
ULONG FAT_sector;
|
||||
|
||||
/* Check FAT format. */
|
||||
if (!media_ptr -> fx_media_12_bit_FAT)
|
||||
{
|
||||
|
||||
/* Not FAT12. The FAT entry will be in one sector. */
|
||||
return(FX_FALSE);
|
||||
}
|
||||
|
||||
/* File system is FAT12. */
|
||||
/* Calculate the byte offset to the cluster entry. */
|
||||
byte_offset = (((ULONG)cluster << 1) + cluster) >> 1;
|
||||
|
||||
/* Calculate the FAT sector the requested FAT entry resides in. */
|
||||
FAT_sector = (byte_offset / media_ptr -> fx_media_bytes_per_sector) +
|
||||
(ULONG)media_ptr -> fx_media_reserved_sectors;
|
||||
|
||||
/* Now calculate the byte offset into this FAT sector. */
|
||||
byte_offset = byte_offset -
|
||||
((FAT_sector - (ULONG)media_ptr -> fx_media_reserved_sectors) *
|
||||
media_ptr -> fx_media_bytes_per_sector);
|
||||
|
||||
/* Determine if we are now past the end of the FAT buffer in memory. */
|
||||
if (byte_offset == (ULONG)(media_ptr -> fx_media_bytes_per_sector - 1))
|
||||
{
|
||||
|
||||
/* Yes, we are past the end of the FAT buffer. */
|
||||
return(FX_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/* No, we are not past the end of the FAT buffer. */
|
||||
return(FX_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_fault_tolerant_cleanup_FAT_chain PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -72,6 +154,8 @@
|
||||
/* _fx_utility_FAT_flush Flush written FAT entries */
|
||||
/* _fx_fault_tolerant_calculate_checksum Compute Checksum of data */
|
||||
/* _fx_fault_tolerant_write_log_file Write log file */
|
||||
/* _fx_utility_FAT_entry_multiple_sectors_check */
|
||||
/* Check sectors for FAT entry */
|
||||
/* */
|
||||
/* CALLED BY */
|
||||
/* */
|
||||
@ -85,6 +169,10 @@
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 William E. Lamie Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 10-31-2022 Tiejun Zhou Modified comment(s), */
|
||||
/* fixed FAT entry span two */
|
||||
/* sectors for FAT12, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_fault_tolerant_cleanup_FAT_chain(FX_MEDIA *media_ptr, UINT operation)
|
||||
@ -123,7 +211,7 @@ ULONG last_FAT_sector;
|
||||
|
||||
/* At this point, the head_cluster points to the cluster chain that is to be removed. */
|
||||
|
||||
/* Tail cluster points to the back of the origianl FAT chain where the new chain is attached to.
|
||||
/* Tail cluster points to the back of the origianal FAT chain where the new chain is attached to.
|
||||
The remove process terminates once this cluster is encountered. */
|
||||
tail_cluster = _fx_utility_32_unsigned_read((UCHAR *)&FAT_chain -> fx_fault_tolerant_FAT_chain_insertion_back);
|
||||
|
||||
@ -133,7 +221,7 @@ ULONG last_FAT_sector;
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
|
||||
/* To opimize the deletion process of a long FAT chain, the deletion is done in sessions. During one session,
|
||||
/* To optimize the deletion process of a long FAT chain, the deletion is done in sessions. During one session,
|
||||
a set of FAT entries are removed. If one session is interrupted, after restart the deletion process resumes and
|
||||
picks up from where it left.
|
||||
|
||||
@ -173,6 +261,16 @@ ULONG last_FAT_sector;
|
||||
/* Cache the FAT list. */
|
||||
cache_ptr[cache_count++] = current_cluster;
|
||||
|
||||
/* Check whether FAT entry spans multiple sectors. */
|
||||
if (_fx_utility_FAT_entry_multiple_sectors_check(media_ptr, current_cluster))
|
||||
{
|
||||
if (head_cluster == next_session || next_session == FX_FREE_CLUSTER)
|
||||
{
|
||||
next_session = next_cluster;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Move to next cluster. */
|
||||
current_cluster = next_cluster;
|
||||
} while ((next_cluster >= FX_FAT_ENTRY_START) &&
|
||||
@ -288,5 +386,4 @@ ULONG last_FAT_sector;
|
||||
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
#endif /* FX_ENABLE_FAULT_TOLERANT */
|
||||
|
||||
#endif /* FX_ENABLE_FAULT_TOLERANT */
|
@ -34,7 +34,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_fault_tolerant_enable PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -46,7 +46,7 @@
|
||||
/* previous write operation failed, and appropriate action now must */
|
||||
/* be taken to restore the integrity of the file system. Once the */
|
||||
/* recovery effort is completed, the file system is properly restored. */
|
||||
/* An empty log file indicates the previous write operaiton was */
|
||||
/* An empty log file indicates the previous write operation was */
|
||||
/* successfully completed and no action needs to be taken at this */
|
||||
/* point. If the file system does not have a log file, or the */
|
||||
/* checksum is not valid, it is an indication either the file system */
|
||||
@ -86,6 +86,10 @@
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 William E. Lamie Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 10-31-2022 Tiejun Zhou Modified comment(s), */
|
||||
/* fixed memory buffer when */
|
||||
/* cache is disabled, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_fault_tolerant_enable(FX_MEDIA *media_ptr, VOID *memory_buffer, UINT memory_size)
|
||||
@ -143,11 +147,13 @@ ULONG bytes_per_cluster;
|
||||
values of zero, endian issues are not important. */
|
||||
/* Force update the available cluster. */
|
||||
|
||||
#ifndef FX_DISABLE_CACHE
|
||||
/* Invalidate the current logical sector cache. */
|
||||
_fx_utility_logical_sector_flush(media_ptr, ((ULONG64) 1), (ULONG64) (media_ptr -> fx_media_total_sectors), FX_TRUE);
|
||||
|
||||
/* Reset the memory pointer. */
|
||||
media_ptr -> fx_media_memory_buffer = media_ptr -> fx_media_sector_cache[0].fx_cached_sector_memory_buffer;
|
||||
#endif /* FX_DISABLE_CACHE */
|
||||
|
||||
/* Reset the available cluster. */
|
||||
media_ptr -> fx_media_available_clusters = 0;
|
||||
@ -155,6 +161,7 @@ ULONG bytes_per_cluster;
|
||||
/* Loop through all FAT sectors in the primary FAT. The first two entries are
|
||||
examined in this loop, but they are always unavailable. */
|
||||
cluster_number = 0;
|
||||
#ifndef FX_DISABLE_CACHE
|
||||
for (i = 0; i < media_ptr -> fx_media_sectors_per_FAT; i = i + media_ptr -> fx_media_sector_cache_size)
|
||||
{
|
||||
|
||||
@ -169,6 +176,18 @@ ULONG bytes_per_cluster;
|
||||
{
|
||||
FAT_read_sectors = media_ptr -> fx_media_sector_cache_size;
|
||||
}
|
||||
#else
|
||||
/* Reset the buffer sector. */
|
||||
media_ptr -> fx_media_memory_buffer_sector = (ULONG64)-1;
|
||||
for (i = 0; i < media_ptr -> fx_media_sectors_per_FAT; i++)
|
||||
{
|
||||
|
||||
/* Calculate the starting next FAT sector. */
|
||||
FAT_sector = media_ptr -> fx_media_reserved_sectors + i;
|
||||
|
||||
/* Calculate how many sectors to read. */
|
||||
FAT_read_sectors = 1;
|
||||
#endif /* FX_DISABLE_CACHE */
|
||||
|
||||
/* Read the FAT sectors directly from the driver. */
|
||||
media_ptr -> fx_media_driver_request = FX_DRIVER_READ;
|
||||
|
@ -36,7 +36,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_media_open PORTABLE C */
|
||||
/* 6.1.10 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -132,6 +132,10 @@
|
||||
/* 01-31-2022 William E. Lamie Modified comment(s), fixed */
|
||||
/* errors without cache, */
|
||||
/* resulting in version 6.1.10 */
|
||||
/* 10-31-2022 Tiejun Zhou Modified comment(s), */
|
||||
/* fixed memory buffer when */
|
||||
/* cache is disabled, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_media_open(FX_MEDIA *media_ptr, CHAR *media_name,
|
||||
@ -340,13 +344,8 @@ FX_INT_SAVE_AREA
|
||||
/* Pickup the additional info sector number. This will only be used in FAT32 situations. */
|
||||
additional_info_sector = _fx_utility_16_unsigned_read(&media_ptr -> fx_media_driver_buffer[48]);
|
||||
|
||||
#ifndef FX_DISABLE_CACHE
|
||||
/* Determine how many logical sectors can be cached with user's supplied
|
||||
buffer area - there must be at least enough for one sector! */
|
||||
media_ptr -> fx_media_sector_cache_size = memory_size / media_ptr -> fx_media_bytes_per_sector;
|
||||
|
||||
/* Is there at least one? */
|
||||
if (media_ptr -> fx_media_sector_cache_size == 0)
|
||||
if (memory_size < media_ptr -> fx_media_bytes_per_sector)
|
||||
{
|
||||
|
||||
/* Build the "uninitialize" I/O driver request. */
|
||||
@ -363,6 +362,11 @@ FX_INT_SAVE_AREA
|
||||
return(FX_BUFFER_ERROR);
|
||||
}
|
||||
|
||||
#ifndef FX_DISABLE_CACHE
|
||||
/* Determine how many logical sectors can be cached with user's supplied
|
||||
buffer area - there must be at least enough for one sector! */
|
||||
media_ptr -> fx_media_sector_cache_size = memory_size / media_ptr -> fx_media_bytes_per_sector;
|
||||
|
||||
/* If trace is enabled, register this object. */
|
||||
FX_TRACE_OBJECT_REGISTER(FX_TRACE_OBJECT_TYPE_MEDIA, media_ptr, media_name, FX_MAX_FAT_CACHE, media_ptr -> fx_media_sector_cache_size)
|
||||
|
||||
@ -654,6 +658,7 @@ FX_INT_SAVE_AREA
|
||||
(media_ptr -> fx_media_sector_cache_list_ptr) -> fx_cached_sector_valid = FX_FALSE;
|
||||
#else
|
||||
buffer_ptr = media_ptr -> fx_media_memory_buffer;
|
||||
media_ptr -> fx_media_memory_buffer_sector = (ULONG64)-1;
|
||||
#endif /* FX_DISABLE_CACHE */
|
||||
|
||||
/* Read the FAT32 additional information sector from the device. */
|
||||
|
@ -37,6 +37,22 @@ typedef struct FX_MEDIA_PARTITION_STRUCT
|
||||
ULONG fx_media_part_size;
|
||||
} FX_MEDIA_PARTITION;
|
||||
|
||||
/* Define internal partition constants. */
|
||||
|
||||
#ifndef FX_MAX_PARTITION_COUNT
|
||||
#define FX_MAX_PARTITION_COUNT 16
|
||||
#endif /* FX_MAX_PARTITION_COUNT */
|
||||
|
||||
#define FX_PARTITION_TABLE_OFFSET 446
|
||||
#define FX_PARTITION_ENTRY_SIZE 16
|
||||
#define FX_PARTITION_TYPE_OFFSET 4
|
||||
#define FX_PARTITION_LBA_OFFSET 8
|
||||
#define FX_PARTITION_SECTORS_OFFSET 12
|
||||
|
||||
#define FX_PARTITION_TYPE_FREE 0x00
|
||||
#define FX_PARTITION_TYPE_EXTENDED 0x05
|
||||
#define FX_PARTITION_TYPE_EXTENDED_LBA 0x0F
|
||||
|
||||
|
||||
/* Define function prototypes for the partition table parsing application
|
||||
utility. */
|
||||
@ -45,7 +61,8 @@ UINT _fx_partition_offset_calculate(void *partition_sector, UINT partition,
|
||||
ULONG *partition_start, ULONG *partition_size);
|
||||
UINT _fx_utility_partition_get(FX_MEDIA_PARTITION *partition_table,
|
||||
UINT *count, ULONG sector, UCHAR *sector_buffer);
|
||||
|
||||
UINT _fx_partition_offset_calculate_extended(FX_MEDIA *media_ptr, void *partition_sector, UINT partition,
|
||||
ULONG *partition_start, ULONG *partition_size);
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
@ -343,3 +360,324 @@ ULONG base_sector, value;
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_partition_offset_calculate_extended PORTABLE C */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Xiuwen Cai, Microsoft Corporation */
|
||||
/* */
|
||||
/* DESCRIPTION */
|
||||
/* */
|
||||
/* This function calculates the sector offset to the specified */
|
||||
/* partition. The buffer containing the partition table is also */
|
||||
/* supplied to this function. If the buffer supplied is a boot */
|
||||
/* record (which could be the case in non-partition systems), this */
|
||||
/* function returns an offset of zero, the total sectors, and a */
|
||||
/* successful status indicating that the buffer supplied is the boot */
|
||||
/* record. Otherwise, if a partition is found, this function returns */
|
||||
/* the sector offset to its boot record along with a successful */
|
||||
/* status. If the specified partition is not found or the buffer is */
|
||||
/* not a partition table or boot record, this function returns an */
|
||||
/* error. */
|
||||
/* */
|
||||
/* Note: Empty partitions have a FX_NOT_FOUND return code. */
|
||||
/* Use partition index 0 to 3 for primary partition and index 4 to */
|
||||
/* FX_MAX_PARTITION_COUNT for extended partition. */
|
||||
/* */
|
||||
/* INPUT */
|
||||
/* */
|
||||
/* media_ptr Media control block pointer */
|
||||
/* partition_sector Pointer to buffer containing */
|
||||
/* either the partition table */
|
||||
/* or the boot sector */
|
||||
/* partition Desired partition */
|
||||
/* partition_start Return partition start */
|
||||
/* partition_size Return partition size */
|
||||
/* */
|
||||
/* OUTPUT */
|
||||
/* */
|
||||
/* return status */
|
||||
/* */
|
||||
/* CALLS */
|
||||
/* */
|
||||
/* _fx_utility_16_unsigned_read Read a USHORT from memory */
|
||||
/* _fx_utility_32_unsigned_read Read a ULONG from memory */
|
||||
/* _fx_utility_64_unsigned_read Read a ULONG64 from memory */
|
||||
/* Media driver */
|
||||
/* */
|
||||
/* CALLED BY */
|
||||
/* */
|
||||
/* Application Driver */
|
||||
/* */
|
||||
/* RELEASE HISTORY */
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 10-31-2022 Xiuwen Cai Initial Version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_partition_offset_calculate_extended(FX_MEDIA *media_ptr, void *partition_sector, UINT partition,
|
||||
ULONG *partition_start, ULONG *partition_size)
|
||||
{
|
||||
|
||||
ULONG64 total_sectors;
|
||||
UCHAR *partition_sector_ptr;
|
||||
UCHAR partition_type;
|
||||
UINT i;
|
||||
ULONG base_sector;
|
||||
ULONG base_sector_extended;
|
||||
|
||||
|
||||
/* Setup working pointer. */
|
||||
partition_sector_ptr = partition_sector;
|
||||
|
||||
/* Check for a real boot sector instead of a partition table. */
|
||||
if ((partition_sector_ptr[0] == 0xe9) || ((partition_sector_ptr[0] == 0xeb) && (partition_sector_ptr[2] == 0x90)))
|
||||
{
|
||||
|
||||
/* Yes, a real boot sector could be present. */
|
||||
|
||||
/* See if there are good values for sectors per FAT. */
|
||||
if (partition_sector_ptr[0x16] || partition_sector_ptr[0x17] || partition_sector_ptr[0x24] || partition_sector_ptr[0x25] || partition_sector_ptr[0x26] || partition_sector_ptr[0x27])
|
||||
{
|
||||
|
||||
/* There are values for sectors per FAT. */
|
||||
|
||||
/* Get the total sectors, FAT12/16. */
|
||||
total_sectors = _fx_utility_16_unsigned_read(&partition_sector_ptr[FX_SECTORS]);
|
||||
|
||||
if (total_sectors == 0)
|
||||
{
|
||||
|
||||
/* Get the total sectors, FAT32. */
|
||||
total_sectors = _fx_utility_32_unsigned_read(&partition_sector_ptr[FX_HUGE_SECTORS]);
|
||||
}
|
||||
|
||||
/* Determine if there is a total sector count. */
|
||||
if (total_sectors)
|
||||
{
|
||||
|
||||
if (partition_start != FX_NULL)
|
||||
{
|
||||
/* Return an offset of 0, size of boot record, and a successful status. */
|
||||
*partition_start = 0;
|
||||
}
|
||||
|
||||
/* Determine if the total sectors is required. */
|
||||
if (partition_size != FX_NULL)
|
||||
{
|
||||
|
||||
/* Return the total sectors. */
|
||||
*partition_size = (ULONG)(total_sectors & 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
/* Return success! */
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
}
|
||||
#ifdef FX_ENABLE_EXFAT
|
||||
/* See if there are good values for sectors per exFAT. */
|
||||
else if (partition_sector_ptr[0x0b] == 0 && partition_sector_ptr[0x0c] == 0)
|
||||
{
|
||||
/* There are values for sectors per exFAT. */
|
||||
|
||||
/* Calculate the total sectors. */
|
||||
total_sectors = _fx_utility_64_unsigned_read(&partition_sector_ptr[FX_EF_VOLUME_LENGTH]);
|
||||
|
||||
/* Determine if there is a total sector count. */
|
||||
if (total_sectors)
|
||||
{
|
||||
|
||||
if (partition_start != FX_NULL)
|
||||
{
|
||||
/* Return an offset of 0, size of boot record, and a successful status. */
|
||||
*partition_start = 0;
|
||||
}
|
||||
|
||||
/* Determine if the total sectors is required. */
|
||||
if (partition_size != FX_NULL)
|
||||
{
|
||||
|
||||
if (total_sectors > 0xFFFFFFFF)
|
||||
{
|
||||
|
||||
/* Overflow. Just return not found. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
|
||||
/* Return the total sectors. */
|
||||
*partition_size = (ULONG)(total_sectors & 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
/* Return success! */
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
}
|
||||
#endif /* FX_ENABLE_EXFAT */
|
||||
}
|
||||
|
||||
/* Check signature to make sure the buffer is valid. */
|
||||
if ((partition_sector_ptr[510] != FX_SIG_BYTE_1) || (partition_sector_ptr[511] != FX_SIG_BYTE_2))
|
||||
{
|
||||
|
||||
/* Invalid, return an error. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
|
||||
/* Not bootable, look for specific partition. */
|
||||
|
||||
/* Check if primary partitions are addressed. */
|
||||
if (partition < 4)
|
||||
{
|
||||
|
||||
/* Get partition type. */
|
||||
partition_type = partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + partition * FX_PARTITION_ENTRY_SIZE + FX_PARTITION_TYPE_OFFSET];
|
||||
|
||||
/* Check if there is a vaild partition. */
|
||||
if (partition_type != FX_PARTITION_TYPE_FREE)
|
||||
{
|
||||
|
||||
/* Return the partition starting sector, if non-NULL. */
|
||||
if (partition_start != FX_NULL)
|
||||
{
|
||||
*partition_start = _fx_utility_32_unsigned_read(&partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + partition * FX_PARTITION_ENTRY_SIZE + FX_PARTITION_LBA_OFFSET]);
|
||||
}
|
||||
|
||||
/* Return the partition size, if non-NULL. */
|
||||
if (partition_size != FX_NULL)
|
||||
{
|
||||
*partition_size = _fx_utility_32_unsigned_read(&partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + partition * FX_PARTITION_ENTRY_SIZE + FX_PARTITION_SECTORS_OFFSET]);
|
||||
}
|
||||
|
||||
/* Return success! */
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/* Not partition here. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for invalid parameter. */
|
||||
if (partition > FX_MAX_PARTITION_COUNT)
|
||||
{
|
||||
|
||||
/* Return error. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
|
||||
base_sector = 0;
|
||||
|
||||
/* Loop to find the extended partition table. */
|
||||
for(i = FX_PARTITION_TABLE_OFFSET; i <= FX_PARTITION_TABLE_OFFSET + 3 * FX_PARTITION_ENTRY_SIZE; i += FX_PARTITION_ENTRY_SIZE)
|
||||
{
|
||||
|
||||
/* Get partition type. */
|
||||
partition_type = partition_sector_ptr[i + FX_PARTITION_TYPE_OFFSET];
|
||||
if (partition_type == FX_PARTITION_TYPE_EXTENDED || partition_type == FX_PARTITION_TYPE_EXTENDED_LBA)
|
||||
{
|
||||
base_sector = _fx_utility_32_unsigned_read(&partition_sector_ptr[i + FX_PARTITION_LBA_OFFSET]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (base_sector == 0)
|
||||
{
|
||||
|
||||
/* No extended partition. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
|
||||
base_sector_extended = base_sector;
|
||||
|
||||
for (i = 4; i <= partition; i++)
|
||||
{
|
||||
|
||||
/* Read the partition sector from the device. Build the read sector
|
||||
command. */
|
||||
media_ptr -> fx_media_driver_request = FX_DRIVER_READ;
|
||||
media_ptr -> fx_media_driver_status = FX_IO_ERROR;
|
||||
media_ptr -> fx_media_driver_buffer = partition_sector_ptr;
|
||||
media_ptr -> fx_media_driver_logical_sector = base_sector;
|
||||
media_ptr -> fx_media_driver_sectors = 1;
|
||||
media_ptr -> fx_media_driver_sector_type = FX_UNKNOWN_SECTOR;
|
||||
media_ptr -> fx_media_hidden_sectors = 0;
|
||||
|
||||
/* Invoke the driver to read the sector. */
|
||||
(media_ptr -> fx_media_driver_entry) (media_ptr);
|
||||
|
||||
/* Determine if the sector was read correctly. */
|
||||
if (media_ptr -> fx_media_driver_status != FX_SUCCESS)
|
||||
{
|
||||
|
||||
/* Return error. */
|
||||
return(FX_IO_ERROR);
|
||||
}
|
||||
|
||||
/* Check signature to make sure the sector is valid. */
|
||||
if ((partition_sector_ptr[510] != FX_SIG_BYTE_1) || (partition_sector_ptr[511] != FX_SIG_BYTE_2))
|
||||
{
|
||||
|
||||
/* Invalid, return an error. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
|
||||
/* Determine if this is the desired partition. */
|
||||
if (i == partition)
|
||||
{
|
||||
|
||||
/* Get partition type. */
|
||||
partition_type = partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + FX_PARTITION_TYPE_OFFSET];
|
||||
if (partition_type != FX_PARTITION_TYPE_FREE)
|
||||
{
|
||||
|
||||
/* Return the partition starting sector, if non-NULL. */
|
||||
if (partition_start != FX_NULL)
|
||||
{
|
||||
*partition_start = _fx_utility_32_unsigned_read(&partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + FX_PARTITION_LBA_OFFSET]) + base_sector;
|
||||
}
|
||||
|
||||
/* Return the partition size, if non-NULL. */
|
||||
if (partition_size != FX_NULL)
|
||||
{
|
||||
*partition_size = _fx_utility_32_unsigned_read(&partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + FX_PARTITION_SECTORS_OFFSET]);
|
||||
}
|
||||
|
||||
/* Return success! */
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not partition here. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/* Get partition type. */
|
||||
partition_type = partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + FX_PARTITION_ENTRY_SIZE + FX_PARTITION_TYPE_OFFSET];
|
||||
if (partition_type == FX_PARTITION_TYPE_EXTENDED || partition_type == FX_PARTITION_TYPE_EXTENDED_LBA)
|
||||
{
|
||||
|
||||
/* Update sector number for next partition table. */
|
||||
base_sector = _fx_utility_32_unsigned_read(&partition_sector_ptr[FX_PARTITION_TABLE_OFFSET + FX_PARTITION_ENTRY_SIZE + FX_PARTITION_LBA_OFFSET]) + base_sector_extended;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No valid partition, get out of the loop. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Return error. */
|
||||
return(FX_NOT_FOUND);
|
||||
}
|
@ -38,7 +38,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_utility_FAT_entry_read PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -80,6 +80,9 @@
|
||||
/* added conditional to */
|
||||
/* disable fat entry refresh, */
|
||||
/* resulting in version 6.1 */
|
||||
/* 10-31-2022 Tiejun Zhou Modified comment(s), and */
|
||||
/* fixed compiler warning, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_utility_FAT_entry_read(FX_MEDIA *media_ptr, ULONG cluster, ULONG *entry_ptr)
|
||||
@ -91,7 +94,9 @@ UCHAR *FAT_ptr;
|
||||
UINT entry, index;
|
||||
UINT status;
|
||||
FX_FAT_CACHE_ENTRY *cache_entry_ptr;
|
||||
#ifndef FX_DISABLE_FAT_ENTRY_REFRESH
|
||||
FX_FAT_CACHE_ENTRY temp_cache_entry;
|
||||
#endif /* FX_DISABLE_FAT_ENTRY_REFRESH */
|
||||
|
||||
|
||||
#ifdef FX_ENABLE_FAULT_TOLERANT
|
||||
|
@ -38,7 +38,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _fx_utility_logical_sector_read PORTABLE C */
|
||||
/* 6.1.6 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@ -96,6 +96,10 @@
|
||||
/* updated check for logical */
|
||||
/* sector value, */
|
||||
/* resulting in version 6.1.6 */
|
||||
/* 10-31-2022 Tiejun Zhou Modified comment(s), */
|
||||
/* fixed memory buffer when */
|
||||
/* cache is disabled, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _fx_utility_logical_sector_read(FX_MEDIA *media_ptr, ULONG64 logical_sector,
|
||||
@ -342,6 +346,24 @@ UINT status;
|
||||
#else
|
||||
if ((logical_sector == media_ptr -> fx_media_memory_buffer_sector) && (sectors == 1) && (buffer_ptr == media_ptr -> fx_media_memory_buffer))
|
||||
{
|
||||
#ifdef FX_ENABLE_FAULT_TOLERANT
|
||||
if (media_ptr -> fx_media_fault_tolerant_enabled &&
|
||||
(media_ptr -> fx_media_fault_tolerant_state & FX_FAULT_TOLERANT_STATE_STARTED) &&
|
||||
(sector_type == FX_DIRECTORY_SECTOR))
|
||||
{
|
||||
|
||||
/* Read sector from log file. */
|
||||
status = _fx_fault_tolerant_read_directory_sector(media_ptr, logical_sector, buffer_ptr, 1);
|
||||
|
||||
/* Check for successful completion. */
|
||||
if (status)
|
||||
{
|
||||
|
||||
/* Return the error status. */
|
||||
return(status);
|
||||
}
|
||||
}
|
||||
#endif /* FX_ENABLE_FAULT_TOLERANT */
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
@ -456,6 +478,24 @@ UINT status;
|
||||
if ((media_ptr -> fx_media_driver_status == FX_SUCCESS) && (sectors == 1) && (buffer_ptr == media_ptr -> fx_media_memory_buffer))
|
||||
{
|
||||
media_ptr -> fx_media_memory_buffer_sector = logical_sector;
|
||||
#ifdef FX_ENABLE_FAULT_TOLERANT
|
||||
if (media_ptr -> fx_media_fault_tolerant_enabled &&
|
||||
(media_ptr -> fx_media_fault_tolerant_state & FX_FAULT_TOLERANT_STATE_STARTED) &&
|
||||
(sector_type == FX_DIRECTORY_SECTOR))
|
||||
{
|
||||
|
||||
/* Read sector from log file. */
|
||||
status = _fx_fault_tolerant_read_directory_sector(media_ptr, logical_sector, buffer_ptr, 1);
|
||||
|
||||
/* Check for successful completion. */
|
||||
if (status)
|
||||
{
|
||||
|
||||
/* Return the error status. */
|
||||
return(status);
|
||||
}
|
||||
}
|
||||
#endif /* FX_ENABLE_FAULT_TOLERANT */
|
||||
return(FX_SUCCESS);
|
||||
}
|
||||
#endif /* FX_DISABLE_CACHE */
|
||||
|
BIN
docs/filex-features.png
Normal file
BIN
docs/filex-features.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 348 KiB |
@ -213,7 +213,7 @@ typedef unsigned long long ULONG64;
|
||||
|
||||
#ifdef FX_SYSTEM_INIT
|
||||
CHAR _fx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * FileX Generic Version 6.1.12 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * FileX Generic Version 6.2.0 *";
|
||||
#else
|
||||
extern CHAR _fx_version_id[];
|
||||
#endif
|
||||
|
@ -340,7 +340,7 @@ extern VOID fault_tolerant_apply_log_callback(struct FX_MEDIA_STRUCT *media_ptr,
|
||||
|
||||
#ifdef FX_SYSTEM_INIT
|
||||
CHAR _fx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * FileX Linux/GCC Version 6.1.12 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * FileX Linux/GCC Version 6.2.0 *";
|
||||
#else
|
||||
extern CHAR _fx_version_id[];
|
||||
#endif
|
||||
|
25
ports/mips/gnu/inc/fx_port.h
Normal file
25
ports/mips/gnu/inc/fx_port.h
Normal file
@ -0,0 +1,25 @@
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* Copyright (c) Microsoft Corporation. All rights reserved. */
|
||||
/* */
|
||||
/* This software is licensed under the Microsoft Software License */
|
||||
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
|
||||
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
|
||||
/* and in the root directory of this software. */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
/** */
|
||||
/** FileX Component */
|
||||
/** */
|
||||
/** Port Specific */
|
||||
/** */
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
|
||||
/* Include the generic version of fx_port.h. */
|
||||
#include "../../../generic/inc/fx_port.h"
|
||||
|
@ -204,7 +204,7 @@ typedef unsigned long long ULONG64;
|
||||
|
||||
#ifdef FX_SYSTEM_INIT
|
||||
CHAR _fx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * FileX Win32/Version 6.1.12 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * FileX Win32/Version 6.2.0 *";
|
||||
#else
|
||||
extern CHAR _fx_version_id[];
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user