Problem with my first OS with pixel

Aug 23, 2010 at 3:18 PM

I have a problem with my OS. Its my first try to set a pixel on the screen. But I have 2 errors. It says that cosmos.hardware.vgascreen has no definition for Clear and  setPixel320x200x8. What is wrong?

using System;
using Cosmos.Hardware;
using Cosmos.Sys;
using Cosmos.Compiler.Builder;

namespace dein_OS
{
    class Program
    {
        #region Cosmos Builder logic
        // Most users wont touch this. This will call the Cosmos Build tool
        [STAThread]
        static void Main(string[] args)
        {
            BuildUI.Run();
        }
        #endregion

        // Main entry point of the kernel
        public static void Init()
        {
            var xBoot = new Cosmos.Sys.Boot();
            xBoot.Execute();
            VGAScreen.SetMode320x200x8();
            VGAScreen.SetPaletteEntry(0, 0, 0, 0);
            VGAScreen.SetPaletteEntry(1, 0, 50, 0);
            VGAScreen.Clear(0);
            uint x = 100;
            uint y = 100;
            while (true)
            {
                VGAScreen.setPixel320x200x8(x, y, 1);

            }
        }
    }
}

Coordinator
Aug 24, 2010 at 4:04 PM
Edited Aug 24, 2010 at 4:07 PM

MS5 or dev kit?

 

EDIT: Also test if allowing your project to use unsafe code fixes it.

 

EDIT2:

VGAScreen.setPixel320x200x8(x, y, 1);

needs a CAPITAL S

Aug 24, 2010 at 4:10 PM

I have MS4, its now working, i reinstalled everything. MY new question is, how i can draw a picrure.

I used this code (this is only the code i used for the picture) but i still get errors:

uint[] symbol =
{
0, 1, 1, 1, 0,
1, 2, 2, 2, 1,
1, 2, 2, 2, 1,
1, 2, 2, 2, 1,
0, 1, 1, 1, 0
};

for(int i = 0; i < 6; i++)
{
for(int t = 0, count = 0; t < 8; t++, count++)
{
if (symbol[count] == 0) VGAScreen.SetPixel320x200x8(x + t, y + i, 1);
}
}

My errors are: (Im using the german version of MS VC# 2008, i translated the errors. Maybe ive translated it wrong)

1. The best match for the overloaded Cosmos.Hardware.VGAScreen.SetPixel320x200x8 uint (uint, uint) - method has some invalid arguments

2. first argument: Can not be of "long" in "uint" converts

3. second argument: Can not be of "long" in "uint" converts

Coordinator
Aug 24, 2010 at 4:11 PM
Neither of the 2, as both devkit and MS5 use a different project structure..

On Tue, Aug 24, 2010 at 5:04 PM, smremde <notifications@codeplex.com> wrote:

From: smremde

MS5 or dev kit?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Aug 25, 2010 at 12:27 PM

 

1. The best match for the overloaded Cosmos.Hardware.VGAScreen.SetPixel320x200x8 uint (uint, uint) - method has some invalid arguments

2. first argument: Can not be of "long" in "uint" converts

3. second argument: Can not be of "long" in "uint" converts

The error message is a huge clue here. We are not here to teach you to program.

The function accepts argument of type uint, NOT long. Explicitly convert them to uint.

I'm guessing your x and y variables are longs. 

 

Coordinator
Aug 25, 2010 at 6:11 PM
Stephen and deinOS:
 
the variables are not explicitly typed long, but doing "uint+int" results in long on .net..



On Wed, Aug 25, 2010 at 1:27 PM, smremde <notifications@codeplex.com> wrote:

From: smremde


 

1. The best match for the overloaded Cosmos.Hardware.VGAScreen.SetPixel320x200x8 uint (uint, uint) - method has some invalid arguments

2. first argument: Can not be of "long" in "uint" converts

3. second argument: Can not be of "long" in "uint" converts

The error message is a huge clue here. We are not here to teach you to program.

The function accepts argument of type uint, NOT long. Explicitly convert them to uint.

I'm guessing your x and y variables are longs. 

 

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 28, 2010 at 2:25 AM

I see your problem there. Simply change the ints in the for statement to uints. That should fix it ;)