35#define kBKBootFileMime "boot-x/file"
36#define kBKBootDirMime "boot-x/dir"
184template <
typename BootDev>
209#if defined(BOOTZ_EPM_SUPPORT)
226 writer.
Write(
"BootZ: EPM Partition found.\r");
240 writer.
Write(
"BootZ: GPT Partition found.\r");
244 writer.
Write(
"BootZ: No Partition found.\r");
258template <
typename BootDev>
260#if defined(BOOTZ_EPM_SUPPORT)
263 const auto kFsName =
"NeKernel";
264 const auto kBlockName =
" NeKernelOS";
269 epm_boot->
SectorSz = BootDev::kSectorSize;
287 writer.
Write(L
"BootZ: Drive is EPM formatted.\r");
288#elif defined(BOOTZ_GPT_SUPPORT)
299 gpt_part->
CRC32 = 0x00000000;
307 gpt_part->
Guid.Data1 = 0x00000000;
308 gpt_part->
Guid.Data2 = 0x0000;
309 gpt_part->
Guid.Data3 = 0x0000;
328 writer.
Write(L
"BootZ: Drive is GPT formatted.\r");
#define NE_COPY_DELETE(KLASS)
Definition Detail.h:13
struct EfiHandle * EfiHandlePtr
Core Handle Kind Self is like NT's Win32 HANDLE type.
#define kGPTPartitionTableLBA
Definition GPT.h:16
#define kMagicGPT
Definition GPT.h:15
#define kSectorAlignGPT_PartTbl
Definition GPT.h:12
#define kNeFSCatalogNameLen
Definition NeFS.h:32
Purpose of this file is to help port libs into the bootloader.
#define CopyMem(dst, src, sz)
Definition Support.h:49
#define SetMem(dst, c, sz)
Definition Support.h:47
#define StrLen(src)
Definition Support.h:50
#define StrCmp(dst, src)
Definition Support.h:51
#define BOOTLOADER_VERSION
Definition Version.h:5
Bootloader Version String.
Definition BootKit.h:153
static const CharacterTypeASCII * The()
Definition BootKit.h:155
BootKit File Reader class Reads the Firmware Boot partition and filesystem.
Definition BootKit.h:106
VoidPtr Blob()
blob getter.
Definition BootFileReader.cc:169
BootTextWriter mWriter
Definition BootKit.h:144
Int32 mErrorCode
Definition BootKit.h:141
VoidPtr mBlob
Definition BootKit.h:142
@ kNoSuchEntry
Definition BootKit.h:118
@ kIsDirectory
Definition BootKit.h:119
@ kNotSupported
Definition BootKit.h:116
@ kEmptyDirectory
Definition BootKit.h:117
@ kOperationOkay
Definition BootKit.h:115
@ kCount
Definition BootKit.h:121
@ kTooSmall
Definition BootKit.h:120
BootFileReader & operator=(const BootFileReader &)=default
BootFileReader(const CharacterTypeUTF16 *path, EfiHandlePtr ImageHandle)
Definition BootFileReader.cc:34
~BootFileReader()
Definition BootFileReader.cc:90
Void ReadAll(SizeT until, SizeT chunk=kib_cast(4), UIntPtr out_address=0UL)
Reads all of the file into a buffer.
Definition BootFileReader.cc:114
CharacterTypeUTF16 mPath[kPathLen]
Definition BootKit.h:143
EfiFileProtocol * mRootFs
Definition BootKit.h:147
UInt64 mSizeFile
Definition BootKit.h:146
UInt64 & Size()
Definition BootFileReader.cc:175
EfiFileProtocol * mFile
Definition BootKit.h:145
Int32 & Error()
error code getter.
Definition BootFileReader.cc:163
BootFileReader(const BootFileReader &)=default
BootKit Text Writer class Writes to UEFI StdOut.
Definition BootKit.h:63
BootTextWriter & operator<<(T elem)
Definition BootKit.h:74
BootTextWriter & operator=(const BootTextWriter &)=default
BootTextWriter(const BootTextWriter &)=default
BootTextWriter & WriteCharacter(CharacterTypeUTF16 c)
putc wrapper over EFI ConOut.
Definition BootTextWriter.cc:109
~BootTextWriter()=default
BootTextWriter & _Write(const UInt64 &num)
Definition BootTextWriter.cc:134
BootTextWriter & Write(const UInt64 &num)
Definition BootTextWriter.cc:123
Bootloader Thread class.
Definition BootThread.h:19
@ kEPMNeKernel
BSD on EPM.
Definition EPM.h:104
#define kEPMRevisionBcd
!
Definition EPM.h:56
#define kEPMMagic
Definition EPM.h:47
EPM_GUID kEPMNilGuid
Definition EPM.h:110
#define kEPMBootBlockLba
!
Definition EPM.h:59
Framebuffer helpers.
Definition BootKit.h:42
void ThrowError(const WideChar *errorCode, const WideChar *reason)
Definition API.h:60
Kernel::SizeT BSetMem(CharacterTypeASCII *src, const CharacterTypeASCII byte, const Kernel::SizeT len)
Definition BootString.cc:65
char8_t CharacterTypeUTF8
Definition BootKit.h:55
Kernel::SizeT BCopyMem(CharacterTypeUTF16 *dest, CharacterTypeUTF16 *src, const Kernel::SizeT len)
BUGS: 0.
Definition BootString.cc:22
Char * PEFImagePtr
Definition BootKit.h:50
Char * PEImagePtr
Definition BootKit.h:51
UInt8 * BlobType
Definition BootKit.h:150
WideChar CharacterTypeUTF16
Definition BootKit.h:53
Char CharacterTypeASCII
Definition BootKit.h:54
Kernel::SizeT BStrLen(const CharacterTypeUTF16 *ptr)
String length functions.
Definition BootString.cc:34
UPS inline definitions.
Definition Device.h:12
char Char
Definition Config.h:51
void Void
Definition Config.h:87
__UINT8_TYPE__ UChar
Definition Config.h:54
__UINT16_TYPE__ UInt16
Definition Config.h:40
__SIZE_TYPE__ SizeT
Definition Config.h:60
__UINT8_TYPE__ UInt8
Definition Config.h:55
__UINT32_TYPE__ UInt32
Definition Config.h:44
void * VoidPtr
Definition Config.h:33
__INT32_TYPE__ Int32
Definition Config.h:38
bool Boolean
Definition Config.h:49
__UINTPTR_TYPE__ UIntPtr
Definition Config.h:62
__UINT64_TYPE__ UInt64
Definition Config.h:48
wchar_t WideChar
Definition Config.h:77
bool Bool
Definition Config.h:50
The EPM boot block.
Definition EPM.h:80
Kernel::Char Name[kEPMNameLength]
Definition EPM.h:82
Kernel::Int64 LbaStart
Definition EPM.h:87
Kernel::Int64 LbaEnd
Definition EPM.h:88
Kernel::Char Fs[kEPMFilesystemLength]
Definition EPM.h:92
Kernel::Int32 FsVersion
Definition EPM.h:91
EPM_GUID Guid
Definition EPM.h:83
Kernel::Int32 Version
Definition EPM.h:84
Kernel::Int64 SectorSz
Definition EPM.h:86
Kernel::Int64 NumBlocks
Definition EPM.h:85
Kernel::Int16 Kind
Definition EPM.h:89
Kernel::Char Magic[kEPMMagicLength]
Definition EPM.h:81
UInt64 FirstGPTEntry
Definition GPT.h:30
UInt32 NumPartitionEntries
Definition GPT.h:34
UInt64 LBAAltHeader
Definition GPT.h:29
UInt32 HeaderSize
Definition GPT.h:25
Char Signature[kMagicLenGPT]
Definition GPT.h:23
EFI_GUID Guid
Definition GPT.h:32
UInt64 StartingLBA
Definition GPT.h:33
UInt32 Revision
Definition GPT.h:24
UInt32 Reserved1
Definition GPT.h:27
UInt32 SizeOfEntries
Definition GPT.h:35
UInt32 CRC32PartEntry
Definition GPT.h:36
UInt64 LBAHeader
Definition GPT.h:28
UInt32 CRC32
Definition GPT.h:26
UInt64 LastGPTEntry
Definition GPT.h:31
UInt8 Reserved2[kSectorAlignGPT_PartTbl]
Definition GPT.h:37