mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] Indicate the address of the file system in the header section
of the flash
This commit is contained in:
committed by
EmilieNumworks
parent
19ca0f0640
commit
338ee4e0b0
@@ -29,11 +29,24 @@ private:
|
||||
char * nameOfFileStarting(char * start);
|
||||
char * bodyOfFileStarting(char * start);
|
||||
constexpr static size_t k_totalSize = 4096;
|
||||
constexpr static uint32_t Magic = 0xDEC00DF0;
|
||||
constexpr static uint32_t Magic = 0xDECA0DF0;
|
||||
uint32_t m_dataHeader;
|
||||
char m_data[k_totalSize];
|
||||
uint32_t m_dataFooter;
|
||||
};
|
||||
|
||||
class FileSystemInfo {
|
||||
public:
|
||||
constexpr FileSystemInfo(uint32_t address) :
|
||||
m_header(Magic),
|
||||
m_address(address),
|
||||
m_footer(Magic) { }
|
||||
private:
|
||||
constexpr static uint32_t Magic = 0xDECB0DF0;
|
||||
uint32_t m_header;
|
||||
uint32_t m_address;
|
||||
uint32_t m_footer;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef HEADER_SECTION
|
||||
#define HEADER_SECTION
|
||||
#endif
|
||||
|
||||
#ifndef FORCE_LINK
|
||||
#define FORCE_LINK
|
||||
#endif
|
||||
|
||||
FileSystem f;
|
||||
constexpr FileSystemInfo HEADER_SECTION FORCE_LINK file_system_infos((uint32_t)(&f));
|
||||
|
||||
FileSystem::FileSystem() :
|
||||
m_dataHeader(Magic),
|
||||
m_data(),
|
||||
@@ -13,7 +24,6 @@ FileSystem::FileSystem() :
|
||||
}
|
||||
|
||||
FileSystem * FileSystem::sharedFileSystem() {
|
||||
static FileSystem f;
|
||||
return &f;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
include ion/src/device/boot/Makefile
|
||||
include ion/src/device/bench/Makefile
|
||||
|
||||
escher/src/file_system.o: SFLAGS += -DHEADER_SECTION="__attribute__((section(\".header\")))" -DFORCE_LINK="__attribute__((used))"
|
||||
|
||||
ion/src/shared/software_version.o: SFLAGS += -DHEADER_SECTION="__attribute__((section(\".header\")))"
|
||||
|
||||
objs += $(addprefix ion/src/shared/, \
|
||||
|
||||
Reference in New Issue
Block a user