Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

5)Linux³ÌÐòÉè¼ÆÈëÃÅ

5)Linux³ÌÐòÉè¼ÆÈëÃÅ--ÐźŴ¦Àí
LinuxϵÄÐźÅʼþ
Ç°ÑÔ:ÕâÒ»ÕÂÎÒÃÇÌÖÂÛÒ»ÏÂLinuxϵÄÐźŴ¦Àíº¯Êý.
LinuxϵÄÐźŴ¦Àíº¯Êý:
ÐźŵIJúÉú
ÐźŵĴ¦Àí
ÆäËüÐźź¯Êý
Ò»¸öʵÀý
1¡£ÐźŵIJúÉú
LinuxϵÄÐźſÉÒÔÀà±ÈÓÚDOSϵÄINT»òÕßÊÇWindowsϵÄʼþ.ÔÚÓÐÒ»¸öÐźŷ¢Éúʱ
ºòÏàÐŵÄÐźžͻᷢË͸øÏàÓ¦µÄ½ø³Ì.ÔÚLinuxϵÄÐźÅÓÐÒÔϼ¸¸ö. ÎÒÃÇʹÓà kill -l
ÃüÁî¿ÉÒԵõ½ÒÔϵÄÊä³ö½á¹û:
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD
18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN
22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO
30) SIGPWR
¹ØÓÚÕâЩÐźŵÄÏêϸ½âÊÍÇë²é¿´man 7 signalµÄÊä³ö½á¹û. ÐźÅʼþµÄ·¢ÉúÓÐÁ½¸öÀ´Ô´
:Ò»¸öÊÇÓ²¼þµÄÔ­Òò(±ÈÈçÎÒÃÇ°´ÏÂÁ˼üÅÌ),Ò»¸öÊÇÈí¼þµÄÔ­Òò(±ÈÈçÎÒÃÇʹÓÃϵͳº¯Êý»ò
ÕßÊÇÃüÁî·¢³öÐźÅ). ×î³£ÓõÄËĸö·¢³öÐźŵÄϵͳº¯ÊýÊÇkill, raise, alarmºÍsetit
imerº¯Êý. setitimerº¯ÊýÎÒÃÇÔÚ¼ÆʱÆ÷µÄʹÓà ÄÇÒ»ÕÂÔÙѧϰ.
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
int kill(pid_t pid,int sig);
int raise(int sig);
unisigned int alarm(unsigned int seconds);
killϵͳµ÷ÓøºÔðÏò½ø³Ì·¢ËÍÐźÅsig.
Èç¹ûpidÊÇÕýÊý,ÄÇôÏòÐźÅsig±»·¢Ë͵½½ø³Ìpid.
Èç¹ûpidµÈÓÚ0,ÄÇôÐźÅsig±»·¢Ë͵½ËùÒÔºÍpid½ø³ÌÔÚͬһ¸ö½ø³Ì×éµÄ½ø³Ì
Èç¹ûpidµÈÓÚ-1,ÄÇôÐźŷ¢¸øËùÓеĽø³Ì±íÖеĽø³Ì,³ýÁË×î´óµÄÄĸö½ø³ÌºÅ.
Èç¹ûpidÓÉÓÚ-1,ºÍ0Ò»Ñù,Ö»ÊÇ·¢Ëͽø³Ì×éÊÇ-pid.
ÎÒÃÇÓÃ×î¶àµÄÊǵÚÒ»¸öÇé¿ö.»¹¼ÇµÃÎÒÃÇÔÚÊØ»¤½ø³ÌÄÇÒ»½ÚµÄÀý×ÓÂð?ÎÒÃÇÄǸöʱºòÓÃÕâ
¸öº¯ÊýɱËÀÁ˸¸½ø³ÌÊØ»¤½ø³ÌµÄ´´½¨
raiseϵͳµ÷ÓÃÏò×Ô¼º·¢ËÍÒ»¸ösigÐźÅ.ÎÒÃÇ¿ÉÒÔÓÃÉÏÃæÄǸöº¯ÊýÀ´ÊµÏÖÕâ¸ö¹¦ÄܵÄ.
alarmº¯ÊýºÍʱ¼äÓеã¹ØϵÁË,Õâ¸öº¯Êý¿ÉÒÔÔÚsecondsÃëºóÏò×Ô¼º·¢ËÍÒ»¸öSIGALRMÐźÅ
.. ÏÂÃæÕâ¸öº¯Êý»áÓÐʲô½á¹ûÄØ?
#include <unistd.h>
main()
{
unsigned int i;
alarm(1);
for(i=0;1;i++)
printf("I=%d",i);
}
SIGALRMµÄȱʡ²Ù×÷ÊǽáÊø½ø³Ì,ËùÒÔ³ÌÐòÔÚ1ÃëÖ®ºó½áÊø,Äã¿ÉÒÔ¿´¿´ÄãµÄ×îºóIֵΪ¶àÉÙ
,À´±È½Ïһϴó¼ÒµÄϵͳÐÔÄܲîÒì


Ïà¹ØÎĵµ£º

LinuxÏÂÈçºÎ°ÑIO¿Õ¼äÓ³Éäµ½Óû§½ø³Ì¿Õ¼ä£¿


ÆäʵÊǸöÂù¼òµ¥µÄÎÊÌâ¡£ÔÚLDD3µÄµÚ15ÕÂÉÏÓÐд£¨¼û“Remapping Specific I/O Regions”ÕâÒ»½Ú£©¡£²»¹ýµ±Ê±×÷ÕßÑ¡ÔñÁËÒ»¸ö´íÎóµÄ×ö·¨£ºÏÈ°ÑÕâ¿éIO¿Õ¼äÓÃioremapÓ³Éäµ½ÁËÄں˿ռ䣬ȻºóÔÚÓû§½ø³Ì·ÃÎʱ»Ó³ÉäµÄµØÖ·Ëù²ú ÉúµÄȱҳÖжÏÀÓÃvmalloc_to_pageµÃµ½page£¬·µ»Ø¸øÓû§½ø³Ì¡£
È»¶ø£¬vmalloc_to_pageû·¨Óà ......

ÔÚLinuxÉϽ»²æ±àÒëwindows³ÌÐò

ת×Ô:http://www.cublog.cn/u/12592/showart_163722.html
×î½ü¼¸Ìì¸ã wxWidgets£¬ÓÉÓÚҪͬʱ±àÒëÓ¦ÓóÌÐòµÄ Windows °æ±¾£¬ÓÖÀÁµÃÔÚÐéÄâ»úÀïÃæ±àÒë³ÌÐò£¬ÓÚÊÇÏëµ½Óý»²æ±àÒëµÄ·½Ê½ÔÚ Linux ÉϱàÒëºÃ Windows °æ±¾µÄ³ÌÐò£¬ÔÙÓà Wine »òÕßÐéÄâ»úÀ´Ö´ÐС£ÊÔÁËһϣ¬ÕâÖÖ·½·¨ºÜºÃÓ㬱ÈÔÚÐéÄâ»úÀïÃæ±àÒë³ÌÐò¿ìºÜ¶à¡£
ÎҵIJÙ×÷ ......

Linux»·¾³½ø³Ì¼äͨÐÅ£¨Î壩——¹²ÏíÄÚ´æ

http://www.ibm.com/developerworks/cn/linux/l-ipc/part5/index1.html
¹²ÏíÄÚ´æ¿ÉÒÔ˵ÊÇ×îÓÐÓõĽø³Ì¼äͨÐÅ·½Ê½£¬Ò²ÊÇ×î¿ìµÄIPCÐÎʽ¡£Á½¸ö²»Í¬½ø³ÌA¡¢B¹²ÏíÄÚ´æµÄÒâ˼ÊÇ£¬Í¬Ò»¿éÎïÀíÄÚ´æ±»Ó³Éäµ½
½ø³ÌA¡¢B¸÷×ԵĽø³ÌµØÖ·¿Õ¼ä¡£½ø³ÌA¿ÉÒÔ¼´Ê±¿´µ½½ø³ÌB¶Ô¹²ÏíÄÚ´æÖÐÊý¾ÝµÄ¸üУ¬·´Ö®ÒàÈ»¡£ÓÉÓÚ¶à¸ö½ø³Ì¹²Ïíͬһ¿éÄÚ´æÇøÓò£ ......

linuxÇý¶¯¿ª·¢Ñ§Ï°±Ê¼Ç£¨¶þ£©

                scull µÄMakefile
Makefile½Å±¾ÈçÏÂËùʾ¡£
--------------------------------------------------------------------------------
KERNEL_MAKE := -C /home/zhoumin/hi3511/Hi3511_VSSDK_V1.1.2.1/pub/kbuild-LESS_REL
PWD := $(shell pwd ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ