【问题标题】:cosmos OS problem that "PS/2 is not supported"cosmos OS问题“不支持PS/2”
【发布时间】:2020-12-09 02:08:08
【问题描述】:

我尝试在我的真实计算机上启动 cosmos OS,而不是在虚拟计算机上。 我使用了 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;
        }
    }
}

另外,在 virtualbox 中,没有错误,也没有正常工作。 我该怎么办? 我为我糟糕的英语感到抱歉。我是韩国人。

【问题讨论】:

    标签: c# .net cosmos


    【解决方案1】:

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

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

    您也可以尝试添加

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

    您可以做的最好的事情是尝试安装 Cosmos OS 的最新稳定版本,并在导出后尝试在您的硬件上启动它。如果可能,请尝试使用 CD 启动。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多