• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 我的虛擬文件系統(linux)

    發表于:2007-05-25來源:作者:點擊數: 標簽:linux系統不知道我的虛擬
    不知道該不該發這里,是我從proc改來的,懂內核源碼的交流交流 hello.c [code:1:3adb123188] #includehello.h structinode*hello_get_inodestructsuper_block*,int,structhello_dir_entry*; /*這個函數是直接從linux復制過來的,作用就是顯示目錄里的文件名,

    不知道該不該發這里,是我從proc改來的,懂內核源碼的交流交流

    hello.c
    [code:1:3adb123188]

    #include "hello.h"

    struct inode * hello_get_inode(struct super_block *, int, struct hello_dir_entry *);

    /*這個函數是直接從linux復制過來的,作用就是顯示目錄里的文件名,沒有這個
    函數也行只是你用ls、dir命令看不到目錄下的文件。*/
    int hello_readdir(struct file * filp, void * dirent, filldir_t filldir)
    {
    printk("hello_readdir\n");
    struct hello_dir_entry * de;
    unsigned int ino;
    int i;
    struct inode *inode = filp->f_dentry->d_inode;

    ino = inode->i_ino;
    de = (struct hello_dir_entry *) inode->u.generic_ip;
    if (!de)
    return -EINVAL;
    i = filp->f_pos;
    switch (i) {
    case 0:
    if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0)
    return 0;
    i++;
    filp->f_pos++;
    /* fall through */
    case 1:
    if (filldir(dirent, "..", 2, i,
        filp->f_dentry->d_parent->d_inode->i_ino,
        DT_DIR) < 0)
    return 0;
    i++;
    filp->f_pos++;
    /* fall through */
    default:
    de = de->subdir;
    i -= 2;
    for (;;) {
    if (!de)
    return 1;
    if (!i)
    break;
    de = de->next;
    i--;
    }

    do {
    if (filldir(dirent, de->name, de->namelen, filp->f_pos,
        de->low_ino, de->mode >> 12) < 0)
    return 0;
    filp->f_pos++;
    de = de->next;
    } while (de);
    }
    return 1;
    }

    int hello_d_revalidate(struct dentry *res, int i){printk("d_revalidate\n");return 0;}
    int hello_d_hash(struct dentry *res, struct qstr *name){printk("d_hash\n");return 0;}
    int hello_d_compare(struct dentry *res, struct qstr *name, struct qstr *old)
    {printk("d_compare\n");return 0;}
    int hello_d_delete(struct dentry *res){printk("d_delete\n");return 0;}
    void hello_d_release(struct dentry *res){printk("d_release\n");}
    void hello_d_iput(struct dentry *res, struct inode *inode){printk("d_iput\n");}

    struct dentry_operations hello_lookup_dops = {
    /*d_revalidate: hello_d_revalidate,
    d_hash: hello_d_hash,
    d_compare: hello_d_compare,*/
    d_delete: hello_d_delete,
    d_release: hello_d_release,
    /*d_iput: hello_d_iput*/
    };

    /*讀文件節點,這個函數是被real_lookup函數調用的,具體調用是這里dir->i_op->lookup(dir, dentry);作用是從磁盤讀文件節點填充inode結構。我這里用hello_dir_entry結構填充的*/

    struct dentry *hello_lookup(struct inode * dir, struct dentry *dentry)
    {
    struct inode *inode;
    struct hello_dir_entry * de;
    int error;

    error = -ENOENT;
    inode = NULL;
    de = (struct hello_dir_entry *) dir->u.generic_ip;
    if (de) {
    for (de = de->subdir; de ; de = de->next) {
    if (!de || !de->low_ino)
    continue;
    if (de->namelen != dentry->d_name.len)
    continue;
    if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
    int ino = de->low_ino;
    error = -EINVAL;
    inode = hello_get_inode(dir->i_sb, ino, de);
    break;
    }
    }
    }

    if (inode) {
    dentry->d_op = &hello_lookup_dops;
    d_add(dentry, inode);
    return NULL;
    }
    return ERR_PTR(error);
    }
    /************************************************************************************************************/
    static struct inode_operations hello_root_inode_operations = {
    lookup: hello_lookup,
    };

    static struct file_operations hello_file_operations = {
    readdir: hello_readdir,
    };

    struct hello_dir_entry hello_root = {
    low_ino: HELLO_ROOT_INO, 
    namelen: 5, 
    name: "/hello",
    mode: S_IFDIR | S_IRUGO | S_IXUGO, 
    nlink: 2, 
    hello_iops: &hello_root_inode_operations, 
    hello_fops: &hello_file_operations,
    parent: &hello_root,
    };

    /*填充inode結構*/
    struct inode * hello_get_inode(struct super_block * sb, int ino,
    struct hello_dir_entry * de)
    {
    printk("hello_get_inode\n");
    struct inode * inode;

    de_get(de);
    inode = iget(sb, ino);
    if (!inode)
    goto out_fail;
    inode->u.generic_ip = (void *) de;
    if (de) {
    if (de->mode) {
    inode->i_mode = de->mode;
    inode->i_uid = de->uid;
    inode->i_gid = de->gid;
    }
    if (de->size)
    inode->i_size = de->size;
    if (de->nlink)
    inode->i_nlink = de->nlink;
    if (de->owner)
    __MOD_INC_USE_COUNT(de->owner);
    if (de->hello_iops)
    inode->i_op = de->hello_iops;
    if (de->hello_fops)
    inode->i_fop = de->hello_fops;
    }

    out:
    return inode;

    out_fail:
    de_put(de);
    goto out;
    }

    /***********************************************************************************************************/

    void d_instantiate(struct dentry *entry, struct inode * inode)
    {
    printk("d_instantiate\n");
    if (!list_empty(&entry->d_alias)) BUG();
    spin_lock(&dcache_lock);
    if (inode)
    list_add(&entry->d_alias, &inode->i_dentry);
    entry->d_inode = inode;
    spin_unlock(&dcache_lock);
    }
    /*創建根目錄的dentry結構*/

    struct dentry * d_alloc_root(struct inode * root_inode)
    {
    struct dentry *res = NULL;
    printk("d_alloc_root\n");
    if (root_inode) {
    res = d_alloc(NULL, &(const struct qstr) { "/", 1, 0 });
    if (res) {
    res->d_sb = root_inode->i_sb;
    res->d_parent = res;
    d_instantiate(res, root_inode);/*把根目錄的inode結構安裝到dentry結構里*/
    }
    }
    return res;
    }

    void force_delete(struct inode *inode)
    {
    printk("force_delete\n");
    struct hello_dir_entry *de = inode->u.generic_ip;

    if (atomic_read(&inode->i_count) == 1)
    inode->i_nlink = 0;
    if (atomic_dec_and_test(&de->count))
    printk("hello_root.count: %d\n", atomic_read(&de->count));
    }

    static void hello_delete_inode(struct inode *inode)
    {
    printk("hello_delete_inode\n");
    struct hello_dir_entry *de = inode->u.generic_ip;
    inode->i_state = I_CLEAR;
    /*if (de) {
    if (de->owner)
    __MOD_DEC_USE_COUNT(de->owner);
    de_put(de);
    }*/
    }

    static void hello_read_inode(struct inode * inode)
    {
    printk("hello_read_inode\n");
    inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
    }

    static int hello_statfs(struct super_block *sb, struct statfs *buf)
    {
    printk("hello_statfs\n");
    return 0;
    }

    void hello_write_super(struct super_block *s)
    {
    printk("write_super\n");
    }

    static struct super_operations hello_sops = {
    read_inode: hello_read_inode,
    put_inode: force_delete,
    delete_inode: hello_delete_inode,
    write_super: hello_write_super,
    /*statfs: hello_statfs,*/
    };

    struct dentry_operations hello_dops = {
    /*d_revalidate: hello_d_revalidate,
    d_hash: hello_d_hash,
    d_compare: hello_d_compare,*/
    /*d_delete: hello_d_delete,*/
    d_release: hello_d_release,
    /*d_iput: hello_d_iput*/
    };

    /*創建超級塊*/
    struct super_block *hello_read_super(struct super_block *s, void *data, 
        int silent)
    {
    printk("hello_read_super\n");
    struct inode * root_inode;

    s->s_blocksize = 1024;
    s->s_blocksize_bits = 10;
    s->s_magic = 0;
    s->s_op = &hello_sops;
    root_inode = hello_get_inode(s, HELLO_ROOT_INO, &hello_root);
    if (!root_inode)
    goto out_no_root;

    s->s_root = d_alloc_root(root_inode);
    if (!s->s_root)
    goto out_no_root;
    s->s_root->d_op = &hello_dops;
    return s;

    out_no_root:
    printk("hello_read_super: get root inode failed\n");
    iput(root_inode);
    return NULL;
    }


    [/code:1:3adb123188]

    hello.h
    [code:1:3adb123188]
    #include <linux/kernel.h>
    #include <linux/module.h>

    #include <linux/fs.h>
    #include <linux/wrapper.h>
    #include <linux/slab.h>
    #include <linux/wait.h>
    #include <linux/poll.h>

    #include <linux/mm.h>
    #include <linux/pagemap.h>

    #include <asm/uaclearcase/" target="_blank" >ccess.h>
    #include <asm/semaphore.h>


    #define HELLO_ROOT_INO 1

    typedef int (read_hello_t)(char *page, char **start, off_t off,
      int count, int *eof, void *data);
    typedef int (write_hello_t)(struct file *file, const char *buffer,
       unsigned long count, void *data);
    typedef int (get_info_t)(char *, char **, off_t, int);

    struct hello_dir_entry {
    unsigned short low_ino;
    unsigned short namelen;
    const char *name;
    mode_t mode;
    nlink_t nlink;
    uid_t uid;
    gid_t gid;
    unsigned long size;
    struct inode_operations * hello_iops;
    struct file_operations * hello_fops;
    get_info_t *get_info;
    struct module *owner;
    struct hello_dir_entry *next, *parent, *subdir;
    void *data;
    read_hello_t *read_hello;
    write_hello_t *write_hello;
    atomic_t count; /* use count */
    int deleted; /* delete flag */
    kdev_t rdev;
    };

    extern struct hello_dir_entry hello_root;
    extern struct dentry *hello_lookup(struct inode *, struct dentry *);
    extern int hello_misc_init(void);
    extern struct super_block *hello_read_super(struct super_block *, void *, int);
    extern void de_put(struct hello_dir_entry *);
    extern struct hello_dir_entry * de_get(struct hello_dir_entry *);
    extern int hello_readdir(struct file *, void *, filldir_t);

    [/code:1:3adb123188]

    /*這個文件的作用是創建虛擬文件樹結構,相當于磁盤上的文件樹,這里我就不注釋了,有興趣的自己看看吧,挺簡單的*/
    hello_entry.c
    [code:1:3adb123188]
    #include "hello.h"

    static struct inode_operations hello_dir_inode_operations = {
    lookup: hello_lookup,
    };

    struct hello_dir_entry * de_get(struct hello_dir_entry *de)
    {
    printk("de_get\n");
    if (de)
    atomic_inc(&de->count);
    return de;
    }

    void inline free_hello_entry(struct hello_dir_entry *de)
    {
    printk("free_hello_entry\n");
    kfree(de);
    }

    void de_put(struct hello_dir_entry *de)
    {
    printk("de_put\n");
    if (de) {
    if (!atomic_read(&de->count)) {
    printk("de_put: entry %s already free!\n", de->name);
    return;
    }

    if (atomic_dec_and_test(&de->count))
    free_hello_entry(de);
    }
    }

    static ssize_t
    hello_file_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
    {
    struct inode * inode = file->f_dentry->d_inode;
    char  *page;
    ssize_t n;
    char *start;
    struct hello_dir_entry * dp;

    dp = (struct hello_dir_entry *) inode->u.generic_ip;
    if (!(page = (char*) __get_free_page(GFP_KERNEL)))
    return -ENOMEM;

    n = dp->read_hello(page, &start, *ppos,0,  NULL, NULL);
      copy_to_user(buf, page, n);

    free_page((unsigned long) page);
    return n;
    }

    static ssize_t
    hello_file_write(struct file * file, const char * buffer,
    size_t count, loff_t *ppos)
    {
    struct inode *inode = file->f_dentry->d_inode;
    struct hello_dir_entry * dp;

    dp = (struct hello_dir_entry *) inode->u.generic_ip;

    if (!dp->write_hello)
    return -EIO;

    /* FIXME: does this routine need ppos?  probably... */
    return dp->write_hello(file, buffer, count, dp->data);
    }


    static loff_t
    hello_file_lseek(struct file * file, loff_t offset, int origin)
    {
    long long retval;

    switch (origin) {
    case 2:
    offset += file->f_dentry->d_inode->i_size;
    break;
    case 1:
    offset += file->f_pos;
    }
    retval = -EINVAL;
    if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
    if (offset != file->f_pos) {
    file->f_pos = offset;
    file->f_reada = 0;
    }
    retval = offset;
    }
    return retval;
    }

    static struct file_operations hello_file_operations = {
    llseek: hello_file_lseek,
    read: hello_file_read,
    write: hello_file_write,
    };

    static int hello_register(struct hello_dir_entry * dir, struct hello_dir_entry * dp)
    {
    printk("hello_register\n");
    dp->low_ino = 2;
    dp->next = dir->subdir;
    dp->parent = dir;
    dir->subdir = dp;
    if (S_ISDIR(dp->mode)) {
    if (dp->hello_iops == NULL) {
    dp->hello_fops = NULL;
    dp->hello_iops = &hello_dir_inode_operations;
    }
    dir->nlink++;
    } else if (S_ISREG(dp->mode)) {
    if (dp->hello_fops == NULL)
    dp->hello_fops = &hello_file_operations;
    }

    return 0;
    }

    static struct hello_dir_entry *hello_create(struct hello_dir_entry **parent,
      const char *name,
      mode_t mode,
      nlink_t nlink)
    {
    printk("hello_create\n");
    struct hello_dir_entry *ent = NULL;
    const char *fn = name;
    int len;

    len = strlen(name);
    *parent = &hello_root;

    ent = kmalloc(sizeof(struct hello_dir_entry) + len + 1, GFP_KERNEL);
    if (!ent) goto out;

    memset(ent, 0, sizeof(struct hello_dir_entry));
    memcpy(((char *) ent) + sizeof(struct hello_dir_entry), fn, len + 1);
    ent->name = ((char *) ent) + sizeof(*ent);
    ent->namelen = len;
    ent->mode = mode;
    ent->nlink = nlink;
     out:
    return ent;
    }


    struct hello_dir_entry *create_hello_entry(const char *name, mode_t mode,
     struct hello_dir_entry *parent)
    {
    printk("create_hello_entry\n");
    struct hello_dir_entry *ent;
    nlink_t nlink;

    if (S_ISDIR(mode)) {
    if ((mode & S_IALLUGO) == 0)
    mode |= S_IRUGO | S_IXUGO;
    nlink = 2;
    } else {
    if ((mode & S_IFMT) == 0)
    mode |= S_IFREG;
    if ((mode & S_IALLUGO) == 0)
    mode |= S_IRUGO;
    nlink = 1;
    }

    ent = hello_create(&parent,name,mode,nlink);
    if (ent) {
    if (hello_register(parent, ent) < 0) {
    kfree(ent);
    ent = NULL;
    }
    }
    return ent;
    }

    static inline struct hello_dir_entry *hello_read_entry(const char *name,
    mode_t mode, struct hello_dir_entry *base, 
    read_hello_t *read_hello, void * data)
    {
    printk("hello_dir_entry\n");
    struct hello_dir_entry *res=create_hello_entry(name,mode,base);
    if (res) {
    res->read_hello=read_hello;
    res->write_hello = NULL;
    res->data=data;
    }
    return res;
    }

    /************************************************************************************************************/
    int read_hello(char *page, char **start, off_t off, int count, int *eof, void *data)
    {
    strcpy(page, "hello world!");
    return 13;
    }

    int hello_misc_init(void)
    {
    printk("hello_misc_init\n");
    struct hello_dir_entry *err;
    err = hello_read_entry("zhang", 0, NULL, read_hello, NULL);
    return !err;
    }

    [/code:1:3adb123188]

    mount.c
    [code:1:3adb123188]
    #include "hello.h"
    /*加載模塊并安裝文件系統*/

    static DECLARE_FSTYPE(hello_fs_type, "hello", hello_read_super, FS_SINGLE);
    struct vfsmount *mnt;

    int hello_root_init(void)
    {
    struct nameidata nd;
    int err;
    err = register_filesystem(&hello_fs_type);
    printk("register_filesystem\n");
    if (err)
    return err;
    mnt = kern_mount(&hello_fs_type);/*安裝文件系統*/
    printk("kern_mount\n");
    err = PTR_ERR(mnt);
    if (IS_ERR(mnt))
    goto out;
    hello_misc_init();

    MOD_DEC_USE_COUNT;
    char *name, *type;
    name = kmalloc(10, GFP_KERNEL);
    type = kmalloc(10, GFP_KERNEL);
    strcpy(name, "/hello");
    strcpy(type, "hello");
    long (*do_mount)(char *, char *, char *, unsigned long, void *) = (void*)0xc01603f0;/*0xc0166ad0;*/
    do_mount(NULL, name, type, 0, NULL);
    kfree(name);
    kfree(type);
    /*if (err)
    goto out;
    */

    return 0;
    out:
    mntput(mnt);
    unregister_filesystem(&hello_fs_type);
    return err;
    }


    int init_module(void)
    {
    printk("init_module\n");
    hello_root_init();
    return 0;
    }

    void cleanup_module()
    {
    printk("cleanup_module\n");
    mntput(mnt);
    unregister_filesystem(&hello_fs_type);
    }

    [/code:1:3adb123188]

    Makefile
    [code:1:3adb123188]
    CC = gcc
    CFLAGS = -O -Wall -D__KERNEL__ -DMODULE 
    #INCLUDEDIR =  /usr/local/linux-2.4.22/include

    INCLUDEDIR =  /usr/src/linux-2.4.20-8/include
    CFLAGS += -I$(INCLUDEDIR)

    myfs.o: mount.o hello_entry.o hello.o
    $(LD) -m elf_i386 -r -o myfs.o mount.o hello_entry.o hello.o

    mount.o: mount.c hello.h /usr/include/linux/version.h
    $(CC) $(CFLAGS) -c mount.c

    hello_entry.o: hello_entry.c hello.h /usr/include/linux/version.h
    $(CC) $(CFLAGS) -c hello_entry.c

    hello.o: hello.c hello.h /usr/include/linux/version.h
    $(CC) $(CFLAGS) -c hello.c

    [/code:1:3adb123188]

    測試程序read.c
    [code:1:3adb123188]
    #include <sys/ioctl.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>


    int main()
    {
    int fp;
    char buf[11];
    buf[10] = 0;
    int i;

    if ((fp = open("/hello/zhang", O_RDWR)) == 0) {
    printf("Could not opened!\n");
    return -1;
    }
    else
    printf("File open ok!\n");
    read(fp, buf, 13);
    printf("%s\n", buf);
    close(fp);
    }

    [/code:1:3adb123188]

     JohnBull 回復于:2004-05-26 08:23:38
    成功了嗎?

     bierdaci 回復于:2004-05-26 12:27:56
    呵呵,當然成功了,不過我只建了一個文件,本來想把我的管道和共享內存都放上去,只是懶得動了

     bierdaci 回復于:2004-05-26 12:34:44
    你要試的話,需要在Sysmap文件找到 do_mount的地址,就像我這樣的long (*do_mount)(char *, char *, char *, unsigned long, void *) = (void*)0xc01603f0;
    是不是有點可笑呀,呵呵 
    還有為了簡單沒有實現搜索目錄,只能在hello目錄下建文件

    JohnBull版主要是感興趣,我可以把我實現的共享內存給你看看,一起交流交流,很少能遇到個對內核感趣的

     JohnBull 回復于:2004-05-26 13:05:01
    加精!堅決加精!

     bierdaci 回復于:2004-05-26 14:45:46
    [quote:6116cc931e="JohnBull"]加精!堅決加精![/quote:6116cc931e] 
    謝謝版主:mrgreen:

     bierdaci 回復于:2004-05-26 15:02:13
    對了還有得在根目錄下建一個hello目錄

     lozity 回復于:2004-05-26 16:59:46
    感覺暈
    看不懂

     xhl 回復于:2004-05-26 18:31:51
    我也暈,但很佩服樓主,支持下!

     bierdaci 回復于:2004-05-26 20:09:57
    [quote:4020fcec84="xhl"]我也暈,但很佩服樓主,支持下![/quote:4020fcec84]

    謝謝支持,小弟一定會繼續努力,希望多幾個能和我一起討論內核編程的兄弟

     lozity 回復于:2004-05-27 08:14:05
    樓主能不能說一下你得學習之路,我們好借鑒,謝謝

     bkkkd 回復于:2004-05-27 08:21:12
    我也很感興趣,不過我還是一個新手,所以還是不懂!
    我也想知道樓主的發展之路!

     bierdaci 回復于:2004-05-27 09:26:29
    [quote:0bd7c2eccd="bkkkd"]我也很感興趣,不過我還是一個新手,所以還是不懂!
    我也想知道樓主的發展之路![/quote:0bd7c2eccd]

    謝謝樓上兩位的對小弟的支持,只是我現在連工作都沒有,何談發展呀我也和你們一樣仍需要繼續努力,等大家都走出一條成功之路的時候再回過頭來總結會有更多的人認可,不過如果想知道是怎么學習LINUX內核源碼,我覺得也沒什么捷徑,就是耐心加毅力,還有不管遇到多少困難都不要放棄,希望大家和我一起努力構筑美好的明天,呵呵

     流浪的狗 回復于:2004-05-28 10:56:45
    struct hello_dir_entry { 
       unsigned short low_ino; 
       unsigned short namelen; 
       const char *name; 
       mode_t mode; 
       nlink_t nlink; 
       uid_t uid; 
       gid_t gid; 
       unsigned long size; 
       struct inode_operations * hello_iops; 
       struct file_operations * hello_fops; 
       get_info_t *get_info; 
       struct module *owner; 
       struct hello_dir_entry *next, *parent, *subdir; 
       void *data; 
       read_hello_t *read_hello; 
       write_hello_t *write_hello; 
       atomic_t count;      /* use count */ 
       int deleted;      /* delete flag */ 
       kdev_t   rdev; 
    }; 

    存放目錄名的數據結構是否太小了?

     bierdaci 回復于:2004-05-28 12:25:43
    [quote:1c108da3d2="流浪的狗"]存放目錄名的數據結構是否太小了?[/quote:1c108da3d2] 這是虛擬的文件節點,只存放在內存中。搜索文件名的時候inode的信息就是從這里讀取的,其實這個虛擬節點的信息我并沒有全部用上,這是我直接從proc烤過來,只是改了改名字,因為多的那些信息放在里邊并沒有什么影響我也就沒動他了,這位兄弟要是興趣可以自己研究一下,如果你有設備驅動程序的話可以加進來,這樣就可以在虛擬文件系統里使用你的設備了

     keqian 回復于:2004-05-29 11:31:33
    樓主希望做什么樣的工作?

     bierdaci 回復于:2004-05-29 11:39:49
    [quote:2360c02b65="keqian"]樓主希望做什么樣的工作?[/quote:2360c02b65]

    我也不知道,正在煩惱中。喜歡游戲可是對做游戲并不了解,不過我倒是有個創意很想能實現。如果有機會我愿意去從事LINUX內核開發,只是覺得機會不大,走一步算一步吧 哎??!

     bierdaci 回復于:2004-05-29 11:40:53
    還不知道能找到什么樣的工作呢

     keqian 回復于:2004-05-29 11:49:16
    你現在剛畢業?在哪個地方???

     bierdaci 回復于:2004-05-29 12:05:34
    我不是剛畢業,我是山東的

     keqian 回復于:2004-05-29 12:07:07
    山東的?好巧??!我是濰坊的

     keqian 回復于:2004-05-29 12:09:41
    你是山東哪里?

     bierdaci 回復于:2004-05-29 12:10:34
    呵呵,我山東威海的 在QQ里聊吧,我QQ121386734

     bierdaci 回復于:2004-06-17 21:11:48
    應CU兄弟要求我給簡單的注釋了一下

     connect 回復于:2004-06-17 22:59:28
    看不懂。暈阿。。 :em10:  :oops: 
    祝樓主找到好工作??! :em02:

     albcamus 回復于:2004-09-17 14:00:00
    我是煙臺的,樓主可以來煙臺工作阿,煙臺市政府是Linux應用示范基地呢,肯定有用武之地。其實我要有你這水平,早去紅旗碰碰運氣了:)

     bierdaci 回復于:2004-09-17 20:22:07
    [quote:05505f9d6f="albcamus"]我是煙臺的,樓主可以來煙臺工作阿,煙臺市政府是Linux應用示范基地呢,肯定有用武之地。其實我要有你這水平,早去紅旗碰碰運氣了:)[/quote:05505f9d6f]
    謝謝兄弟關心呀,我已經在北京工作一段時間了呵呵

     napleon 回復于:2004-09-18 15:13:54
    現在還在那家公司搞嵌入式系統嗎?!
    祝福你!

     bierdaci 回復于:2004-09-18 17:00:51
    [quote:11db9e95eb="napleon"]現在還在那家公司搞嵌入式系統嗎?!
    祝福你![/quote:11db9e95eb]
    是的 :D

     homesp 回復于:2004-11-02 14:05:19
    我也是山東的,是濰坊高密的,現在在天津大學學習,很希望向樓主學習!!!!!!!!!!!!

     bierdaci 回復于:2004-11-02 16:50:13
    [quote:9179c78256="homesp"]我也是山東的,是濰坊高密的,現在在天津大學學習,很希望向樓主學習!!!!!!!!!!!![/quote:9179c78256]

    呵呵,大家一起努力一起學習啊

     Gunyem 回復于:2004-11-02 21:45:03
    看的頭暈,晚上就著酸菜啃。

     zzmzzm 回復于:2005-01-24 02:12:45
    linux/pagemap.h: 沒有那個文件或目錄
    asm/uaccess.h: 沒有那個文件或目錄
    樓主
    這兩個文件找不到該怎么辦
    編譯不了 。。。。。。。。。。。。

     albcamus 回復于:2005-01-24 08:59:17
    [quote:85369f3ccf="zzmzzm"]linux/pagemap.h: 沒有那個文件或目錄
    asm/uaccess.h: 沒有那個文件或目錄
    樓主
    這兩個文件找不到該怎么辦
    編譯不了 。。。。。。。。。。。。[/quote:85369f3ccf]


    樓主的模塊對應什么內核版本,還有指定-I/lib/modules/`uname -r`/include,等等,編譯內核模塊跟普通用戶程序不一樣的。

     noress 回復于:2005-01-24 09:07:59
    bierdaci兄好久沒見你了, 工作怎么樣? 如果不喜歡做嵌入式Linux就跳唄,你一定能找到如意的工作的。

    謝謝你的指導!

     zzmzzm 回復于:2005-01-24 15:50:59
    我想請教一下我該怎么做
    我是想把它欠入內核中編譯
    我是剛開始看內核的。我想找個程序編譯看看。
    謝謝指教。

     albcamus 回復于:2005-01-24 15:54:30
    大概沒有比這個更合適的了:
    The Linux Kernel Module Programming Guide,
    http://tldp.org/guides.html

    for 2.4和for2.6版本的,從helloworld做起。偶也在學習中。。LDP真的偉大。。

     zzmzzm 回復于:2005-01-24 15:56:38
    我現在想些有關虛擬文件系統的程序
    可是內核中相關的文件及相關聯的涉及整個文件系統目錄
    所以我相現著個簡單的看看。
    我用的是linux2。4。26。1的紅旗

     zzmzzm 回復于:2005-01-24 16:11:26
    謝了

     rootkitT 回復于:2005-01-25 00:17:59
    bierdaci 乃一代高人啊
    可惜帖子發錯地方了
    CU的C++不搞kernel的
    來看看 a s m c o s . 5 1 . n e t 吧

    原文轉自:http://www.kjueaiud.com

    評論列表(網友評論僅供網友表達個人看法,并不表明本站同意其觀點或證實其描述)
    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>