0

I want to make a module that print console, current folder name like pwd, but I don't know how with system calls ? or something else ? if system calls, what is the system call of that ? and how can I use this system call on my module.?

3
Contributors
5
Replies
7
Views
8 Years
Discussion Span
Last Post by fenerista
0

I want to make a module that print console, current folder name like pwd, but I don't know how with system calls ? or something else ? if system calls, what is the system call of that ? and how can I use this system call on my module.?

I'm pretty sure you can't use system calls in a kernel module.

0

if there is another way to print current folder name to conslole with a module. You can say it.

I also want to print system time or process list to console.

and İs there a way to change my thread title :) I forgot "print" "How can I print current folder name like pwd ?(Module Programming) "

Edited by fenerista: n/a

0

if there is another way to print current folder name to conslole with a module. You can say it.

I also want to print system time or process list to console.

and İs there a way to change my thread title :) I forgot "print" "How can I print current folder name like pwd ?(Module Programming) "

i found to how print process list

/* ProcessList.c 
    Robert Love Chapter 3
    */
    #include < linux/kernel.h >
    #include < linux/sched.h >
    #include < linux/module.h >

    int init_module(void)
    {
    struct task_struct *task;
    for_each_process(task)
    {
    printk("%s [%d]\n",task->comm , task->pid);
    }
   
    return 0;
    }

   
    void cleanup_module(void)
    {
    printk(KERN_INFO "Cleaning Up.\n");


    }

probably there is a simple way like this to print current folder name

Edited by fenerista: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.