In Cosmos I received this error saying: Exception: System.Exception: Method GetMBIAddress requires a plug, but none is implemented
See original GitHub issueHere is my most recent build log:
1>------ Build started: Project: CosmosBitmapTest, Configuration: Debug Any CPU ------ 1>CosmosBitmapTest -> C:\Users\elkaa\source\repos\CosmosBitmapTest\CosmosBitmapTest\bin\Debug\netcoreapp2.0\cosmos\CosmosBitmapTest.dll 1>Message: Executing IL2CPU on assembly 1>Message: Kernel Base: Cosmos.System.Kernel 1>Message: Checking target assembly: C:\Users\elkaa\source\repos\CosmosBitmapTest\CosmosBitmapTest\bin\Debug\netcoreapp2.0\cosmos\CosmosBitmapTest.dll 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.FIELD_INFO’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.FIELD_MAPPING’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.AssemblyFile’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.Document’ 1>Detecting fields for type ‘IL2CPU.Debug.Symbols.Method’ 1>IL2CPU : error : Exception: System.Exception: Method GetMBIAddress requires a plug, but none is implemented 1> at Cosmos.IL2CPU.ILScanner.Assemble() in C:\Development\Cosmos\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 988 1> at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable`1 plugsAssemblies) in C:\Development\Cosmos\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 266 1> at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Development\Cosmos\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 200 1>IL2CPU task took 00:00:36.9745550 1>Done building project “CosmosBitmapTest.csproj” – FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I was trying to display a bitmap onto the screen using this example https://github.com/CosmosOS/Cosmos/issues/1434 Here is the source code:
`using Cosmos.Core; using Cosmos.System.FileSystem; using Cosmos.System.FileSystem.VFS; using Cosmos.System.Graphics; using System; using System.Drawing; using Sys = Cosmos.System;
namespace CosmosKernel1 { public class Kernel : Sys.Kernel { Canvas canvas; Bitmap wallpaper;
protected override void BeforeRun()
{
CosmosVFS cosmosVFS = new CosmosVFS();
VFSManager.RegisterVFS(cosmosVFS);
wallpaper = new Bitmap(@"0:\wallpaper.bmp");
canvas = FullScreenCanvas.GetFullScreenCanvas();
canvas.Mode = new Mode(640, 480, ColorDepth.ColorDepth32);
}
protected override void Run()
{
string s = Console.ReadLine();
Console.WriteLine(s);
canvas.Clear();
canvas.DrawImage(wallpaper, 0, 0);
//canvas.DrawString($"Installed RAM:{CPU.GetAmountOfRAM()}MB", new Pen(Color.White), 10, 10);
canvas.DrawFilledRectangle(new Pen(Color.FromArgb(199, 199, 199)), 0, 440, 640, 40);
canvas.DrawFilledRectangle(new Pen(Color.White), 0, 442, 640, 1);
canvas.DrawLine(new Pen(Color.FromArgb(135, 135, 135)), 560, 448, 634, 448);
canvas.DrawLine(new Pen(Color.FromArgb(135, 135, 135)), 560, 448, 560, 474);
canvas.DrawLine(new Pen(Color.FromArgb(255, 255, 255)), 560, 474, 634, 474);
canvas.DrawLine(new Pen(Color.FromArgb(255, 255, 255)), 634, 448, 634, 474 + 1);
Console.ReadKey();
}
}
}`
When I tried to build/compile it I receive an error saying “The system cannot find the file specified”
P.S : What directory or folder do I put the bitmap that i’m using do I put it on my physical PC or my virtual OS ? Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:43 (40 by maintainers)
Top GitHub Comments
By this line of yours:
wallpaper = new Bitmap(Encoding.Default.GetString(text_to_read));
I see you are tring to pass the file context to the Bitmap constructor, but the ctor of Bitmap that takes string expecting path. Probably this is why you are getting illegal characters exception, apart from the corruption comes afterwards.Thank you so much!