Re: Kernel related materail
Re: Kernel related materail
- Subject: Re: Kernel related materail
- From: "Alex Nelson" <email@hidden>
- Date: Wed, 30 Jan 2008 23:13:37 -0800
A kernel is simply a program which interfaces to the hardware directly, and presents functions to manipulate hardware ("system calls"). There are several ways to make a kernel.
The first and easiest is the monolithic kernel. It basically makes the operating system one big fat program. If there is a problem in one component of the kernel, the entire kernel crashes. So this is problematic when modifying the kernel source code.
The next approach is a hybrid kernel, or module-loading monolithic kernel (the two are more or less the same but hybrid kernel is a more general term). What happens is that the kernel now simply allocates and frees memory, and manages processes. So the rest of the operating system is simply "modules" which are loaded into memory and unloaded from memory. The operating system "grows" and "shrinks" when modules are loaded and unloaded respectively. A module is little more than a collection of function pointers. For more details on modules see O'Reilly's "Understanding the Linux Kernel" by Daniel P. Bovet and Marvo Cesati (Third Edition). More specifically Appendix B on modules. A module is the same thing as a kernel extension, just different phrases with the same meaning.
The advantage of module-loading kernels is that the entire system won't crash when testing experimental code. Simply put the experimental code in a module, and load it to test it. Of course, if the experimental code crashes, the entire operating system crashes.
As for understanding kernels better in general, well I think Maurice J. Bach's book does it far better than I could in such limited amounts of time I have free (I'm a math and physics double major with quite a full load!). Bach actually walks through the algorithms that they use in Unix V6 (I believe it to be V6 someone correct me if I am wrong!), and discusses the data structures used, etc. You can refer to the XV6 operating system I linked previously, which uses the same algorithms in modern C.
If you would like me to go into greater detail on something specific, I'd be glad to...
On Jan 30, 2008 10:30 PM, chinni <
email@hidden> wrote:
Really amazing Alex i will be thank full to you.can you please guide me more on kernel and kernal extensions.
sorry for disturbing you..:)On Jan 31, 2008 11:01 AM, Alex Nelson <
email@hidden> wrote:
Perhaps you should start with introductory texts to operating systems like "The Design of the UNIX operating system" by Maurice J. Bach for an introduction to Unix operating system algorithms...or for a more updated but general introduction to operating systems there is always Tanenbaum's and Woodhull's "Operating Systems: Design and Implementation" (Third Edition is best in my opinion), but for more directly applicable books perhaps "The Design and Implementation of the FreeBSD Operating System" by Marshall Kirk McKusick and George V. Neville-Neil. The latter assumes knowledge of operating system concepts, which is nicely introduced in Tanenbaum's book...but the FreeBSD one is most applicable to learning Darwin in my opinion since Darwin uses FreeBSD code.
So in summary:
* "The Design of the UNIX operating system" by Maurice J. Bach
* "Operating Systems: Design and Implementation" by Andrew Tanenbaum and Albert Woodhull
* "The Design and Implementation of the FreeBSD Operating System" by Marshall Kirk McKusick and George V. Neville-Neil
There is also an interesting toy operating system based off of Bach's book but written in "modern C" called "X86"...it was used at MIT to teach operating system concepts. I believe the source code is available semi-freely, the url for it is http://pdos.csail.mit.edu/6.828/2006/src/xv6-rev0.tar.gz and should be studied in conjunction with Bach's book.
As for introductory texts on C, well, if you know how to program "The C Book" is the classic introduction. If you don't know how to program, I wouldn't know which book is best to learn from...perhaps take a course on programming?
Cheers!
Alex Nelson
Hobo Extraordinaire
"Sing in me, Muse, and through me tell the
story
of that man skilled in all ways of contending,
the wanderer, harried for years on end..."
P.S. Perhaps putting your phone number in your signature isn't the best idea with a public mailing list...
--
Cheers,
M.Srikanth Kumar,
Phone no: +91-9866774007
--
Cheers!
Alex Nelson
Hobo Extraordinaire
"Sing in me, Muse, and through me tell the
story
of that man skilled in all ways of contending,
the wanderer, harried for years on end..."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden