cosmos OS problem that "PS/2 is not supported"

271 views Asked by At

I tried to boot cosmos OS in my real computer, not virtual computer. I used USB and ISO, but there was error that "PS/2 controller is not supported." I didn't build ISO in debugging.

source code is

using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;

namespace CosmosKernel2
{
    public class Kernel : Sys.Kernel
    {
        uint x;
        uint y;
        Sys.MouseState ms;
        bool menuopened;
        Canvas can;
        protected override void BeforeRun()
        {
            can = FullScreenCanvas.GetFullScreenCanvas();
            can.Clear(System.Drawing.Color.White);
            Sys.MouseManager.ScreenHeight = Convert.ToUInt32(can.Mode.Rows);
            Sys.MouseManager.ScreenWidth = Convert.ToUInt32(can.Mode.Columns);
            Sys.MouseManager.X = 0;
            Sys.MouseManager.Y = 0;
            menuopened = false;
            ms = Sys.MouseState.None;
        }

        protected override void Run()
        {
            if ((ms == Sys.MouseState.None) && (Sys.MouseManager.MouseState == Sys.MouseState.Left))
            {
                uint xx = Sys.MouseManager.X;
                uint yy = Sys.MouseManager.Y;
                if ((xx < 100) && (yy > (can.Mode.Rows - 40)))
                {
                    if (menuopened)
                    {
                        menuopened = false;
                    }
                    else
                    {
                        menuopened = true;
                    }
                }
            }
            Point[] pn = { new Point(Convert.ToInt32(Sys.MouseManager.X), Convert.ToInt32(Sys.MouseManager.Y)), new Point(Convert.ToInt32(Sys.MouseManager.X), Convert.ToInt32(Sys.MouseManager.Y + 30)), new Point(Convert.ToInt32(Sys.MouseManager.X + 7), Convert.ToInt32(Sys.MouseManager.Y + 12)), new Point(Convert.ToInt32(Sys.MouseManager.X + 21), Convert.ToInt32(Sys.MouseManager.Y + 15)) };
            if (Sys.MouseManager.MouseState == Sys.MouseState.None)
            {
                can.DrawPolygon(new Pen(System.Drawing.Color.Blue, 4), pn);
            }
            else
            {
                can.DrawPolygon(new Pen(System.Drawing.Color.Red, 4), pn);
            }
            if ((x != Sys.MouseManager.X) || (y != Sys.MouseManager.Y))
            {
                can.Clear(System.Drawing.Color.White);
                if (menuopened)
                {
                    can.DrawFilledRectangle(new Pen(System.Drawing.Color.Black), 0, can.Mode.Rows - 40, 100, 300);
                }
                can.DrawFilledRectangle(new Pen(System.Drawing.Color.Magenta), 0, can.Mode.Rows - 40, 100, 40);
                Point[] p = { new Point(Convert.ToInt32(Sys.MouseManager.X), Convert.ToInt32(Sys.MouseManager.Y)), new Point(Convert.ToInt32(Sys.MouseManager.X), Convert.ToInt32(Sys.MouseManager.Y + 30)), new Point(Convert.ToInt32(Sys.MouseManager.X + 7), Convert.ToInt32(Sys.MouseManager.Y + 12)), new Point(Convert.ToInt32(Sys.MouseManager.X + 21), Convert.ToInt32(Sys.MouseManager.Y + 15)) };
                Point[] po = { new Point(Convert.ToInt32(x), Convert.ToInt32(y)), new Point(Convert.ToInt32(x), Convert.ToInt32(y + 30)), new Point(Convert.ToInt32(x + 7), Convert.ToInt32(y + 12)), new Point(Convert.ToInt32(x + 21), Convert.ToInt32(y + 15)) };
                if (Sys.MouseManager.MouseState == Sys.MouseState.None)
                {
                    can.DrawPolygon(new Pen(System.Drawing.Color.Blue, 4), p);
                }
                else
                {
                    can.DrawPolygon(new Pen(System.Drawing.Color.Red, 4), p);
                }

            }
            x = Sys.MouseManager.X;
            y = Sys.MouseManager.Y;
            ms = Sys.MouseManager.MouseState;
        }
    }
}

Also, in virtualbox, There's not error and it's not working properly. What should i do? I'm sorry for my poor English. I'm Korean.

1

There are 1 answers

0
Zahid Wadiwale On

The PS/2 port is a 6-pin mini-DIN connector used for connecting keyboards and mice to a PC compatible computer system. Do you have PS/2 port in your pc and is it compatible with Cosmos OS. check by logging on the console or serial port where is the problem. Check if byte 250 (0xFA / Success) on the PS/2 Keyboard port failed, if so reset may be not working correctly. Try manually calling SendDeviceCommand with the reset hex in ps2controller.cs

if (!SendDeviceCommand(DeviceCommand.IdentifyDevice, xSecondPort))
{
  return null;
}

You can also try adding

if (xTestByte == 0x00 || xTestByte == 0x50)
{
return true;
}

The best thing you can do is try installing latest stable release of Cosmos OS and try to boot it on your hardware after exporting it. If possible try booting with a CD.