Added plug for Multiboot.GetMBIAddress()

This commit is contained in:
Quajak 2020-09-20 17:41:35 +02:00
parent ec840b04a7
commit 0d426695ac
2 changed files with 21 additions and 2 deletions

View file

@ -25,6 +25,7 @@ namespace ProcessorTests
TestVendorNameIsNotBlank(); TestVendorNameIsNotBlank();
TestCycleCount(); TestCycleCount();
TestCycleRateIsNotZero(); TestCycleRateIsNotZero();
TestMultiboot();
TestController.Completed(); TestController.Completed();
} }
@ -36,6 +37,11 @@ namespace ProcessorTests
} }
} }
public void TestMultiboot()
{
Assert.IsTrue(Multiboot.GetMBIAddress() != 0, $"Multiboot.GetMBIAddress works {Multiboot.GetMBIAddress()}");
}
public void TestVendorNameIsNotBlank() public void TestVendorNameIsNotBlank()
{ {
string vendorName = CPU.GetCPUVendorName(); string vendorName = CPU.GetCPUVendorName();

View file

@ -1,12 +1,25 @@
using Cosmos.Core; using Cosmos.Core;
using IL2CPU.API.Attribs; using IL2CPU.API.Attribs;
using XSharp;
using XSharp.Assembler;
namespace Cosmos.Core_Asm namespace Cosmos.Core_Asm
{ {
[Plug(Target = typeof(Multiboot))] [Plug(Target = typeof(Multiboot))]
public class MultibootImpl public class MultibootImpl
{ {
[PlugMethod(Assembler = typeof(MultibootAsm))] [PlugMethod(Assembler = typeof(MultibootImplAsm))]
public static uint GetMBIAddress() => throw null; public static uint GetMBIAddress()
{
return 0;
}
}
public class MultibootImplAsm : AssemblerMethod
{
public override void AssembleNew(Assembler aAssembler, object aMethodInfo)
{
XS.Push("MultibootSignature");
}
} }
} }