C# 宇宙问题;不支持PS/2“;

C# 宇宙问题;不支持PS/2“;,c#,.net,cosmos,C#,.net,Cosmos,我试着在我的真实电脑中启动cosmos操作系统,而不是虚拟电脑。 我使用了USB和ISO,但出现了“不支持PS/2控制器”的错误 我没有在调试中构建ISO 源代码是 using System; using System.Collections.Generic; using System.Text; using Sys = Cosmos.System; namespace CosmosKernel2 { public class Kernel : Sys.Kernel {

我试着在我的真实电脑中启动cosmos操作系统,而不是虚拟电脑。 我使用了USB和ISO,但出现了“不支持PS/2控制器”的错误 我没有在调试中构建ISO

源代码是

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;
        }
    }
}
使用系统;
使用System.Collections.Generic;
使用系统文本;
使用Sys=宇宙系统;
命名空间CosmosKernel2
{
公共类内核:Sys.Kernel
{
uint x;
uint y;
Sys.ms;
布尔-梅诺佩内;
帆布罐;
受保护的覆盖在运行前无效()
{
can=FullScreenCanvas.GetFullScreenCanvas();
清晰(系统.图纸.颜色.白色);
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=假;
ms=Sys.MouseState.None;
}
受保护的覆盖无效运行()
{
if((ms==Sys.MouseState.None)和&(Sys.MouseManager.MouseState==Sys.MouseState.Left))
{
uint xx=Sys.MouseManager.X;
uint yy=Sys.MouseManager.Y;
如果((xx<100)和&(yy>(can.Mode.Rows-40)))
{
如果(菜单打开)
{
menuopened=假;
}
其他的
{
menuopened=真;
}
}
}
点[]pn={新点(Convert.ToInt32(Sys.MouseManager.X)、Convert.ToInt32(Sys.MouseManager.Y))、新点(Convert.ToInt32(Sys.MouseManager.X)、Convert.ToInt32(Sys.MouseManager.X+7)、Convert.ToInt32(Sys.MouseManager.Y+12))、新点(Convert.ToInt32(Sys.MouseManager.X+21),Convert.ToInt32(Sys.MouseManager.Y+15));
if(Sys.MouseManager.MouseState==Sys.MouseState.None)
{
can.DrawPolygon(新笔(System.Drawing.Color.Blue,4),pn);
}
其他的
{
can.DrawPolygon(新笔(System.Drawing.Color.Red,4),pn);
}
if((x!=Sys.MouseManager.x)| |(y!=Sys.MouseManager.y))
{
清晰(系统.图纸.颜色.白色);
如果(菜单打开)
{
can.DrawFilledRectangle(新笔(System.Drawing.Color.Black),0,can.Mode.Rows-401001300);
}
can.DrawFilledRectangle(新笔(System.Drawing.Color.品红色),0,can.Mode.Rows-40100,40);
点[]p={新点(Convert.ToInt32(Sys.MouseManager.X),Convert.ToInt32(Sys.MouseManager.Y)),新点(Convert.ToInt32(Sys.MouseManager.X),Convert.ToInt32(Sys.MouseManager.X+7),Convert.ToInt32(Sys.MouseManager.Y+12)),新点(Convert.ToInt32(Sys.MouseManager.X+21),Convert.ToInt32(Sys.MouseManager.Y+15));
点[]po={newpoint(Convert.ToInt32(x),Convert.ToInt32(y)),newpoint(Convert.ToInt32(x),Convert.ToInt32(y+30)),newpoint(Convert.ToInt32(x+7),Convert.ToInt32(y+12)),newpoint(Convert.ToInt32(x+21),Convert.ToInt32(y+15));
if(Sys.MouseManager.MouseState==Sys.MouseState.None)
{
can.DrawPolygon(新笔(System.Drawing.Color.Blue,4),p);
}
其他的
{
can.DrawPolygon(新笔(System.Drawing.Color.Red,4),p);
}
}
x=Sys.MouseManager.x;
y=Sys.MouseManager.y;
ms=Sys.MouseManager.MouseState;
}
}
}
另外,在virtualbox中,没有错误,也不能正常工作。 我该怎么办?
我很抱歉我的英语不好。我是韩国人。

PS/2端口是一个6针迷你DIN接口,用于将键盘和鼠标连接到与PC兼容的计算机系统。你的电脑中有PS/2端口吗?它是否与Cosmos操作系统兼容。通过登录控制台或串行端口检查问题所在。检查PS/2键盘端口上的字节250(0xFA/Success)是否失败,如果失败,复位可能无法正常工作。尝试在ps2controller.cs中使用重置十六进制手动调用SendDeviceCommand

if (!SendDeviceCommand(DeviceCommand.IdentifyDevice, xSecondPort))
{
  return null;
}
您也可以尝试添加

if (xTestByte == 0x00 || xTestByte == 0x50)
{
return true;
}
您可以做的最好的事情是尝试安装最新的稳定版本的Cosmos操作系统,并尝试在导出后在您的硬件上启动它。如果可能,尝试用CD引导