Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18
iam writing the driver for pci device in linux so plz tell me what are the entry points? how is the flow : what are the different modules? which driver ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Just Joined!
    Join Date
    May 2005
    Posts
    5

    doubts: writing linux pci driver


    iam writing the driver for pci device in linux
    so plz tell me

    what are the entry points?

    how is the flow :

    what are the different modules?

    which driver should i write(char/block)?

  2. #12
    Just Joined!
    Join Date
    May 2005
    Posts
    5
    how ioctl cmd works?

  3. #13
    Just Joined!
    Join Date
    May 2005
    Posts
    5
    i got the problem of tainted module i,e

    loading hello.o will taint the kernel : no licence
    module loaded with warnigs

    plz help me in this regurd

  4. $spacer_open
    $spacer_close
  5. #14
    Just Joined!
    Join Date
    May 2005
    Posts
    4

    Re: About insmod problem

    Hey,

    I too faced the same problem when I was building module. I solved it by putting
    the below option while compiling. Just use it.....

    -DKBUILD_MODNAME="yourmodulename"

    -zeebu



    Quote Originally Posted by kokyi2
    I tried you program in Fedora 3 .I can successfully complie using gcc.
    but I got this problem
    hello.o (-1 : invalid module format)
    I think it may be the problem of insmod.


    Anything u wanna suggest to debug..

  6. #15
    Just Joined!
    Join Date
    Jun 2005
    Posts
    6
    To,

    Respected Sir,



    I have SBC 104+ which has installed White Dwarf Linux.

    I have another DSP board which is stacked on this SBC.

    That board has PCI & ISA slots are interfaced with SBC.

    I want to read external data of DSP Board from SBC using PCI Slot.

    White Dwarf linux has already written PCI Device Driver.

    I would like to develop a application code using PCI Driver API's ,

    So I can read external data of SDRAM of DSP Board.

    I have written some basic code, But how to exactly read external data.

    Through pci about that I have little bit problem.

    Please, Reply as soon as possible. A positive reply awaited from u.



    Thanks,

    Sumeet

  7. #16
    Just Joined!
    Join Date
    Oct 2005
    Posts
    10

    flashing key board leds kernel program is not working: guide me

    Hi,

    I am new to linux kernel programming, have started learning .
    I tried executing one program which flashes keyboard leds....but when i do make its giving hte following error. where as same program works at my other system.
    Can anybody help me ....


    error is:
    ------------

    [root@localhost vikram]# make
    make -C /lib/modules/2.6.11-1.1369_FC4/build M=/home/vikram modules
    make[1]: Entering directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
    CC [M] /home/vikram/b.o
    In file included from /home/vikram/b.c:10:
    include/linux/console_struct.h:53: error: field ‘vt_mode’ has incomplete type
    make[2]: *** [/home/vikram/b.o] Error 1
    make[1]: *** [_module_/home/vikram] Error 2
    make[1]: Leaving directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
    make: *** [all] Error 2
    -------------------------------------------------------------------------------------------------

    programm is :
    -------------------------

    /*
    * kbleds.c - Blink keyboard leds until the module is unloaded.
    */

    #include <linux/module.h>
    #include <linux/config.h>
    #include <linux/init.h>
    #include <linux/tty.h> /* For fg_console, MAX_NR_CONSOLES */
    #include <linux/kd.h> /* For KDSETLED */
    #include <linux/console_struct.h> /* For vc_cons */

    MODULE_DESCRIPTION("Example module illustrating the use of Keyboard LEDs.");
    MODULE_AUTHOR("Daniele Paolo Scarpazza");
    MODULE_LICENSE("GPL");

    struct timer_list my_timer;
    struct tty_driver *my_driver;
    char kbledstatus = 0;

    #define BLINK_DELAY HZ/5
    #define ALL_LEDS_ON 0x07
    #define RESTORE_LEDS 0xFF

    /*
    * Function my_timer_func blinks the keyboard LEDs periodically by invoking
    * command KDSETLED of ioctl() on the keyboard driver. To learn more on virtual
    * terminal ioctl operations, please see file:
    * /usr/src/linux/drivers/char/vt_ioctl.c, function vt_ioctl().
    *
    * The argument to KDSETLED is alternatively set to 7 (thus causing the led
    * mode to be set to LED_SHOW_IOCTL, and all the leds are lit) and to 0xFF
    * (any value above 7 switches back the led mode to LED_SHOW_FLAGS, thus
    * the LEDs reflect the actual keyboard status). To learn more on this,
    * please see file:
    * /usr/src/linux/drivers/char/keyboard.c, function setledstate().
    *
    */

    static void my_timer_func(unsigned long ptr)
    {
    int *pstatus = (int *)ptr;

    if (*pstatus == ALL_LEDS_ON)
    *pstatus = RESTORE_LEDS;
    else
    *pstatus = ALL_LEDS_ON;

    (my_driver->ioctl) (vc_cons[fg_console].d->vc_tty, NULL, KDSETLED,
    *pstatus);

    my_timer.expires = jiffies + BLINK_DELAY;
    add_timer(&my_timer);
    }

    static int __init kbleds_init(void)
    {
    int i;

    printk(KERN_INFO "kbleds: loading\n");
    printk(KERN_INFO "kbleds: fgconsole is %x\n", fg_console);
    for (i = 0; i < MAX_NR_CONSOLES; i++) {
    if (!vc_cons[i].d)
    break;
    printk(KERN_INFO "poet_atkm: console[%i/%i] #%i, tty %lx\n", i,
    MAX_NR_CONSOLES, vc_cons[i].d->vc_num,
    (unsigned long)vc_cons[i].d->vc_tty);
    }
    printk(KERN_INFO "kbleds: finished scanning consoles\n");

    my_driver = vc_cons[fg_console].d->vc_tty->driver;
    printk(KERN_INFO "kbleds: tty driver magic %x\n", my_driver->magic);

    /*
    * Set up the LED blink timer the first time
    */
    init_timer(&my_timer);
    my_timer.function = my_timer_func;
    my_timer.data = (unsigned long)&kbledstatus;
    my_timer.expires = jiffies + BLINK_DELAY;
    add_timer(&my_timer);

    return 0;
    }

    static void __exit kbleds_cleanup(void)
    {
    printk(KERN_INFO "kbleds: unloading...\n");
    del_timer(&my_timer);
    (my_driver->ioctl) (vc_cons[fg_console].d->vc_tty, NULL, KDSETLED,
    RESTORE_LEDS);
    }

    module_init(kbleds_init);
    module_exit(kbleds_cleanup);




















    ***********************
    regards
    Jyothi vajja

  8. #17
    Just Joined!
    Join Date
    Dec 2005
    Posts
    5
    HI jyoti,
    just now i 'v seen your post.
    your program is perfect , i executed successfully on my mechine.i think problem with you make file.

    Gangaraju.

  9. #18
    Just Joined!
    Join Date
    Jun 2006
    Posts
    18
    Great!
    the example that afrolinux said would work! it could be compiled, but if insmod, there was no output.
    lsmod to display the modules, it can be seen clearly inside.
    Why the module did not output when it was inserted or removed?

    Any suggests will be appreciated!

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •