question : is the init process of kernel running in kernel space or user space?

2005-04-17 Thread Tomko
Hi all,
In the linux system , kernel is often starting up like this :
bootloader -> start_32() -> start_kernel() -> init()
i would like to ask what is the piority level in this starting procedure 
? 0 or 3 ? that means, this start up process are running in kernel space 
or user space ?  or the level is keep changing ?
If it is in kernel space from the very beginning , at which point the 
system is switched into user space ? is it at the time when kernel open 
the shell ?

I am new to linux, hope someone can help me here.
Regards,
TOM
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


question about returning of a child process

2005-04-14 Thread Tomko
Hi all,
What is  the first code the new born child process run after it is 
forked by the system call and being schduled into the CPU to run ? what 
i concerned is , kernel will schdule once when leaving the system call 
for returning father process, will kernel schdule once again when 
leaving the systemcall for child process if the child process return 
code is inside the kernel space?

Hope someone can answer me.
TOM
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Why system call need to copy the date from the userspace before using it

2005-04-13 Thread Tomko
Catalin Marinas wrote:
Tomko <[EMAIL PROTECTED]> wrote:
 

Inside the system call , the kernel often copy the data by calling
copy_from_user() rather than just using strcpy(), is it because the
memory mapping in kenel space is different from user space?
   

No, it is because this function checks whether the access to the user
space address is OK. There are situations when it can also sleep (page
not present).
 

what u means "OK"?  kernel space should have right to access any memory 
address , can u expained in details what u means "OK"?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Why system call need to copy the date from the userspace before using it

2005-04-13 Thread Tomko
hi ,
Thank you for your reply, can i ask some more question?
Inside the system call , the kernel often copy the data by calling 
copy_from_user() rather than just using strcpy(), is it because the 
memory mapping in kenel space is different from user space?  for example 
, now user program want to pass a pointer *a to kernel space , is it 
true that *a seems means address 0xb000 to user space but actually it is 
at 0xc000 at kernel space?

Thx a lot,
TOM
Jan-Benedict Glaw wrote:
On Wed, 2005-04-13 12:21:41 +0800, Tomko <[EMAIL PROTECTED]>
wrote in message <[EMAIL PROTECTED]>:
 

While i am reading the source code of the linux system call , i find 
that the system call need to call copy_from_user() to copy the data from 
user space to kernel space before using it . Why not use it directly as 
the system call has got the address ?  Furthermore , how to distinguish 
between user space and kernel space ?
   

Think about the memory access. The page that contains the data could be
swapped out, so the kernel isn't allowed to just access it, because it's
not there.
MfG, JBG
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Why system call need to copy the date from the userspace before using it

2005-04-12 Thread Tomko
Hi all,
I am new to linux , hope someone can help me.
While i am reading the source code of the linux system call , i find 
that the system call need to call copy_from_user() to copy the data from 
user space to kernel space before using it . Why not use it directly as 
the system call has got the address ?  Furthermore , how to distinguish 
between user space and kernel space ?

Thx a lot,
TOM
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


question about execve()

2005-04-10 Thread Tomko
Hi,
I would like to ask when a userprogram called in user space called 
execve("/bin/abc"   will  this system call finally copy the code of 
/bin/abc into kernel space before kernel runs it or just leave the code 
in the userspace and run directly ?  If the system really copy the 
program into kernel space , why ?
Hope some one can tell me

Regards,
TOM
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/