CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.93k stars 553 forks source link

VGAscreen bug #80

Closed ARMmaster17 closed 9 years ago

ARMmaster17 commented 9 years ago

Trying to write to a VGAscreen throws an error at compile-time:

C:\Program Files\MSBuild\Cosmos\Cosmos.targets(31,5): error : Exception: System.NotImplementedException: OpCode 'Ldobj' not implemented! Encountered in method Void WriteVGARegisters(Byte[])

Here are some excerpts from my code that may be helpful:

VGAscreen vScreen = new VGAscreen();
...
vScreen.SetGraphicsMode(VGAScreen.ScreenSize.Size320x200, VGAScreen.ColorDepth.BitDepth8);
vScreen.Clear(15);
...
public void Draw() // Called every update loop cycle
{
    vScreen.Clear(15);
    vScreen.SetPixel320x200x8((uint)ms.X, (uint)ms.Y, 0);
}

I apologize if I am missing some new feature. I just upgraded from the Codeplex version to the latest release (not source) on GitHub. That's when my code stopped working.

czhower commented 9 years ago

Based on the text of the error, it looks like you are using a release that is 5 or more years old which is absolutely not supported.

ARMmaster17 commented 9 years ago

But I'm using the latest version from GitHub located here: https://github.com/CosmosOS/Cosmos/releases/tag/v0.20150130

czhower commented 9 years ago

@mterwoord - Why are we seeing this old message here instead of the newer one with URL?

ARMmaster17 commented 9 years ago

Here's the full dump from VS: https://gist.github.com/ARMmaster17/943106a53422a6226248

ARMmaster17 commented 9 years ago

Also, I did switch the reference from this:

using Cosmos.Hardware;

to this:

using Cosmos.HAL;

All this on Visual Studio Professional 32-bit 2013 on Win 8.1 Industry Pro (32-bit). Compiled using default settings included in the template with the build option set for VMware.

mterwoord commented 9 years ago

@czhower This is a recent release.

@ARMmaster17 Would you be able to make a pull request? The bug is in our IL interpreter. See https://github.com/CosmosOS/Cosmos/issues/72 for the accompanying stobj bug..

ARMmaster17 commented 9 years ago

@mterwoord Sure, I think I can figure it out. What exactly do I have to do?

mterwoord commented 9 years ago

@ARMmaster17 Have you read issue #72? It's pretty much the same bug, but for a different (but very similar) instruction.

If you want, you can add me to skype. same id..

ARMmaster17 commented 9 years ago

@mterwoord So if I understand this correctly, I just have to redo commit 77f741a1272823419b3f756ea3c16648f7209a1b, but with ldobj instead of stobj? (Except in the VGAscreen file, not PCspeaker.cs)

mterwoord commented 9 years ago

Only the OpType change. One thing though: GetNumberOfStackPops should return 1 instead of 2, and GetNumberOfStackPushes should return 1 instead of 0

ARMmaster17 commented 9 years ago

Ok, pull request has been opened with the changes as PR #81.

mterwoord commented 9 years ago

I'll try to review it soon, or maybe someone else will.. Thanks!