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

linux 0.11 ÄÚºËѧϰ buffer.c


/*
 * buffer.c ³ÌÐòÓÃÓÚ¶Ô¸ßËÙ»º³åÇø(³Ø)½øÐвÙ×÷ºÍ¹ÜÀí¡£¸ßËÙ»º³å
 * ÇøÎ»ÓÚÄں˴úÂëºÍÖ÷ÄÚ´æÇøÖ®¼ä¡£
 *
 *  |---|---|------------------|---------------------|-------------------|
 *  |   |   |    *   *    *    |       buffer        |                   |
 *  |---|---|------------------|---------------------|-------------------|
 *    |                                   /|\
 *    |------------------------------------|
 *   \|/
 *  buffer_head (list)
 */
/*
 *  linux/fs/buffer.c
 *
 *  (C) 1991  Linus Torvalds
 */
/*
 *  'buffer.c' implements the buffer-cache functions. Race-conditions have
 * been avoided by NEVER letting a interrupt change a buffer (except for the
 * data, of course), but instead letting the caller do it. NOTE! As interrupts
 * can wake up a caller, some cli-sti sequences are needed to check for
 * sleep-on-calls. These should be extremely quick, though (I hope).
 */
/*
 * NOTE! There is one discordant note here: checking floppies for
 * disk change. This is where it fits best, I think, as it should
 * invalidate changed floppy-disk-caches.
 */
#include <stdarg.h>
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <asm/system.h>
#include <asm/io.h>
extern int end; // ÓÉÁ¬½Ó³ÌÐòld Éú³ÉµÄ±íÃ÷³ÌÐòÄ©¶ËµÄ±äÁ¿£¬´ú±íµÄÊÇÒ»¸öÄÚ´æµØÖ·
struct buffer_head * start_buffer = (struct buffer_head *) &end;
struct buffer_head * hash_table[NR_HASH];
static struct buffer_head * free_list;
static struct task_struct * buffer_wait = NULL;
int NR_BUFFERS = 0;
/*µÈ´ýÖ¸¶


Ïà¹ØÎĵµ£º

ǶÈëʽLinux²Ù×÷ϵͳѧϰ¹æ

ǶÈëʽLinux²Ù×÷ϵͳѧϰ¹æ»®
ARM+LINUX·Ïߣ¬Ö÷¹¥Ç¶ÈëʽLinux²Ù×÷ϵͳ¼°ÆäÉÏÓ¦ÓÃÈí¼þ¿ª·¢Ä¿±ê£º 
£¨1£© ÕÆÎÕÖ÷Á÷ǶÈëʽ΢´¦ÀíÆ÷µÄ½á¹¹ÓëÔ­Àí£¨³õ²½¶¨Îªarm9£© 
£¨2£© ±ØÐëÕÆÎÕÒ»¸öǶÈëʽ²Ù×÷ϵͳ £¨³õ²½¶¨Îªuclinux»òlinux,°æ±¾´ý¶¨£© 
£¨3£© ±ØÐëÊìϤǶÈëʽÈí¼þ¿ª·¢Á÷³Ì²¢ÖÁÉÙ×öÒ ......

linux·Ç×èÈûsocket½Ì³Ì

        ±¾ÎIJ¢·Ç½âÊÍʲôÊÇ·Ç×èÈûsocket£¬Ò²²»ÊǽéÉÜsocket APIµÄÓ÷¨£¬ È¡¶ø´úÌæµÄÊÇÈÃÄã¸ÐÊÜʵ¼Ê¹¤×÷ÖеĴúÂë±àд¡£ËäÈ»ºÜ¼òª£¬µ«Äã¿ÉÒÔͨ¹ýmanÊÖ²áÓëÆäËü×ÊÔ´·Ç¸»ÄãµÄ´úÂë¡£Çë×¢Òâ±¾½Ì³ÌËù˵µÄÖ÷Ì⣬Èç¹ûϸ˵£¬ÄÚÈÝ¿ÉÒÔ´ïµ½Ò»±¾ÊéÄÚÈÝ£¬Äã»á·¢ÏÖ±¾½Ì³ÌºÜÓÐÓá£
±¾½Ì³ÌÄÚÈÝÈçÏ£º ......

Linux erron³£Á¿

#define EPERM            1      /* Operation not permitted */
#define ENOENT           2      /* No such file or directory */
#define ESRCH&nbs ......

¡¶LINUXÉ豸Çý¶¯³ÌÐò¡·Ñ§Ï°Ôý¼Ç£¨Ò»£©

×ܽáÕ½ڣºµÚÒ»Õ É豸Çý¶¯³ÌÐò¼ò½é
          µÚ¶þÕ ¹¹ÔìºÍÔËÐÐÄ£¿é
Ìáµ½Çý¶¯³ÌÐò¾Í²»µÃ²»ÏÈ˵ÏÂÁ½¸öÃû´Ê£ºÄں˿ռäºÍÓû§¿Õ¼ä¡£Óû§¿Õ¼ä¼´Óû§Ó¦ÓÃËùÔËÐеĿռ䣬Äں˿ռäÖµµÃÊDzÙ×÷ϵͳÄÚºËÔËÐеĿռ䡣Óû§¿Õ¼ä²»ÄÜÖ±½ÓÒýÓûòÕß²Ù×÷Äں˿ռäµÄÊý¾Ý£¬Äں˿ռäÒ²²»ÄÜÖ±½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ