将数据写入I/O地址

发布于 2024-11-27 10:39:03 字数 247 浏览 0 评论 0原文

我有一个设备(现金抽屉),我想直接与该设备通信。我知道它在地址 f1 上。 openbit 也是 01。

据我所知,到目前为止,我需要将 1 发送到内存地址 f1,现金抽屉应该打开。虽然使用 asm,但我遇到了访问冲突。然后我又读到 Windows 不允许您直接与设备 I/O 地址通信(需要使用 win)。将数据发送到该地址的正确方法是什么? 请注意,我无法使用驱动程序,因为我无法与应用程序内的驱动程序通信。 操作。系统是win7。

提前致谢!

i have a device (cash drawer) and i would like to directly communicate with the device. I know that its on address f1. Also openbit is 01.

As i've understood so far, i'd need to send 1 to memory address f1 and the cash drawer should open. Though using asm, i get access violation. Then again i've read that windows does not let you communicate directly to device i/o addresses (need to use win). What would be the correct way to send the data to that address.
Note that i cannot use drivers, because i can't communicate with the driver inside my application.
Op. system is win7.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

紫瑟鸿黎 2024-12-04 10:39:03

有一个名为 inpout32.dll 的库,允许直接端口访问,您可以在这里找到它

http:// /logix4u.net/Inpout32.dll_Discussion/write_DELPHI_for_inpout32.dll.html

但是我不知道是否支持windows 7。

There was a library called inpout32.dll that allowed direct port access you can find it here

http://logix4u.net/Inpout32.dll_Discussion/write_DELPHI_for_inpout32.dll.html

But i don't know if supports windows 7.

ˉ厌 2024-12-04 10:39:03

除了上面的优秀建议之外,请查看 这个用于编写和阅读的 Delphi 代码输入/输出。我们已经使用 GWIOPM 来完成您所要求的操作,但请注意,对于 32 位版本的 Windows 直至 W7 等都可以(大多数“免费”驱动程序都是如此)。对于 64 位 Windows,您需要签名的内核驱动程序。目前可用的东西很少。我们必须自己编写。

In addition to the excellent suggestions above, check out this delphi code for writing and reading I/O. We have used the GWIOPM to do what you are asking, but note that it will be ok for 32-bit versions of Windows up to W7 etc (as is the case for most 'free' drivers). For 64-bit Windows you need a signed kernel driver. For this there are few things available at the moment. We had to write our own.

々眼睛长脚气 2024-12-04 10:39:03

为什么您无法通过应用程序与驱动程序通信?这是 Ring 3 应用程序以安全方式与硬件对话的最佳方式。

但是,如果您确实坚持使用驱动程序,您可以尝试拨打 0 并进行直接访问。这比以前的 Windows 版本(XP 及之前的版本)要困难得多,但这是可能的。我自己没有这样做,因为我没有 Windows 7,但你可以尝试在任何地方的 asm 编程论坛中提问。

Why can't you communicate with the driver from your application? It's the best way for ring 3 application to talk with hardware in a safe manner.

However, if you really insist using drivers, you can try going to ring 0 and do direct access. It's much harder than in previous Windows versions (XP and before) but it's possible. I haven't done it myself since I don't have Windows 7, but you can try asking in asm programming forum anywhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文