如何与C中的硬件设备通信 [英] How to talk to hardware devices in C

查看:54
本文介绍了如何与C中的硬件设备通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用C(非C ++)编程时如何将信息发送到

硬件设备,如视频卡或调制解调器?这是如何在Linux C编程与Microsoft C编程中完成的?

When programming in C (not C++) how does one send information to a
hardware device such as a video card or modem? How is this done in
Linux C programming versus Microsoft C programming?

推荐答案

x01001x写道:
x01001x wrote:

用C(非C ++)编程时如何将信息发送到

硬件设备,如视频卡或调制解调器?这是如何在Linux C编程与Microsoft C编程中完成的?
When programming in C (not C++) how does one send information to a
hardware device such as a video card or modem? How is this done in
Linux C programming versus Microsoft C programming?



与硬件接口几乎总是架构和操作系统特定于
,因此不属于该组。您可以尝试使用

组,例如< news:comp.os.linux.development.appsor

< news:comp.os.ms-windows。 programmer.win32or< news:comp.arch> ;.

Interfacing with hardware is almost always architecture and operating system
specific and is thus off-topic to this group. You might try a group for
your system like <news:comp.os.linux.development.appsor
<news:comp.os.ms-windows.programmer.win32or <news:comp.arch>.




" x01001x" < xe **** @ softhome.netwrote in message

news:11 ********************** @ b79g2000hse.googlegr oups.com ...

"x01001x" <xe****@softhome.netwrote in message
news:11**********************@b79g2000hse.googlegr oups.com...

用C(非C ++)编程时如何将信息发送到

硬件设备,例如显卡或调制解调器?这是如何在

Linux C编程与Microsoft C编程中完成的?
When programming in C (not C++) how does one send information to a
hardware device such as a video card or modem? How is this done in
Linux C programming versus Microsoft C programming?



以同样的方式,基本上。

让第三方,也许是操作系统的作者或者其他人,生成一个可以调用C / C的库,使硬件能够做到。例如,在
Linux下你可以调用Xlib来打开一个窗口并在其上绘制像素。


如果你问如何实现类似Xlib本身的东西,答案是

混合使用C和汇编程序,可能写入视频内存

垂直回扫中断或类似 - 我不再确切知道它是怎么回事< br $> b $ b完成。


-

免费游戏和编程好东西。
http://www.personal.leeds.ac.uk/~bgy1mm

In the same way, essentially.
Let a third party, maybe the OS authors or maybe someone else, produce a
C-callable library that makes the hardware do things. For instance under
Linux you can call Xlib to open a window and draw pixels on it.

If you are asking how to implement something like Xlib itself, the answer is
with a mixture of C and assembler, that maybe writes to the video memory on
vertical retrace interrupts or similar - I no longer know exactly how it is
done.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm



与硬件的接口几乎总是架构和操作系统

具体,因此不属于主题对这个群体。您可以尝试使用

组,例如< news:comp.os.linux.development.appsor

< news:comp.os.ms-windows。 programmer.win32or< news:comp.arch>。
Interfacing with hardware is almost always architecture and operating system
specific and is thus off-topic to this group. You might try a group for
your system like <news:comp.os.linux.development.appsor
<news:comp.os.ms-windows.programmer.win32or <news:comp.arch>.



你真的很坚定。

我一路走到神圣的comp.lang.c并问了一个特定的

关于向硬件发送DIRECT通信的问题,你给我带来了什么?

GEEZ只是给我一个有用的C命令或什么东西!即使是一个BASH

命令,比如cat post> / dev / null也会比这更有用。


看看,在更专业的IT世界中,我们保留了有关硬件代码直接通信的问题



我明白这就是硬件抽象层的问题。它是
是安全的问题。


Cmon家伙,我甚至告诉你2个主要的硬件,调制解调器和

视频卡。

我不会给你们任何一种设备的特定规格,

除了说我说的调制解调器会像一个28.8

的调制解调器。


我们发现了这个问题。请提供有关

如何从硬件制造商处获得这些库的信息或

Microsoft corp。显然,对于linux来说这很容易,如果我们想要学习新的东西,我们应该更多地关注微软。另外,有关库中包含的功能的信息是否更多

经常以硬拷贝或ASCII文件打印?


我可以获得调用USRobotics / 3Com或Microsoft的调用脚本吗?

你们都能按照我的想法思考吗?

You''ve really GOT to be nuts.
I came all the way to the holy comp.lang.c and asked a SPECIFIC
question about sending DIRECT communication to hardware and you give
me that?
GEEZ just throw me a useful C command or something! Even a BASH
command like cat post >/dev/null would be more useful than that.

LOOK, in the more professional world of IT, we have reserved issues
concerning the DIRECT COMMUNICATION of code to hardware.
I understand this is what concerns the HARDWARE ABSTRACTION LAYER. It
is a matter of SECURITY.

Cmon guy, I even told you the 2 main pieces of hardware, modems and
video cards.
I''m not going to give you guys a specific spec of either device,
except to say I am talking about a modem that would work like a 28.8
modem.

We''ve found this regards libraries. Please give information regarding
how to obtain these libaries from either hardware manufacturers or
Microsoft corp. Obviously, this is so easy for linux we should focus
more on Microsoft if we want to learn something new. Also, is the
information regarding the functions contained in the libaries more
often printed in hard-copy, or in an ASCII file?

Can I get a call script for calling USRobotics/3Com or Microsoft? Are
you all able to follow my train of thought?


这篇关于如何与C中的硬件设备通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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