Find the answer to your Linux question:
Results 1 to 5 of 5
how can I modify keyboard.c that is in the kernel and print sth (such as process id list) on the screen when user press a specific key(such as F4 key)....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    3

    modifying linux kernel...help


    how can I modify keyboard.c that is in the kernel and print sth (such as process id list) on the screen when user press a specific key(such as F4 key).

  2. #2
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    Location
    Holland
    Posts
    301
    Quote Originally Posted by cagatay85
    how can I modify keyboard.c that is in the kernel and print sth (such as process id list) on the screen when user press a specific key(such as F4 key).
    Sorry, but if you want that, that's not the way. Up some abstraction levels. Modify the /usr/share/keymaps/i386/qwerty/*.gz corresponding to your keymap.

    However, doesn't top, ps and other process tools work for you?

    Best Regards

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    3
    ok but I wonder how I can modify the kernel and create my own system. according to my example this system print to the screen processes id when user press F4 key. but the problem is there is no "ps" command in kernel level.

  4. #4
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    Location
    Holland
    Posts
    301
    Quote Originally Posted by cagatay85
    but the problem is there is no "ps" command in kernel level
    I know, I just said that because unless this is any kind of kernel-programming exercise there is no reason for trying to solve that problem in kernel-space. That can be resolved with ps, top and other user-space tools from a user-space point of view.

    If regardless of this, you still want to modify your kernel unnecessarily, write your code in keymap.c. It will make a printk for every task's pid while traversing the task list.

    Best Regards

  5. #5
    Just Joined!
    Join Date
    Oct 2006
    Posts
    3
    unless this is any kind of kernel-programming exercise there is no reason for trying to solve that problem in kernel-space.

    yes I want to exercise and improve my kernel-programming ability, as I said before I want to create my own system.

Posting Permissions

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