how to implement mmap for sysfs device driver

2013-09-20 Thread Niroj Pokhrel
other than this ?? Thanking you in advance. Thanks and Regards, Niroj Pokhrel ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

How to create sysfs file and associate it with file operations like mmap

2013-09-18 Thread Niroj Pokhrel
here anyway if I want to put this file in sec_class. Thanking you in advance. Thanks and Regards, Niroj Pokhrel ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: Why we Use both mm_users and mm_count in struct mm_struct{ }

2013-03-24 Thread Niroj Pokhrel
*oldmm; > > > > prepare_task_switch(rq, prev, next); > > > > mm = next->mm; > > oldmm = prev->active_mm; > > /* > > * For paravirt, this is coupled with an exit in switch_to to > > * combine the page table reload

Why we Use both mm_users and mm_count in struct mm_struct{ }

2013-03-22 Thread Niroj Pokhrel
r the mm_users count reduce to zero. May be the explanation is simple but I'm lost. Thanking all of you in advance. Regards, Niroj Pokhrel ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailma

Re: Memory allocations in linux for processes

2013-03-19 Thread Niroj Pokhrel
On Tue, Mar 19, 2013 at 8:27 PM, Mulyadi Santosa wrote: > Hi Niroj > > Please see inlined answer below... > > On Mon, Mar 18, 2013 at 5:28 PM, Niroj Pokhrel > wrote: > > Hi all, > > As I have read, whenever we execute a program, the memory is allocated in &g

Memory allocations in linux for processes

2013-03-18 Thread Niroj Pokhrel
Hi all, As I have read, whenever we execute a program, the memory is allocated in different sections viz stack, text and data segment. But, since we have used loader and linker the three allocations will happen for them too. But when I ran a program and did pmap pid, I saw several other fields whic

Re: Need of different memory zones

2013-03-15 Thread Niroj Pokhrel
On Fri, Mar 15, 2013 at 12:31 PM, Arun KS wrote: > Hi Niroj, > > On Wed, Mar 13, 2013 at 3:16 PM, Niroj Pokhrel > wrote: > > Hi All, > > > > I have been studying Memory Management in linux. But I am confused with > the > > division of different ZONE. The

Need of different memory zones

2013-03-13 Thread Niroj Pokhrel
onfused. Please Help. Thanking you in Advance Yours, Niroj Pokhrel ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

location of inbuilt system call implementation

2013-03-10 Thread Niroj Pokhrel
Hi All, I am newbies to Linux and am going through system call in kernel-3.4. I just wanted to check how sys_read, sys_write or other system calls work but I was searching for the implementation but couldn't find it. I found that : System Call are added in /arch/x86/syscalls/syscall_32(or64).tbl. a

Re: no error thrown with exit(0) in the child process of vfork()

2013-01-18 Thread Niroj Pokhrel
On Sat, Jan 19, 2013 at 8:13 AM, Peter Teoh wrote: > > > On Sat, Jan 19, 2013 at 5:49 AM, wrote: > >> On Fri, 18 Jan 2013 19:59:38 +0530, Niroj Pokhrel said: >> >> > I have been trying to create a process using vfork(). And both of the >> child >> &g

no error thrown with exit(0) in the child process of vfork()

2013-01-18 Thread Niroj Pokhrel
Hi all, I have been trying to create a process using vfork(). And both of the child and the parent process execute it in the same address space. So, if I execute exit(0) in the child process, it should throw some error right. Since the execution is happening in child process first and if I release

working of fork and exec

2013-01-17 Thread Niroj Pokhrel
Hi all, I have been using fork and exec for sometime. But I have no idea about what are the things done by the kernel when we fork or exec and how things work. How the kernel load new program and what all things are done ... Can anybody please explain me this ? Thank you in advance. ___

how to flush stdin buffer in linux

2013-01-08 Thread Niroj Pokhrel
Hi all, I tried to use fflush(stdin) in gcc as I used to in other compilers. But It didn't clear my buffer so I am wondering how can I clear the stdin buffer in GCC. I tried using lseek but got -EPIPE (as tty devices doesn't support lseek operation). Thanx in advance. __

calling system call in arm from user space

2012-12-25 Thread Niroj Pokhrel
e in r0 and how can I move this value to the user variable. Thanking you in advance. -- Niroj Pokhrel Software Engineer, Samsung India Software Operations ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/m

Re: EACESS when trying to open the file

2012-12-22 Thread Niroj Pokhrel
On Sat, Dec 22, 2012 at 9:49 PM, Adel Qodmani wrote: > I am not sure, but try running your application as a root > > Adel, > > > On Sat, Dec 22, 2012 at 6:09 PM, Niroj Pokhrel wrote: > >> Hi, >> I have been trying to open a character device and getting the f

EACESS when trying to open the file

2012-12-22 Thread Niroj Pokhrel
Hi, I have been trying to open a character device and getting the following error : open("/dev/mychardev", O_RDONLY)= -1 EACCES (Permission denied) What do I have to change my permission mode ?? Please help. Thanx in advance . -- Niroj Pokhrel Software Engineer, Samsung Indi

Re: Need of MODULE_LICENSE("GPL")

2012-12-20 Thread Niroj Pokhrel
On Thu, Dec 20, 2012 at 4:00 PM, Ivan Nikolaev wrote: > Modules which are not declared.as GPL, by default are considered > proprietary. Proprietary code can't make use of GPLed modules. > 20.12.2012 12:03 пользователь "Niroj Pokhrel" > написал: > >> Hi,

Need of MODULE_LICENSE("GPL")

2012-12-20 Thread Niroj Pokhrel
he symbols. Thanks in advance. -- Niroj Pokhrel Software Engineer, Samsung India Software Operations ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Opening a device driver file.

2012-12-17 Thread Niroj Pokhrel
string is %s ",Buffer); strcpy(Buffer,"Niroj you are a dude"); if(write(fd,Buffer,sizeof(Buffer))==0) printf("\nThe data hasn't been written"); return 0; } Output: Device Open Failed -1 -- Niroj Pokhrel Software Engineer, Samsung India Software Operations ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[no subject]

2012-12-05 Thread Niroj Pokhrel
Hi, I'm trying to work on android audio (pcm_native.c) but got stuck in some parameters like start threshold, stop threshold, silence zone, silence threshold. Can anybody please elaborate on what they are each used for ?? -- Niroj Pokhrel Software Engineer, Samsung India Software Opera

Re:

2012-10-15 Thread Niroj Pokhrel
ias@googlemail.com> wrote: > Hi, > > > On 10/15/2012 11:24 AM, Niroj Pokhrel wrote: > >> Hi, >> I'm new to linux and kernel . I'm ongoing with the linux device drivers. >> I've followed the the book LDD but i'm lost about how to call my >> driver&

[no subject]

2012-10-15 Thread Niroj Pokhrel
sure that when I read or write that it implement the functions via the methods i have implemented in my module. -- Niroj Pokhrel NIT Jamshedpur, B.Tech,Electronics and Communication ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http: