Operating system. kernel mode/user mode

Reply

Join Date: Aug 2007
Posts: 63
Reputation: wonder_laptop is an unknown quantity at this point 
Solved Threads: 0
wonder_laptop wonder_laptop is offline Offline
Junior Poster in Training

Operating system. kernel mode/user mode

 
0
  #1
Feb 23rd, 2008
im new to OS.
i want somebody to please give me the differences between the kernel mode and the user mode.

are these block in memory ?

i did some research on the internet and all i understood was that kernel mode is protected from the user and it is where the operating system is and the user mode is not protected.

but can anybody give some examples to clarify this. and can you please explain what does it mean to say that to update linux you can simply download the kernel ! ( is the kernel a software )

thank you so much in advance
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Operating system. kernel mode/user mode

 
0
  #2
Feb 23rd, 2008
A kernel is the main program or component of an operating system, it's the thing that does all the work, without it you have no operating system. Linux is actually nothing more than a kernel; the programs that make up the rest of the operating system are generally GNU software, so the entire operating system is usually referred to as GNU/Linux.

User mode is the normal mode of operating for programs. Web browsers, calculators, etc. will all be in user mode. They don't interact directly with the kernel, instead, they just give instructions on what needs to be done, and the kernel takes care of the rest. Kernel mode, on the other hand, is where programs communicate directly with the kernel. A good example of this would be device drivers. A device driver must tell the kernel exactly how to interact with a piece of hardware, so it must be run in kernel mode. Because of this close interaction with the kernel, the kernel is also a lot more vulnerable to programs running in this mode, so it becomes highly crucial that drivers are properly debugged before being released to the public.

Finally, yes, updating Linux simply involves installing a new kernel because, as I said earlier, that's all 'Linux' really is. If you want to update the GNU programs that make up the rest of the operating system, you're going to have to use the tools that your Linux distribution provider supplied with the operating system.
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 63
Reputation: wonder_laptop is an unknown quantity at this point 
Solved Threads: 0
wonder_laptop wonder_laptop is offline Offline
Junior Poster in Training

Re: Operating system. kernel mode/user mode

 
0
  #3
Feb 23rd, 2008
Dear John , first i wanna thank you for your reply, now here are my questions :

A kernel is the main program or component of an operating system,(so you're sayin that the operating system is
made of many software/programs put together and the kernel is the main program)?

i read that any os has 2 main functionalities: extended machine(abstraction) and resources management.

"it's the thing that does all the work" (by work you mean : its responsible for the 2 functionalities i mentioned
earlier?)


what are the "GNU software"? ( i googled and found that these are free software but i didnt understand much).

"User mode is the normal mode of operating for programs.web browsers ".. (is "use mode" a place in memory ?
since the web browsers and calculators are in the user mode,it means they are installed in the portion of memory
that is specified to the user mode ?)

if i download any software from the internet, lets say "sticky notes software" , will it get installed in the "user mode?"

if i buy a printer and i put the driver cd in my laptop, will it get installed in the "kernel mode"?

so can we say that hard disk is partitioned into addresses for user mode and ones for kernel mode?

Sorry if im askin too much, but i bought i book and im learning about os and im totally new to this topic
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Operating system. kernel mode/user mode

 
0
  #4
Feb 23rd, 2008
Originally Posted by wonder_laptop View Post
A kernel is the main program or component of an operating system,(so you're sayin that the operating system is
made of many software/programs put together and the kernel is the main program)?
Yes. Any sufficiently-advanced operating system requires a number of programs to handle processes, memory management, disk usage, drivers, etc. And then it's usually not uncommon to include software that the user can use so they don't have to start from scratch.

i read that any os has 2 main functionalities: extended machine(abstraction) and resources management.

"it's the thing that does all the work" (by work you mean : its responsible for the 2 functionalities i mentioned
earlier?)
Abstraction is usually handled by higher-up processes (such as a GUI), although the kernel is mainly responsible for resources management (it also has processes that help it out). The kernel isn't concerned with the abstraction of an interface, in fact, it's more concerned with handling the actual commands that make up the program.

what are the "GNU software"? ( i googled and found that these are free software but i didnt understand much).
GNU is a recursive acronym for GNU's Not Unix. It's basically a project started about 24 years ago whose goal was to develop a Unix-like operating system. The kernel was never really finished, so when Linus Torvalds wrote the Linux kernel, they adopted it to complete their operating system.

"User mode is the normal mode of operating for programs.web browsers ".. (is "use mode" a place in memory ?
since the web browsers and calculators are in the user mode,it means they are installed in the portion of memory
that is specified to the user mode ?)
Yup. It's called 'user space' and 'kernel space', see http://en.wikipedia.org/wiki/User_space

if i download any software from the internet, lets say "sticky notes software" , will it get installed in the "user mode?"

if i buy a printer and i put the driver cd in my laptop, will it get installed in the "kernel mode"?
You can't really control which 'mode' it runs in. The way the programmer wrote the software will determine whether the program must run in user mode or kernel mode.

so can we say that hard disk is partitioned into addresses for user mode and ones for kernel mode?
No, not really. If you're really interested, study the basics of how a kernel module is written and how this is different from a regular program. Based on the calls that the program makes, the kernel determines whether it must be run in kernel or user mode.
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 63
Reputation: wonder_laptop is an unknown quantity at this point 
Solved Threads: 0
wonder_laptop wonder_laptop is offline Offline
Junior Poster in Training

Re: Operating system. kernel mode/user mode

 
0
  #5
Feb 23rd, 2008
well again , your answers were EXTREMELY HELPFUL...

one more question :
"If you're really interested, study the basics of how a kernel module is written and how this is different from a regular program."

do you have any idea where i can find information about that ?
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Operating system. kernel mode/user mode

 
0
  #6
Feb 23rd, 2008
I've never really done any kernel module programming, but I'll show you an example. Here's a typical 'hello world' program written to run in user mode. All it does is print out 'hello world' and then exit.

  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. printf("Hello, world!\n");
  6.  
  7. return 0;
  8. }

By contrast, here's a similar program running in kernel mode that prints out "Hello, world" and "Goodbye, world" to the kernel log. The code is taken from The Linux Kernel Module Programming Guide.

  1. /*
  2.  * hello-1.c - The simplest kernel module.
  3.  */
  4. #include <linux/module.h> /* Needed by all modules */
  5. #include <linux/kernel.h> /* Needed for KERN_INFO */
  6.  
  7. int init_module(void)
  8. {
  9. printk(KERN_INFO "Hello world 1.\n");
  10.  
  11. /*
  12. * A non 0 return means init_module failed; module can't be loaded.
  13. */
  14. return 0;
  15. }
  16.  
  17. void cleanup_module(void)
  18. {
  19. printk(KERN_INFO "Goodbye world 1.\n");
  20. }
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 63
Reputation: wonder_laptop is an unknown quantity at this point 
Solved Threads: 0
wonder_laptop wonder_laptop is offline Offline
Junior Poster in Training

Re: Operating system. kernel mode/user mode

 
0
  #7
Feb 23rd, 2008
well im gettin the hang of it now....you made things much clearer

would you mind if i keep in contact with you ?

here's my email address <email snipped> send me a msg to my hotmail if you dont mind us being in contact.

thank you for everything
Last edited by John A; Feb 23rd, 2008 at 7:20 pm. Reason: email snipped
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Operating system. kernel mode/user mode

 
0
  #8
Feb 23rd, 2008
No problem, glad to be of help.

Note that it's against the forum policy to post email addresses in your posts, although feel free to contact me with the email address listed on my profile.
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 63
Reputation: wonder_laptop is an unknown quantity at this point 
Solved Threads: 0
wonder_laptop wonder_laptop is offline Offline
Junior Poster in Training

Re: Operating system. kernel mode/user mode

 
0
  #9
Feb 23rd, 2008
oopss, sorry i totally forgot

execuse me guys
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 63
Reputation: wonder_laptop is an unknown quantity at this point 
Solved Threads: 0
wonder_laptop wonder_laptop is offline Offline
Junior Poster in Training

Re: Operating system. kernel mode/user mode

 
0
  #10
Feb 24th, 2008
Hello john

tis me again hope you're doing fine.

well, i have a couple of questions:

1- you told me that linux is the kernel itself, well about windows ? is the windows xp , for instance, considered as the kernel

2- i read this and i didnt really understand what it means , i hope you could help in explaining it to me:

" the distinction betwee user and kernel mode is sometimes blurred in embedded systens (which may not have kernel mode) or interpreted systems ( such as java-based operating systems that use interpretation, not hardware to seperate the components".
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Kernels and Modules Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC