C 中的串行编程,在 DOS 中 [英] Serial programming in C , in DOS

查看:17
本文介绍了C 中的串行编程,在 DOS 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在旧的 16 位 MS-DOS 中用 C 语言进行一些基本的串行编程.我知道基础知识,我编写了一些串行通信.在几十年前的一些微控制器中,但现在这是古老的知识,而且很难找到信息.我正在寻找一些可靠(不一定是免费或开源)的库或代码,以及一般信息.

假设我在 Win7 机器上开发,我也在寻找一些关于如何测试它的说明/建议.例如,如果可以模拟从我的 Win7 机器中的控制台终端到在 DOSBOX 环境中运行我的 DOS 程序的模拟 COM 端口的空调制解调器连接,或者类似的东西.

解决方案

真是巧合.刚刚完成了关于使用它的低级硬件的大学课程.

这些将指导你(滚动你自己的,没有库,不难!):

串口上的课程幻灯片p>

BeyondLogic教程就可以了

使用串口

最后一个是葡萄牙语,但代码示例/表格带有注释,变量名是英文.

祝你好运.

关于模仿.例如,Virtual PC 允许使用文本文件通过虚拟串行端口传输数据.去谷歌上查询.您也可以使用带有 DJGPP 的 Windows 98 来编译它.使用旧的 command.com(基本上是一个独立的 dos 模拟器).您也可以在 MS-DOS 中重新启动.

I need to do some basic serial programming in C, in old 16-bits MS-DOS. I know the basics, i had coded some serial comm. in some microcontroller some decades ago, but that's now ancient knowledge, and it's not so easy to find information. I'm looking for some reliable (not necessarily free or open source) library or code, and general information.

I'm also looking for some instructions/advise about how to test it, assuming I'm developing on a Win7 machine. For example, if it would be possible to emulate a null-modem connection from a console terminal in my Win7 machine to a emulated COM port running my DOS program in a DOSBOX environment, or something like that.

解决方案

What a coincidence. Just finished a college class on low level hardware using it.

These will guide you (rolling your own, no libs, not hard!):

Course slides on serial port

BeyondLogic tutorial on it

Course lab script on the practical project using the serial port

The last one's in Portuguese, but the code samples/tables are commented and with variable names in english.

Good luck.

About emulating. Virtual PC, for example, allows piping of data through a virtual serial port using a text file. Google it. You can also use Windows 98 with DJGPP for compiling this. Use old command.com (which is a self contained dos emulator, basically). You can also restart in MS-DOS.

这篇关于C 中的串行编程,在 DOS 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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