Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 25.05.2006, 12:21   #1
Хуже некуда!!!
 
Join Date: 10 2004
Location: none
Posts: 2,825
Downloads: 0
Uploads: 0
Reputation: 15 | 3
Default linux kernel2.6 programming

lyudi pomogite razobrat'sya.


________________________________________________________________


static int my_driver_open(struct inode *, struct file *);
static int my_driver_release(struct inode *, struct file *);

struct file_operations my_driver_fops =
{
.owner = THIS_MODULE,
.open = my_driver_open,
.release = my_driver_release,
};

static int __init my_init(void)
{
......
}

static void __exit my_cleanup(void)
{
......
}

module_init(my_init);
module_exit(my_cleanup);

static int my_driver_open(struct inode *my_driver_inode, struct file *my_driver_file)
{
try_module_get(THIS_MODULE);
}

static int my_driver_release(struct inode *my_driver_inode, struct file *my_driver_file)
{
module_put(THIS_MODULE);
}

es depqum erb open funkcian em ogtagorcum, usage county 3 a


________________________________________________________________


static int my_driver_open(struct inode *, struct file *);
static int my_driver_release(struct inode *, struct file *);

struct file_operations my_driver_fops =
{
.open = my_driver_open,
.release = my_driver_release,
};

static int __init my_init(void)
{
......
}

static void __exit my_cleanup(void)
{
......
}

module_init(my_init);
module_exit(my_cleanup);

static int my_driver_open(struct inode *my_driver_inode, struct file *my_driver_file)
{
try_module_get(THIS_MODULE);
}

static int my_driver_release(struct inode *my_driver_inode, struct file *my_driver_file)
{
module_put(THIS_MODULE);
}

es depqum erb open funkcian em ogtagorcum, amen inch normal a usage county 1 a
________________________________________________________________

togda na figa mne pole owner v struct file_operations?
__________________
Мужское счастье где-то внутри женского.
Reply With Quote
Old 25.05.2006, 12:36   #2
The splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default Re: linux kernel2.6 programming

u menya v linux kernel programminge opita pochti nikakogo, no v chem konkretno nujno razobratsya? kod ne kompilirutsya? skoree vsego da t.k.
napisanno:
Code:
struct file_operations my_driver_fops = 
{
.owner = THIS_MODULE,
.open = my_driver_open,
.release = my_driver_release,
};
naskolko znayu structura tak ne inicializiruetysa, prosto:
struct A a;
a.var1=value1
.
.
a.varN=valueN

krome togo naskolko ya pomnyu pri napisanii modulya yadra est vsego 2 glavnie funkcii eto: int init_module(void) i void cleanup_module(void) kotorie pishutysa coderom, te funkcii chto u tebya eto chto to novoe (navernoe stil napisaniya modulei izmenen v novix yadrax), pomimo etogo imelas' uslovnaya kompiliaciya ot macrosa CONFIG_MODVERSIONS. poishi tutorial na etu temu bolshe nichem pomoch ne mogu.
__________________
Popular opinion is the greatest lie in the world.
Reply With Quote
Old 25.05.2006, 12:44   #3
Хуже некуда!!!
 
Join Date: 10 2004
Location: none
Posts: 2,825
Downloads: 0
Uploads: 0
Reputation: 15 | 3
Default Re: linux kernel2.6 programming

kody kompile linum a, daje ashxatum a
driverneri hamar ka gaxapar, usage count, erb vor inch vor meky dimum a driverin pti ed countery ++ ani. Ed nra hamar a stexcvac vor driveri ashxatelu pahin iran chkarenan kernelic rmmod anen.
Hima es anter file_operations strukturayi mej ka dasht owner, ete ed dashty inicializacnum em, u ed usage countery mecacnum em, inqy pochemu to 1 ov mecanalu poxaren mecanum a 3-ov, isk ete ed dashty chem incicializacnum mecanum a 1-ov, t.e. amen inch lav, a....hmi uzum em haskanam eli v chem tut podvox
Reply With Quote
Old 25.05.2006, 12:48   #4
The splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default Re: linux kernel2.6 programming

de uremn kernely giozerov mecacnuma du ches tenum..erevi te chishta dzer chtaly..mi hat uzum es nuyn [email protected] urish mashni vra pordzi.
Reply With Quote
Old 25.05.2006, 12:52   #5
Хуже некуда!!!
 
Join Date: 10 2004
Location: none
Posts: 2,825
Downloads: 0
Uploads: 0
Reputation: 15 | 3
Default Re: linux kernel2.6 programming

de ha ed parz a vor mecacnum a, bayc de kozely xi a mecacnum, ed em uzum jokem
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 05:07.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.