¶Ô±È£ºLinuxºÍWindowsϵͳÏ̼߳äµÄÇø±ð
¶Ô±È£ºLinuxºÍWindowsϵͳÏ̼߳äµÄÇø±ð
ÊìϤWIN32±à³ÌµÄÈËÒ»¶¨ÖªµÀ£¬WIN32µÄ½ø³Ì¹ÜÀí·½Ê½ÓëLinuxÉÏÓÐןܴóÇø±ð£¬ÔÚUNIXÀֻÓнø³ÌµÄ¸ÅÄµ«ÔÚWIN32ÀïÈ´»¹ÓÐÒ»¸ö"Ïß³Ì"µÄ¸ÅÄÄÇôLinuxºÍWIN32ÔÚÕâÀ﾿¾¹ÓÐ×ÅʲôÇø±ðÄØ£¿
WIN32ÀïµÄ½ø³Ì/Ïß³ÌÊǼ̳Ð×ÔOS/2µÄ¡£ÔÚWIN32À"½ø³Ì"ÊÇÖ¸Ò»¸ö³ÌÐò£¬¶ø"Ïß³Ì"ÊÇÒ»¸ö"½ø³Ì"ÀïµÄÒ»¸öÖ´ÐÐ"ÏßË÷"¡£´ÓºËÐÄÉϽ²£¬ WIN32µÄ¶à½ø³ÌÓëLinux²¢ÎÞ¶à´óµÄÇø±ð£¬ÔÚWIN32ÀïµÄÏ̲߳ÅÏ൱ÓÚLinuxµÄ½ø³Ì£¬ÊÇÒ»¸öʵ¼ÊÕýÔÚÖ´ÐеĴúÂë¡£µ«ÊÇ£¬WIN32Àïͬһ¸ö½ø³ÌÀï¸÷¸öÏß³ÌÖ®¼äÊǹ²ÏíÊý¾Ý¶ÎµÄ¡£Õâ²ÅÊÇÓëLinuxµÄ½ø³Ì×î´óµÄ²»Í¬¡£
ÏÂÃæÕâ¶Î³ÌÐòÏÔʾÁËWIN32ÏÂÒ»¸ö½ø³ÌÈçºÎÆô¶¯Ò»¸öÏ̡߳£
int g;
DWORD WINAPI ChildProcess( LPVOID lpParameter ){
int i;
for ( i = 1; i <1000; i ++) {
g ++;
printf( "This is Child Thread: %d\n", g );
}
ExitThread( 0 );
};
void main()
{
int threadID;
int i;
g = 0;
CreateThread( NULL, 0, ChildProcess, NULL, 0, &threadID );
for ( i = 1; i <1000; i ++) {
g ++;
printf( "This is Parent Thread: %d\n", g );
}
}
ÔÚWIN32Ï£¬Ê¹ÓÃCreateThreadº¯Êý´´½¨Ị̈߳¬ÓëLinuxÏ´´½¨½ø³Ì²»Í¬£¬WIN32Ï̲߳»ÊÇ´Ó´´½¨´¦¿ªÊ¼ÔËÐеģ¬¶øÊÇÓÉ CreateThreadÖ¸¶¨Ò»¸öº¯Êý£¬Ï߳̾ʹÓÄǸöº¯Êý´¦¿ªÊ¼ÔËÐС£´Ë³ÌÐòͬǰÃæµÄUNIX³ÌÐòÒ»Ñù£¬ÓÉÁ½¸öÏ̸߳÷´òÓ¡1000ÌõÐÅÏ¢¡£ threadIDÊÇ×ÓÏ̵߳ÄÏ̺߳ţ¬ÁíÍ⣬ȫ¾Ö±äÁ¿gÊÇ×ÓÏß³ÌÓ븸Ï̹߳²ÏíµÄ£¬Õâ¾ÍÊÇÓëLinux×î´óµÄ²»Í¬Ö®´¦¡£´ó¼Ò¿ÉÒÔ¿´³ö£¬WIN32µÄ½ø³Ì/Ïß³ÌÒª±ÈLinux¸´ÔÓ£¬ÔÚLinuxҪʵÏÖÀàËÆWIN32µÄÏ̲߳¢²»ÄÑ£¬Ö»ÒªforkÒÔºó£¬ÈÃ×Ó½ø³Ìµ÷ÓÃThreadProcº¯Êý£¬²¢ÇÒΪȫ¾Ö±äÁ¿¿ªÉè¹²ÏíÊý¾ÝÇø¾ÍÐÐÁË£¬µ«ÔÚWIN32ϾÍÎÞ·¨ÊµÏÖÀàËÆforkµÄ¹¦ÄÜÁË¡£ËùÒÔÏÖÔÚWIN32ϵÄCÓïÑÔ±àÒëÆ÷ËùÌṩµÄ¿âº¯ÊýËäÈ»ÒѾÄܼæÈÝ´ó¶àÊýLinux/UNIXµÄ¿âº¯Êý£¬µ«È´ÈÔÎÞ·¨ÊµÏÖfork¡£
¶ÔÓÚ¶àÈÎÎñϵͳ£¬¹²ÏíÊý¾ÝÇøÊDZØÒªµÄ£¬µ«Ò²ÊÇÒ»¸öÈÝÒ×ÒýÆð»ìÂÒµÄÎÊÌ⣬ÔÚWIN32Ï£¬Ò»¸ö³ÌÐòÔ±ºÜÈÝÒ×Íü¼ÇÏß³ÌÖ®¼äµÄÊý¾ÝÊǹ²ÏíµÄÕâÒ»Çé¿ö£¬Ò»¸öÏß³ÌÐ޸ĹýÒ»¸ö±äÁ¿ºó£¬ÁíÒ»¸öÏß³ÌÈ´ÓÖÐÞ¸ÄÁËËü£¬½á¹ûÒýÆð³ÌÐò³öÎÊÌâ¡£µ«ÔÚLinuxÏ£¬ÓÉÓÚ±äÁ¿±¾À´²¢²»¹²Ïí£¬¶øÓɳÌÐòÔ±À´ÏÔʽµØÖ¸¶¨Òª¹²ÏíµÄÊý¾Ý£¬Ê¹³ÌÐò±äµÃ¸üÇåÎúÓ밲ȫ¡£
ÖÁÓÚWIN32µÄ"½ø³Ì"¸ÅÄÆ京ÒåÔòÊÇ"Ó¦ÓóÌÐò"£¬Ò²¾ÍÊÇÏ൱ÓÚUNIXϵÄexecÁË¡£
Ïà¹ØÎĵµ£º
×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......
ʲôÊÇÇý¶¯£¿
×îͨË׵ĽâÊ;ÍÊÇ“ÇýʹӲ¼þÉ豸Ðж¯”
×÷Óã¿
É豸Çý¶¯Óëµ×²ãÓ²¼þÖ±½Ó´ò½»µÀ£¬°´ÕÕÓ²¼þÉ豸µÄ¾ßÌ幤×÷·½Ê½¶ÁдÉ豸¼Ä´æÆ÷£¬Íê³ÉÉ豸µÄÂÖѯ¡¢Öжϴ¦Àí¡¢DMAͨÐÅ£¬½øÐÐÎïÀíÄÚ´æÏòÐéÄâÄÚ´æµÄÓ³É䣬×îÖÕʹͨÐÅÉ豸Äܹ»ÊÕ·¢Êý¾Ý£¬Ê¹ÏÔʾÉ豸Äܹ»ÏÔʾÎÄ×ֺͻÃ棬ʹ´æ´¢É豸Äܹ»¼Ç¼ÎļþºÅÊý¾Ý
¼ÆË ......
ÔÚÉ豸Çý¶¯·½Ã棬Linux2.6Ïà¶ÔÓÚLinux2.4ÓнϴóµÄ¸Ä¶¯£¬ÕâÖ÷Òª±íÏÖÔÚÄÚºËAPIÖÐÔö¼ÓÁ˲»ÉÙй¦ÄÜ£¨ÈçÄÚ´æ³Ø£©¡¢sysfsÎļþϵͳ¡¢ÄÚºËÄ£¿é´Ó.o±äΪ.ko¡¢Çý¶¯Ä£¿é±àÒ뷽ʽ¡¢Ä£¿éʹÓüÆÊý¡¢Ä£¿é¼ÓÔغÍжÔغ¯ÊýµÄ¶¨ÒåµÈ·½Ãæ
LinuxÄÚºËÖ÷ÒªÓнø³Ìµ÷¶È¡¢ÄÚ´æ¹ÜÀí¡¢ÐéÄâÎļþϵͳ¡¢ÍøÂç½Ó¿ÚºÍ½ø³Ì¼äͨÐŵÈ5¸ö×Óϵͳ×é³É£¬ÈçÏÂͼ£º
......
1.´´½¨Ä¿Â¼
mkdir [-p][--help][--version][-m <Ŀ¼ÊôÐÔ>][Ŀ¼Ãû³Æ]
-m¿ÉÒÔ¶ÔĿ¼ÉèÖôæȡȨÏÞ,Ò²¿ÉÒÔÓÃchmodeÃüÁîÉèÖÃ,
-p ¿ÉÒÔÊÇÒ»¸ö·¾¶Ãû³Æ,Èç¹û·¾¶ÖÐÓÐЩĿ¼²»´æÔÚ,ÄÇô»á×Ô¶¯´´½¨
2.ɾ³ý¿ÕĿ¼
Óï¡¡¡¡·¨£ºrmdir [-p][--hel ......
typedef void (*lpFunction) ();//¶¨ÒåÒ»¸öÎÞ²ÎÊý£¬ÎÞ·µ»ØÀàÐ͵ĺ¯ÊýÖ¸ÕëÀàÐÍ
//¶¨ÒåÒ»¸öº¯ÊýÖ¸Õ룬ָÏòcpuÆô¶¯ºóËùÖ´ÐеĵÚÒ»ÌõÖ¸ÁîµÄλÖÃ
lpFunction lpReset = (lpFunction)0xF000FFF0;
lpReset();//µ÷Óú¯Êý
MMUÍ£¹©ÐéÄâµØÖ·ºÍÎïÀíµØÖ·µÄÓ³Éä¡¢ÄÚ´æ·ÃÎÊȨÏÞ±£»¤ºÍCache»º´æ¿ØÖƵÈÓ²¼þÖ§³Ö¡£²Ù×÷ϵͳÄں˽èÖ ......