Files
2026-05-03 13:05:55 +04:00

39 lines
790 B
C

// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (c) 2026 0xKSor
#pragma once
#include <Types.h>
#include <VM/PMM.h>
typedef struct FDTHeader {
UInt32 magic; // 0xd00dfeed
UInt32 totalSize;
UInt32 offDtStruct;
UInt32 offDtStrings;
UInt32 offMemRsvMap;
UInt32 version;
UInt32 lastCompVersion;
UInt32 bootCpuidPhys;
UInt32 sizeDtStrings;
UInt32 sizeDtStruct;
} FDTHeader;
typedef struct FDTProperty {
UInt32 length;
UInt32 nameOffset;
} FDTProperty;
typedef enum FDTToken {
FDTTokenBeginNode = 0x1,
FDTTokenEndNode = 0x2,
FDTTokenProperty = 0x3,
FDTTokenNOP = 0x4,
FDTTokenEnd = 0x9,
} FDTToken;
enum {
kFDTHeaderMagic = 0xd00dfeed,
};
void DTBParse(Pointer dtb, VMBootMemoryMap* bootMap);