XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESystem

【Rust】XFE系统,基于Rust和汇编

公开
关注 0 Fork 0 Star 0
UTF-8
using System.Text;

namespace XFESystem.NativeKernel;

internal static class HardwareNotInvoked
{
    public static int Attempts;
    public static InvalidOperationException Fail() { Attempts++; return new("Hardware paths are forbidden in host firmware fixture tests."); }
}
public static class PhysicalMemory
{
    public static ulong Allocate() => throw HardwareNotInvoked.Fail();
    public static ulong ToVirtual(ulong physical) => throw HardwareNotInvoked.Fail();
}
public static class VirtualMemory
{
    public static ulong MapDeviceReadOnly(ulong physical, ulong bytes) => throw HardwareNotInvoked.Fail();
    public static bool UnmapDevice(ulong address, ulong bytes) => throw HardwareNotInvoked.Fail();
}
public static class Serial
{
    public static readonly StringBuilder Text = new();
    public static void Write(string text) => Text.Append(text);
    public static void Line(string text) => Text.AppendLine(text);
    public static void Number(ulong number) => Text.Append(number);
    public static void Hex(ulong number) => Text.Append(number.ToString("x"));
}