Hi all!
This is a very preliminary development of an application that can run alone in the machine. Not exactly an OS, but close to that, and can deploy any object that don't need Windows API.
For this purpose a new platform is requiered: PLATFORM_KERNEL (KRN64). Now mainly for direct memory allocation:
MemAlloc macro MemSize:req, Flags:=<MEM_DEFAULT>
if TARGET_PLATFORM eq PLATFORM_WINDOWS
· · ·
invoke HeapAlloc, hProcessHeap, $$MemAttr, MemSize
elseif TARGET_PLATFORM eq PLATFORM_UEFI
· · ·
invoke MemAlloc_UEFI, Flags, MemSize, PLATFORM_UEFI_MEMORY
elseif TARGET_PLATFORM eq PLATFORM_KERNEL
invoke MemAlloc_HOS, Flags, MemSize, NULL
endif
· · ·
endm
Memory management is totally elemental. Only one memory section is used. In this machine that is 7.46GB, then not a big problem now

To test scheme is:
e:\efi\boot\BOOTX64.efi
e:\PlotKern.efi
A basic article was very usefull:
Building an UEFI x64 kernel from scratch: A long trip to userspaceLoader is a KNNSpeed classic:
https://github.com/ASMHSE/2018-UEFI-Bootloader Memory management take the idea from
https://github.com/JoverZhang/deliciOS, but I think that don't work like expected.
Regards, HSE.