This project is read-only.

Drives For Cosmos

Jun 24, 2012 at 10:22 AM

Do Any one of u has ANY COSMOS DRIVERS 

Jun 24, 2012 at 12:34 PM

Umm. There is:

  • Fat Read Support
  • VMWare SVGA
  • AMD Pcnet II
  • VGA Screen

And thats all I think

Jun 26, 2012 at 12:30 PM

Do U HAVE ANY ONE OF ITS CODE 

Jun 26, 2012 at 12:33 PM

I HAVE ONE MOUSE CODE WHICH WORK ON ALL TOUCH PAD , USB & PS2

 

THIS IS MOUSE DRIVER

using System;
using Cosmos.Compiler.Builder;
using Cosmos.Hardware;
using Cosmos.Graphics.Inporter;
                                                     //  ALL RIGHTS GOES TO APBROTHERS@2013 //
                                                    //                 ATOM OS             //
// WRITTEN BY ANKIT PRIYARUP

namespace Atom_OS.Atom.System64.Driver.Mouse.Driver
{
    class MouseProgram
    {
        public static void Mouse ()
        {
            VGAScreen.SetMode320x200x8();           
            Cosmos.Hardware.SystemMouse.SystemMouse.Initialize ();             //Intialize Mouse            
            VGAScreen.SetMode320x200x8();
            VGAScreen.SetPaletteEntry(0, 0, 0, 0);
            VGAScreen.SetPaletteEntry(1, 63, 0, 0);
            VGAScreen.SetPaletteEntry(2, 63, 63, 63);
            VGAScreen.SetPaletteEntry(3, 63, 63, 0);
            VGAScreen.SetPaletteEntry(4, 63, 0, 63);
            VGAScreen.Clear(0);
            uint x = (uint)Cosmos.Hardware.SystemMouse.SystemMouse.X;
            uint y = (uint)Cosmos.Hardware.SystemMouse.SystemMouse.Y;
            uint oc = 0;
            while (true)
            {        
                //Main Graphics Of Mouse
                #region Mouse Data
                uint mx = (uint)Cosmos.Hardware.SystemMouse.SystemMouse.X;
                uint my = (uint)Cosmos.Hardware.SystemMouse.SystemMouse.Y;

                if (mx != x || my != y)
                {
                    //if (Mouse2.Buttons == Mouse2.MouseState.Left)
                    //    VGAScreen.SetPixel320x200x8(x, y, 1);
                    //else
                    VGAScreen.SetPixel320x200x8(x, y, oc);
                    x = mx;
                    y = my;
                    oc = VGAScreen.GetPixel320x200x8(x, y);
                }
                VGAScreen.SetPixel320x200x8(mx, my, 4);
                #endregion
            }
        }            
    }
}


THIS IS MOUSE CODE


using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.Kernel;
                                         //  ALL RIGHTS GOES TO APBROTHERS@2013 //
                                        //                 ATOM OS             //
 // WRITTEN BY ANKIT PRIYARUP
// DEVLOPED BY AMAN PRIYADARSHI
namespace Cosmos.Hardware.SystemMouse
{
    public static class SystemMouse
    {
        public static int X, Y;
        public static MouseState Buttons;
        public static void Initialize()
        {
            //enable mouse
            WaitSignal();
            CPUBus.Write8(0x64, 0xA8);
            // enable interrupt
            WaitSignal();
            CPUBus.Write8(0x64, 0x20);
            WaitData();
            byte status = (byte)(CPUBus.Read8(0x60) | 2);
            WaitSignal();
            CPUBus.Write8(0x64, 0x60);
            WaitSignal();
            CPUBus.Write8(0x60, status);
            //default 
            Write(0xF6);
            Read();  //Acknowledge
            //Enable the mouse
            Write(0xF4);
            Read();  //Acknowledge
            Interrupts.AddIRQHandler(12, new Interrupts.InterruptDelegate(HandleMouse));
        }
        private static byte Read()
        {
            WaitData();
            return CPUBus.Read8(0x60);
        }
        private static void Write(byte b)
        {
            //Wait to be able to send a command
            WaitSignal();
            //Tell the mouse we are sending a command
            CPUBus.Write8(0x64, 0xD4);
            //Wait for the final part
            WaitSignal();
            //Finally write
            CPUBus.Write8(0x60, b);
        }
        private static void WaitData()
        {
            for (int i = 0; i < 1000 & ((CPUBus.Read8(0x64) & 1) == 1); i++)
                ;
        }
        private static void WaitSignal()
        {
            for (int i = 0; i < 1000 & ((CPUBus.Read8(0x64) & 2) != 0); i++)
                ;
        }
        public enum MouseState
        {
            None = 0,
            Left = 1,
            Right = 2,
            Middle = 4
        }
        private static byte mouse_cycle = 0;
        private static int[] mouse_byte = new int[4];
        public static void HandleMouse(ref Interrupts.InterruptContext context)
        {
            switch (mouse_cycle)
            {
                case 0:
                    mouse_byte[0] = CPUBus.Read8(0x60);
                    if ((mouse_byte[0] & 0x8) == 0x8)
                        mouse_cycle++;
                    break;
                case 1:
                    mouse_byte[1] = CPUBus.Read8(0x60);
                    mouse_cycle++;
                    break;
                case 2:
                    mouse_byte[2] = CPUBus.Read8(0x60);
                    mouse_cycle = 0;
                    if ((mouse_byte[0] & 0x10) == 0x10)
                        X -= mouse_byte[1] ^ 0xff;
                    else
                        X += mouse_byte[1];

                    if ((mouse_byte[0] & 0x20) == 0x20)
                        Y += mouse_byte[2] ^ 0xff;
                    else
                        Y -= mouse_byte[2];
                    if (X < 0)
                        X = 0;
                    else if (X > 319)
                        X = 319;
                    if (Y < 0)
                        Y = 0;
                    else if (Y > 199)
                        Y = 199;
                    Buttons = (MouseState)(mouse_byte[0] & 0x7);
                    break;
            }
        }
    }
}

NOW JUST INSERT THIS

Atom_OS.Atom.System64.Driver.Mouse.Driver.MouseProgram.Mouse();

& THE MOUSE WORKS UP

Jun 27, 2012 at 2:09 PM

1) The Mouse already works

2) Stop asking people for source code

3) There is a thing called the Caps Lock key, I think you may have left it on.

Jun 27, 2012 at 2:12 PM

Its completely irrelevant to ask for source on an open source project.

Jul 4, 2012 at 1:26 PM
CMan332 wrote:

1) The Mouse already works

2) Stop asking people for source code

3) There is a thing called the Caps Lock key, I think you may have left it on.

I Want another driver code i mean i have mouse code but i want SVGA,Keyboard & Sound driver

 

Do u have any one then plz send it to me. 

Jul 5, 2012 at 3:18 PM

We already have an SVGA and Keyboard Driver? Though Cosmos doesn't have support for Sound, and no derivatives have got support either as far as I know

Jul 5, 2012 at 3:21 PM

Back in the day we could use the computer speaker a la Console.Beep, but I'm not sure if it works anymore.

Jul 5, 2012 at 3:22 PM
one still can, but it's not implemented in cosmos..


On Thu, Jul 5, 2012 at 4:22 PM, joshbeitler <notifications@codeplex.com> wrote:

From: joshbeitler

Back in the day we could use the computer speaker a la Console.Beep, but I'm not sure if it works anymore.

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


Jul 11, 2012 at 2:58 PM

What are the sound functions under Cosmos.Hardware.PIT for then, I have seen them but never really had time to test them.

Jul 11, 2012 at 3:00 PM
oh, mistakenly assumed it's not implemented then.. :)

On Wed, Jul 11, 2012 at 3:58 PM, LukeTerry <notifications@codeplex.com> wrote:

From: LukeTerry

What are the sound functions under Cosmos.Hardware.PIT for then, I have seen them but never really had time to test them.

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


Jul 11, 2012 at 5:56 PM
On 7/11/2012 10:00 AM, mterwoord wrote:
> oh, mistakenly assumed it's not implemented then.. :)

PIT is in 2 spots..

1) Old kernel which doesnt work any more

2) I started on PIT, but then hit the compiler issues, so Im working on
them now...
Jul 12, 2012 at 11:15 AM

Ah, okay then, just I have a screen class, which uses the PIT as a timer. So should I just get rid of this for now?

Jul 12, 2012 at 2:17 PM
On 7/12/2012 6:15 AM, LukeTerry wrote:
> Ah, okay then, just I have a screen class, which uses the PIT as a
> timer. So should I just get rid of this for now?

Or you could work on the PIT class :)
Jul 15, 2012 at 10:57 PM

Don't mind if I do, I'll send you the source if I can get it working.

Jul 16, 2012 at 12:49 PM
Edited Jul 16, 2012 at 1:19 PM

Okay, I'm having trouble with Interrupts, I need to add a handler to IRQ0 and my code is hanging at:


 

INTs.SetIrqHandler(0x00, handleInterupt);


 

where handleInterupt is "private static void handleInterupt(ref INTs.IRQContext aContext){}"

Am I going about handling this the wrong way?

 


 

Never mind, for some reason the same code compiled the second time without hanging...

Does setting Byte in an IOPort write to the port?

Jul 16, 2012 at 10:56 PM
On 7/16/2012 5:52 PM, LukeTerry wrote:
> From: LukeTerry
>
> Okay, I'm having trouble with Interrupts, I need to add a handler to
> IRQ0 and my code is hanging at:

IRQs are disabled in the current builds.
Jul 16, 2012 at 10:57 PM
Setting Byte writes I think

On 17 July 2012 07:22, LukeTerry <notifications@codeplex.com> wrote:

From: LukeTerry

Okay, I'm having trouble with Interrupts, I need to add a handler to IRQ0 and my code is hanging at:


INTs.SetIrqHandler(0x00, handleInterupt);


where handleInterupt is "private static void handleInterupt(ref INTs.IRQContext aContext){}"

Am I going about handling this the wrong way?


Never mind, for some reason the same code compiled the second time without hanging...

Does setting Byte in an IOPort write to the port?

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


Jul 16, 2012 at 11:25 PM

Well my PIT class may or may not work then, but I think it may do if IRQs are disabled...

Jul 16, 2012 at 11:29 PM
On 7/16/2012 6:25 PM, LukeTerry wrote:
> Well my PIT class may or may not work then, but I think it may do if
> IRQs are disabled...

We'll get to them again in the coming months... they add a lot of
complications to the debugstub.
Jul 16, 2012 at 11:44 PM

Fair enough. I'm not too bothered, I can do without a timer.

Jul 17, 2012 at 8:07 AM
IRQ's in general are not that hard, it's IRQ0 that's a real problem causer: if you end up having an irq handler that is too slow, it'll just hang (or worse, re-enter the irq handler, and very soon stack-overflow)


On Tue, Jul 17, 2012 at 12:44 AM, LukeTerry <notifications@codeplex.com> wrote:

From: LukeTerry

Fair enough. I'm not too bothered, I can do without a timer.

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


Jul 17, 2012 at 9:50 PM

So am I understanding this correctly; because of code in debugging, IRQ0 causes problems due to speed of execution, which could cause problems with system stability?

Jul 17, 2012 at 9:58 PM
On 7/17/2012 4:50 PM, LukeTerry wrote:
> So am I understanding this correctly; because of code in debugging, IRQ0
> causes problems due to speed of execution, which could cause problems
> with system stability?

No, because of reentrancy. we will enable irq handling again soon.
Jul 18, 2012 at 8:27 AM
Reentrancy is that interrupts can occur while other interrupt is being handled. the IRQ0 is a particular "risky" one: if you set PIT to tick once per msec, and the IRQ0 handler takes more than 1msec, it'll re-enter the IRQ0 handler, and again and again, till you get a stackoverflow (we dont check for stack overflow, so you'll get some weird error)

On Tue, Jul 17, 2012 at 10:58 PM, kudzu <notifications@codeplex.com> wrote:

From: kudzu

On 7/17/2012 4:50 PM, LukeTerry wrote:
> So am I understanding this correctly; because of code in debugging, IRQ0
> causes problems due to speed of execution, which could cause problems
> with system stability?

No, because of reentrancy. we will enable irq handling again soon.

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