943,791 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Feb 23rd, 2008
-1

Operating system. kernel mode/user mode

Expand Post »
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
Similar Threads
Reputation Points: 25
Solved Threads: 0
Junior Poster in Training
wonder_laptop is offline Offline
89 posts
since Aug 2007
Feb 23rd, 2008
0

Re: Operating system. kernel mode/user mode

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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Feb 23rd, 2008
0

Re: Operating system. kernel mode/user mode

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
Reputation Points: 25
Solved Threads: 0
Junior Poster in Training
wonder_laptop is offline Offline
89 posts
since Aug 2007
Feb 23rd, 2008
1

Re: Operating system. kernel mode/user mode

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.

Quote ...
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.

Quote ...
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.

Quote ...
"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

Quote ...
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.

Quote ...
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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Feb 23rd, 2008
0

Re: Operating system. kernel mode/user mode

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 ?
Reputation Points: 25
Solved Threads: 0
Junior Poster in Training
wonder_laptop is offline Offline
89 posts
since Aug 2007
Feb 23rd, 2008
1

Re: Operating system. kernel mode/user mode

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. }
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Feb 23rd, 2008
0

Re: Operating system. kernel mode/user mode

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
Reputation Points: 25
Solved Threads: 0
Junior Poster in Training
wonder_laptop is offline Offline
89 posts
since Aug 2007
Feb 23rd, 2008
1

Re: Operating system. kernel mode/user mode

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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Feb 23rd, 2008
0

Re: Operating system. kernel mode/user mode

oopss, sorry i totally forgot

execuse me guys
Reputation Points: 25
Solved Threads: 0
Junior Poster in Training
wonder_laptop is offline Offline
89 posts
since Aug 2007
Feb 24th, 2008
0

Re: Operating system. kernel mode/user mode

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".
Reputation Points: 25
Solved Threads: 0
Junior Poster in Training
wonder_laptop is offline Offline
89 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Kernel and Hardware Setup Forum Timeline: Linux Box -> Windows Box
Next Thread in Linux Kernel and Hardware Setup Forum Timeline: kernal module





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC