What is this function doing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

Can anybody explain what is this function in this module doing.  this
is newbie question but thank you for any help?

static int my_init_module(void)
{
        if (verbose) {
            printk(KERN_ALERT "Module %s has been loaded.\n", MYMODNAME);
        }

        /* matching process */
        struct task_struct *p = NULL;
        p = find_task_by_pid(1);

        else {

        struct thread_struct *thread = &p->thread;
         struct vm86_struct *vm86 = NULL;
         vm86 = thread->vm86_info;
        /*  vm86 = p->thread.vm86_info; */
                pid_t mypid;
                mypid = p->pid;
                if (verbose)
                printk(KERN_ALERT "process pid 1 init.\n");
                printk(KERN_ALERT "printit: p = %p\n", p);
                printk(KERN_ALERT "printit: The instruction pointer
for init is: %lu\n", KSTK_EIP(p));
                printk(KERN_ALERT "printit: The stack pointer for init
is: %lu\n", KSTK_ESP(p));
                printk(KERN_ALERT "printit: The fs register contains
%lu\n", thread->fs);
}
-- 
F. A.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux