Merge pull request #1481 from CosmosOS/multiboot_plug

Added plug for Multiboot.GetMBIAddress()
This commit is contained in:
Quajak 2020-10-15 19:59:56 +02:00 committed by GitHub
commit 25639bc279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View file

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

View file

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