2440ƽ̨ÏÂlinux´®¿Ú¿ª·¢Ô´ÂëʾÀý(2440Ë«´®¿Ú¼äͨÐÅ)
/***************************************************************************** ³ÌÐò˵Ã÷£ºÊ¾Àý³ÌÐòÑÝʾÁË2440ƽ̨ÏÂlinux´®¿ÚÓ¦Óÿª·¢£¬¿ÉʵÏÖ2440´®¿Ú2Óë´®¿Ú3µÄͨѶ*** Ó²¼þÉèÖ㺽«2440°å×ÓÉϵĴ®¿Ú2¡¢3TXD¡¢RXD½»²æ¶Ì½Ó*** ±àÒëÔËÐУºÔÚËÞÖ÷»úÉϱàÒë³ÌÐòÔ´Â룬´ò¿ª³¬¼¶ÖÕ¶Ë£¨¿ÉÓë2440½øÐÐÃüÁî½»»¥£©£¬*** ÔÚ2440ƽ̨ÉÏ´ò¿ª´®¿ÚÖÕ¶Ë£¬ÉèÖö˿ÚΪttySAC1£¬B15200£¬8bit DATA*** ½á¹ûÑéÖ¤£ºCom communicate start please send data to me
The data you send back
have reveived data
succeed!and com was closed**************************************************************************/#include<stdio.h>
#include<string.h>
#include<sys/types.h>
#include<errno.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<termio.h>
#include<stdlib.h>int set_opt(int fd,int nSpeed,int nBits,char nEvent,int nStop);int open_port(int fd,int comport); int main(void)
{ int fd;
int nread,i;
char vcCom_start[]="Com communicate start\n";
char vcCom_wait[]="please send data to me\n";
char vcCom_rece[20];
char vcCom_OKmsg[]="have reveived data\n";
char vcCom_over[]="succeed!and com was closed
Ïà¹ØÎĵµ£º
Ubuntu 9.10ÂÒÂë Ò»¡¢rtx 2007°²×° ΪÁËÍÑÀëWindowsµÄ¿àº£,ºÃ²»ÈÝÒ×תµ½UbuntuÏÂÀ´,µ«¹«Ë¾Ò»Ö±Óм¸¸öÈí¼þÖ»ÓÐwindowsÄÜÅÜ,ÏÖÔÚ»ù±¾ÎÒËùÓеŦÄܶ¼ÔÚlinuxÏÂÁË.×îÂé·³µÄ¾ÍÕâ¸öRTX.ÉÏ´ÎÓÐÈËÁôÑÔÎÊÎÒÔõô°²×°,ÏÖÔÚÎҺò»ÈÝÒ׸øËûÕûÎȶ¨ÁË,д¸ö·½·¨ÉÏÀ´. ×¼±¸»·¾³,ÎÒµÄÊÇUbuntu 9.04 ,wine-1.1.25,ÎÒÓõÄRTX°æ±¾Îª2007 Beta0 ......
²é¿´ÎļþÄÚÈݵÄÌØÊâ·½·¨
¡¡¡¡ÏàÐÅ×î»ù±¾µÄcatºÍless,moreÄãÒѾºÜÊìϤÁË£¬Èç¹ûÓÐÌØÊâµÄÒªÇóÄØ£º
1. Èç¹ûÄãÖ»Ïë¿´ÎļþµÄǰ5ÐУ¬¿ÉÒÔʹÓÃheadÃüÁÈ磺
head -5 /etc/passwd
2. Èç¹ûÄãÏë²é¿´ÎļþµÄºó10ÐУ¬¿ÉÒÔʹÓÃtailÃüÁÈ磺
tail -10 /etc/passwd
tail -f /var/log/messages
²ÎÊý-fʹtail²»Í£µØÈ¥¶Á×îеÄÄÚÈÝ£ ......
¼òµ¥½âÊÍÒ»ÏÂipcsÃüÁîºÍipcrmÃüÁî¡£
È¡µÃipcÐÅÏ¢£º
ipcs [-m|-q|-s]
-m Êä³öÓйع²ÏíÄÚ´æ(shared memory)µÄÐÅÏ¢
-q Êä³öÓйØÐÅÏ¢¶ÓÁÐ(message queue)µÄÐÅÏ¢
-s Êä³öÓйؓÕÚ¶ÏÆ÷”(semaphore)µÄÐÅÏ¢
%ipcs -m
ɾ³ýipc
ipcrm -m|-q|-s shm_id
%ipcrm -m 105
ÀýÈ磬ÎÒÃÇÔÚÒÔ0x12345678ΪKEY´´½¨ÁËÒ»¸ö¹ ......
ѧLinuxÒ»Äê¶àÁË£¬¶ÔÇý¶¯µÄ֪ʶһµã¶¼Á˽⣬ÉÏÖÜÂòÁ˱¾¡¶LinuxÉ豸Çý¶¯¡·£¬O'REILLY³ö°æ£¬´òËãѧϰѧϰ¡£Ñ§Ï°¹ýµÄ´óÏÀ£¬Ï£Íû¿ÉÒÔÖ¸µ¼Ö¸µ¼¡£
Ê×ÏÈÏÂÔØLinuxÄںˣ¬°´×÷ÕßµÄ˵·¨£¬Ö»ÒªÊÇlinux-2.6.xxxµÄÄں˶¼¿ÉÒÔ£¬ÎÒµÄÊÇlinux-2.6.33.2¡£ÓÐÎ»ÍøÓÑ˵ÏÂÔØºó×îºÃ½âѹµ½/usr/src/Ŀ¼Ï£¬½âѹ
ÔÚ¹¹½¨ÄÚºËÊ÷ÊDzο¼ÁËÔÊéµÚËÄÕÂ& ......
http://blog.sina.com.cn/s/blog_61869e800100ek8w.html
¶ÁдÎļþ£¬ÊÇ×÷Ϊһ¸ö²Ù×÷ϵͳËùÌṩµÄ×î»ù±¾½Ó¿ÚÖ®Ò»¡£
ÎÒÃǾʹÓдÎļþ¹ý³Ì£ºopen£¬write£¬closeÕ⼸¸ö½Ó¿ÚÀ´ËµÆð£¬ÃèÊöдÎļþµÄÄÇЩʶù¡£
ƽʱ£¬ÎÒÃÇ×öÓ¦ÓóÌÐòµÄʱºò£¬³£³£Óõ½¶ÁдÎļþµÄº¯Êý½Ó¿Ú£¬¾ÍÄÃдÎļþÀ´Ëµ£¬ÎÒÃÇÓÃC/C++±àдʱ£¬Óõ½ÁËÒÔϵĺ¯Êý½Ó¿Ú£ ......