Re: [LIP] A few queries
Arun Sharma <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jun 07, 2004 at 11:38:01AM +0530, suresh kumar wrote: > > Hi, > 1)Can kernel directly access the user space address. If it can, > why do we need the macros copy_from_user, copy_to_user etc... > If it can'y why is it so? I have seen in the system call It can. But it needs to be careful, because the user can pass a bad pointer. In such cases, the kernel needs to check the access and return -EFAULT. A bad pointer dereference from the kernel causes an oops. > implementation on x86, eax has the system call index, > ebx,ecx,edx,esi,edi are the registers that has > parameters to the system call. If the no of parametres > are more than five, then they are stored in a structure > and address of the structure is passed in one of the registers. > Which means to my understanding, we are passing the address in > the user space to the kernel. Yes, that's the i386 syscall calling convention. > 2) I read in lot many places, that two tasklets of the same type > can not run simultaneously. But I haven't seen ne type of the > tasklet defined. Does the type mean one of the 4 softirqs. Is it > like if a keyboard driver raises a tasklet of type TASKLET_SOFTIRQ, > a sound card diver also raises a tasklet of type TASKLET_SOFTIRQ, > only one of them will be running and not both a the same time on > SMP. I just want to know is that true. > Or is it like, two tasklet from the same driver can't be run > simultaneously on diff processors on SMP. > Correct my understanding. The I-ll-do-it-later reference I sent to the list earlier should answer these questions ? TASKLET_SOFTIRQ is not a type of tasklet. It's a type of softirq. If you search for tasklet_init() in the kernel sources, you'll find about 60 hits as of 2.6.6. Each one of them is a type of tasklet. -Arun ------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org