易截截图软件、单文件、免安装、纯绿色、仅160KB

在Linux上配置COM口

在linux系统上同样可以配置串口,使用串口来与其他设备进行通信。
在配置串口前,我们有取得linux系统的root权限,这个很重要。否则无法完成下面步骤。
1.切换到root用户.
[root@localhost ~]#su root
2. 查找有效的串设备.
[root@localhost ~]#cat /proc/devices
Character devices:
  1 mem
  4 /dev/vc/0
  4 tty
  4 ttyS                                    (这个是串口设备)
  5 /dev/tty
  5 /dev/console
  5 /dev/ptmx
  6 lp
  7 vcs
 10 misc
 13 input
 21 sg
 29 fb
128 ptm
136 pts
180 usb
189 usb_device
253 usb_endpoint
254 pcmcia
如果是普通串口设备, 设备名前缀为ttyS, 第一串口为ttyS0, 第二串口为ttyS1,依次类推.
3. 配置ttyS设备
[root@localhost ~]#minicom -s ttyS0
会出现一个configuration窗口,
┌──[configuration]────┐
│ Filenames and paths │
│ File transfer protocols │
│ Serial port setup │                                                 (串口配置选项)
│ Modem and dialing │
│ Screen and keyboard │
│ Save setup as ttyS0 │
│ Save setup as.. │
│ Exit │
│ Exit from Minicom │
└───────────────┘
选择Serial port setup配置. 会出现如下窗口:
┌────────────────────────────────────────────┐
│ A - Serial Device : /dev/ttyS0                               (设备名称)
│ B - Lockfile Location : /var/lock
│ C - Callin Program :
│ D - Callout Program


相关文档:

Linus为什么不用C++写Linux内核?

在最近的一个关于LKML的讨论中,Linus给出了为什么不用C++来写Linux内核的理由:
"In fact, in Linux we did try C++ once already, back in 1992. It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.
“事实上,我们曾经尝试过用C++来写,是在1992年的时候。很糟糕。相信我--用C++来写内核 ......

linux下驱动的入口函数及加载

      几乎每个linux驱动都有个module_init。没错,驱动的加载就靠它。先来分析一下module_init。定义如下:
#define module_init(x)     __initcall(x);              //include\linux\init.h
#define ......

eAccelerator for linux 详解

eaccelerator.shm_size
    The amount of shared memory (in megabytes) that eAccelerator will use.
    "0" means OS default. Default value is "0".
eaccelerator.cache_dir
    The directory that is used for disk cache. eAccelerator stores precompiled code ......

Linux下文件夹操作常用命令

1.删除文件夹用:rmdir 文件夹名
  但是rmdir不能删除非空的文件夹,那如何删除非空文件夹呢:
2.通常情况下,删除文件用:rm 文件名
   -d或--directory  直接把欲删除的目录的硬连接数据删成0,删除该目录。 
 -f或--force  强制删除文件或目录。 
 -i或--interactive  ......

Linux网络编程一步一步学 异步通讯聊天程序select

什么是异步通讯?
就是通讯任意一方可以任意发送消息,有消息来到时会收到系统提示去接收消息。
这里要用到select函数。使用步骤如下:
1、设置一个集合变量,用来存放所有要判断的句柄(file descriptors:即我们建立的每个socket、用open打开的每个文件等)
2、把需要判断的句柄加入到集合里
3、设置判断时间 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号