diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-27 10:26:31 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-27 10:26:31 +0100 |
| commit | 70e95128b11dbb535e4679cbacb1cbeaa414c822 (patch) | |
| tree | 42fd94536a54058a39f0c85be99431c6ad1a0cf8 /Private/NewBoot/Source/MPT/API.cxx | |
| parent | 44a081a4442181b208c09c6f748124c9d23b61fd (diff) | |
Kernel: Improving AMD64 HAL, Add TIBInstall.asm, currently Working on
SMPManager and Bootloader.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source/MPT/API.cxx')
| -rw-r--r-- | Private/NewBoot/Source/MPT/API.cxx | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Private/NewBoot/Source/MPT/API.cxx b/Private/NewBoot/Source/MPT/API.cxx new file mode 100644 index 00000000..8c649024 --- /dev/null +++ b/Private/NewBoot/Source/MPT/API.cxx @@ -0,0 +1,70 @@ +/* + * ======================================================== + * + * NewBoot + * Copyright 2024 Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ + +#include "API.hxx" +#include "Detail.hxx" + +#define kFilesR 0x01 /* read-only */ +#define kFilesH 0x02 /* hidden */ +#define kFilesS 0x04 /* system */ +#define kFilesL 0x08 /* volume label */ +#define kFilesD 0x10 /* directory */ +#define kFilesZ 0x20 /* archive */ + +// @brief Array of unused bits. +#define kFilesU { 0x40, 0x80 } + +namespace mpt::detail +{ + struct Files32FileHdr final + { + char Filename[32]; + char Ext[3]; + char Attr; + char Case; + char CreateMs; + unsigned short Create; + unsigned short CreateDate; + unsigned short LastAccess; + unsigned short Timestamp; + unsigned short Datestamp; + unsigned short StartLba; + unsigned int SizeFile; + }; + + struct Files32FileGroup final + { + Files32FileHdr* fHdr{ nullptr }; + + Files32FileGroup* fUpper{ nullptr }; + Files32FileGroup* fLower{ nullptr }; + Files32FileGroup* fPrev{ nullptr }; + Files32FileGroup* fNext{ nullptr }; + }; + + /* @brief external inits */ + extern "C" int init_ata_mpt(void); + extern "C" int init_mpt(void); + + Files32FileGroup* kRootGroup = nullptr; +} + +namespace mpt +{ + bool init_mpt() noexcept + { + detail::kRootGroup = detail::new_class<detail::Files32FileGroup>(); + + assert(detail::kRootGroup != nullptr); + assert(detail::init_ata_mpt() == detail::okay); + assert(detail::init_mpt() == detail::okay); + + return true; + } +}
\ No newline at end of file |
