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

Linux lock_kernel()º¯ÊýµÄ·ÖÎö¡£

  ÕâÖ»ÊÇÔÝʱµÄ¼Ç¼£¬ÒÔºó»á°ÑËü¹éÀൽstart_kernel()º¯ÊýµÄ·ÖÎö¡£ÔÚ·ÖÎö֮ǰ£¬ÎÒÏÈҪ˵˵¼¸¸ö¸ÅÄî¡£
  ÄÚºËÇÀÕ¼£ºÔÚ2.6Äں˼ÓÈëÁËÇÀÕ¼µÄÄÜÁ¦£¬¾ÍÊÇ˵µ÷¶È³ÌÐòÓа취ÔÚÒ»¸öÄں˼¶µÄÈÎÎñÕýÔÚÖ´ÐеÄʱºò´Óе÷¶È¡£µ«ÊDZØÐëÒª±£Ö¤ÖØе÷¶ÈÒª°²È«£¬ÕâÑù¾ÍÒª¿¿Ò»°ÑËøÀ´±£Ö¤ÁË¡£
  ¼ÆÊýÆ÷£¨thread_info.[reempt_count£©£ºÆäʵҲ¿ÉÒÔ°ÑËû½Ð³ÉËøµÄ£¬ËüµÄ³õÖµ¶¨ÒåΪ0£¬Ã¿µ±Ê¹ÓÃËøµÄʱºò¼Ó1.
  ºÃÁË£¬ÎÒÃÇÏÖÔÚÀ´¿´¿´lock_kernel()µÄ¾ßÌå´úÂëÀ²£¨2.6.10°æ±¾µÄ£©
 #ifndef __LINUX_SMPLOCK_H
#define __LINUX_SMPLOCK_H
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#ifdef CONFIG_LOCK_KERNEL
#define kernel_locked()  (current->lock_depth >= 0)
extern int __lockfunc get_kernel_lock(void);
extern void __lockfunc put_kernel_lock(void);
/*
 * Release/re-acquire global kernel lock for the scheduler
 */
#define release_kernel_lock(tsk) do {   \
 if (unlikely((tsk)->lock_depth >= 0)) \
  put_kernel_lock();  \
} while (0)
/*
 * Non-SMP kernels will never block on the kernel lock,
 * so we are better off returning a constant zero from
 * reacquire_kernel_lock() so that the compiler can see
 * it at compile-time.
 */
#ifdef CONFIG_SMP
#define return_value_on_smp return
#else
#define return_value_on_smp
#endif
static inline int reacquire_kernel_lock(struct task_struct *task)
{
 if (unlikely(task->lock_depth >= 0))
  return_value_on_smp get_kernel_lock();
 return 0;
}
extern void __lockfunc lock_kernel(void) __acquires(kernel_lock);
extern void __lockfunc unlock_kernel(void) __releases(kernel_lock);
#else
#define lock_kernel()    do { } while(0)
#define unlock_kernel()    do { } while(0)
#define release_kernel_lock(task)  do { } while(0)
#define reacquire_kernel_lock(task)  0
#define kernel_locked()    1
#


Ïà¹ØÎĵµ£º

ǶÈëʽLinuxÄÚºËÓÅ»¯²Ã¼ô

ǶÈëʽLinuxÄÚºËÓÅ»¯²Ã¼ô
                                    
 ÓÅ»¯1¡¢È¡ÏûÐéÄâÄÚ´æµÄÖ§³Ö
General setup  ---& ......

LinuxÎļþÀàÐÍ

• ÆÕͨÎļþ£¨regular file£©£º¾ÍÊÇÒ»°ãÎÒÃÇ´æÈ¡µÄÎļþ£¬ÓÉls -alÏÔʾ³öÀ´µÄÊôÐÔÖУ¬µÚÒ»¸öÊôÐÔΪ [-]£¬ÀýÈç [-rwxrwxrwx]¡£ÁíÍ⣬ÒÀÕÕÎļþµÄÄÚÈÝ£¬ÓÖ´óÖ¿ÉÒÔ·ÖΪ£º
´¿Îı¾Îļþ£¨ASCII£©£ºÕâÊÇUnixϵͳÖÐ×î¶àµÄÒ»ÖÖÎļþÀàÐÍ£¬Ö®ËùÒÔ³ÆΪ´¿Îı¾Îļþ£¬ÊÇÒòΪÄÚÈÝΪÎÒÃÇ¿ÉÒÔÖ±½Ó¶Áµ½µÄÊý¾Ý£¬ÀýÈçÊý×Ö¡¢×ÖĸµÈµÈ¡ ......

LINUX¾²Ì¬Á´½Ó¿â˳ÐòÎÊÌâ

×òÌìÔÚ±àдһ¸ö³ÌÐòµÄʱºò·¢ÏÖÐèÒªÁ´½ÓµÄ¾²Ì¬¿â¶¼È·¶¨´æÔÚ£¬Ö¸¶¨µÄ·¾¶Ò²Ã»ÓÐÎÊÌ⣬µ«ÊDZàÒë×ÜÊdzöÏÖÁ´½ÓÎÊÌ⣬ÕÒ²»µ½ÊµÏÖ£¬²Å·¢ÏÖÔ­À´Èç¹ûͬʱÁ´½Ó¶à¸ö¾²Ì¬¿â£¬²¢ÇÒÈç¹ûÕâЩ¾²Ì¬¿âÖ®¼ä´æÔÚÏ໥ÒÀÀµ¹ØϵµÄ»°£¬ÐèÒª°´Ò»¶¨µÄ˳Ðò½øÐÐÁ´½Ó£¬ÀýÈ磺Èç¹ûlibb.aÒÀÀµliba.a£¬ÄÇô±àÒë²ÎÊýÓ¦¸Ãд³ÉÕâÑù£º -lb -la ......

LinuxÈëÃűʼÇËÄ

1.Vi¼°ÆäÔËÐÐģʽ
ViÊÇ“Visual interface”µÄ¼ò³Æ¡£¿ÉÒÔÖ´ÐÐÊä³ö¡¢É¾³ý¡¢²éÕÒ¡¢Ìæ»»¡¢¿é²Ù×÷µÈÖÚ¶àÎı¾²Ù×÷
Á·Ï°
cp /etc/passwd  /tmp/   ¿½±´Ò»¸öÎļþ
Á¬Ðø°´dd  ¿ÉÒÔɾ³ýÒ»ÐÐ
Á¬Ðø°´oo  ¿ÉÒÔ²åÈëÒ»ÐÐ
°´Ò»¸öO   ¿ÉÒÔÔÚ¹â±êÉÏÃæ²åÈëÒ»ÐÐ
2.Öض¨Ïò
±ê×¼ÊäÈë¡¢Êä³ö ......

Linux ./configure prefixÃüÁî

Ô´ÂëµÄ°²×°Ò»°ãÓÉ3¸ö²½Öè×é³É£ºÅäÖã¨configure£©¡¢±àÒ루make£©¡¢°²×°£¨make install£©£¬¾ßÌåµÄ°²×°·½·¨Ò»°ã×÷Õ߶¼»á¸ø³öÎĵµ£¬ÕâÀïÖ÷ÒªÌÖÂÛÅäÖã¨configure£©¡£ConfigureÊÇÒ»¸ö¿ÉÖ´Ðнű¾£¬ËüÓкܶàÑ¡ÏʹÓÃÃüÁî./configure –helpÊä³öÏêϸµÄÑ¡ÏîÁÐ±í£¬ÈçÏ£º
-bash-3.00# ./configure --help
Usage: configure ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ