如何用汇编语言(linux)写入/读取并行端口?
如何用汇编语言(linux)写入/读取并行端口?
我的计划是
将 LED 从 linux 机器(ubuntu 10.10)连接到并行端口
,写入并行端口。所以我看到 LED 灯亮了。
我想使用汇编的原因是,我可以理解事情是怎么回事。
谢谢
how to write/read to parallel port in assembly language(linux)?
my plan is this
connect LEDs to parallel port
from the linux machine(ubuntu 10.10), write to parallel port. so I see lightened LEDs.
the reason why I want to use assembly is, I can understand how things going on.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,汇编不一定是了解正在发生的事情的方式。我想说这是相反的。
用户进程看不到真正的内存或ioports,它只看到内核的内容
给他看。例如,您的并行端口由内核处理,因此使用它涉及使用系统调用。使用汇编不会让你跨越内核障碍。
如果你想了解发生了什么,也许你应该问自己你真正想知道什么?如果您不知道自己在寻找什么,那么我建议从高级方法开始,然后向下:
内核空间中的系统调用屏障。但这是一个新的故事
如果你想走另一条路,即从下到上,了解CPU如何工作等等......,我建议从更简单的东西开始,比如PIC板。
Well, assembly is not necessarily the way to understand what is going on. I would say it is the contarary.
A user process does not see the real memory or ioports, it only sees what the kernel
show him. For example your parallel port is handled by the kernel, so using it involve using system calls. Using assembly won't get you across the kernel barrier.
I you want to understand what is going on, may be you should ask yourself what you really want to know ? If you don't know what you are looking for, then I suggest starting with a high level approach, and go down :
of the syscall barrier, in kernel space. But then it is a new story
If you want to go the other way, ie from bottom to top, understand how a CPU works etc..., I suggest starting with something much simpler, like a PIC board.