How do you use IOPortBase?

Topics: Compiler, Developing Cosmos (Working on Cosmos source code directly), Using Cosmos (Developing your own OS, projects, etc)
Developer
Nov 7, 2012 at 1:45 PM
Edited Nov 7, 2012 at 1:47 PM

I want to write a  400x300 VGA driver but when i try to compile it says

 'Cosmos.Core.IOPortBase' does not contain a constructor that takes 0 arguments

The code below produces same result.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CosmosKernel1
{
    public class VGA:Cosmos.Core.IOPortBase 
    {

        public static void WriteACR(byte index, byte value)//Write3C0
        {
            Read8(0x3DA);
            Write8(0x3C0, index);
            Write8(0x3C0, value);
        }

     }
}

 

It was much easier to use CPUBus.Write8  and CPUBus.Read8 in Milestone 4. I'm using the lastest release of UserKit.

Coordinator
Nov 7, 2012 at 1:47 PM
you need to instantiate the IOPort....


On Wed, Nov 7, 2012 at 3:45 PM, forest201 <notifications@codeplex.com> wrote:

From: forest201

I want to write a 400x300 VGA driver but when i try to compile it says

'Cosmos.Core.IOPortBase' does not contain a constructor that takes 0 arguments

The code below produces same result.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CosmosKernel1
{
    public class VGA:Cosmos.Core.IOPortBase 
    {

        public static void WriteACR(byte index, byte value)//Write3C0
        {
            Read8(0x3DA);
            Write8(0x3C0, index);
            Write8(0x3C0, value);
        }

     }
}

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


Developer
Nov 7, 2012 at 1:50 PM
Edited Nov 7, 2012 at 1:50 PM

how do you do that?

Coordinator
Nov 8, 2012 at 6:21 AM
I don't have access to the sources, but there should be IOPort8/IOPort16/IOPort32 subclasses of IOPortBase. Those can be instantiated ("new IOPort32(..)"). Have a look at the code to see if there are any parameters involved..


On Wed, Nov 7, 2012 at 3:50 PM, forest201 <notifications@codeplex.com> wrote:

From: forest201

how you do that?

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