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.?

Recommended Answers

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 …

Jump to Post

Syscall

I recently used this...
HTH's

sinnerFA

Jump to Post

All 5 Replies

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.

Syscall

I recently used this...
HTH's

sinnerFA

Syscall

I recently used this...
HTH's

sinnerFA

Thx very much

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) "

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.