x86 组件上的保护模式键盘访问 [英] Protected Mode Keyboard Access on x86 Assembly

查看:16
本文介绍了x86 组件上的保护模式键盘访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我正在开发的一个非常基本的内核处理键盘输入,但我完全卡住了.我似乎无法在网上找到任何可以显示我需要了解的信息的信息.

I'm working on keyboard input for a very basic kernel that I'm developing and I'm completely stuck. I can't seem to find any information online that can show me the information I need to know.

我的内核现在正在保护模式下运行,所以我无法使用实模式键盘例程而不跳转到实模式并返回,我试图避免这种情况.我希望能够从保护模式访问我的键盘.有谁知道如何做到这一点?到目前为止我发现的唯一一件事是它涉及使用输入/输出端口直接与控制器对话,但除此之外我很难过.当然,这不是经常出现的事情.通常,Assembly 教程假设您正在运行一个操作系统.

My kernel is running in protected mode right now, so I can't use the real mode keyboard routines without jumping into real mode and back, which I'm trying to avoid. I want to be able to access my keyboard from protected mode. Does anyone know how to do this? The only thing I have found so far is that it involves talking to the controller directly using in/out ports, but beyond that I'm stumped. This is, of course, is not something that comes up very often. Normally, Assembly tutorials assume you're running an operating system underneath.

我对 x86 程序集很陌生,所以我只是在寻找一些很好的资源,以便在保护模式下使用标准硬件.我正在用 NASM 编译汇编源代码,并将其链接到用 DJGPP 编译的 C 源代码.有什么建议吗?

I'm very new to the x86 assembly, so I'm just looking for some good resources for working with the standard hardware from protected mode. I'm compiling the Assembly source code with NASM and linking it to the C source code compiled with DJGPP. Any suggestions?

推荐答案

MIT 操作系统类有很多很好的参考.特别是,请查看Adam Chapweske 的键盘和鼠标编程资源.

The MIT operating systems class has lots of good references. In particular, check out Adam Chapweske's resources on keyboard and mouse programming.

简而言之,是的,您将使用原始输入/输出端口,这需要在内核模式下运行,或者在 EFLAGS 寄存器中设置 I/O 权限位 (IOPL).有关 I/O 权限的更多详细信息,请参阅此页面.

In short, yes, you will be using the raw in/out ports, which requires either running in kernel mode, or having the I/O permission bits (IOPL) set in the EFLAGS register. See this page for more details on I/O permissions.

这篇关于x86 组件上的保护模式键盘访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆