What does a kernel actually do?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

What does a kernel actually do?

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:43 pm, edited 2 times in total.
Whatever5k

Re:What does a Kernel actually do?

Post by Whatever5k »

The kernel is the "heart" of the Operating System. It never returns, but stays always "alive", ready for handling user requests (i.e. system calls or process managament).
There are two types of kernels: a monolothic kernel (like Linux) has every "feature" (process management, memory manager, file system, etc.) in *one* file - the kernel. The second type is the microkernel (i.e. Minix). The idea of the microkernel is to split up the kernel into different parts, so that it becomes easier. For example, the process manager or the memory manager are processes theirselves. The kernel's job is to manage the communication between all those managers...
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:What does a Kernel actually do?

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:43 pm, edited 1 time in total.
Whatever5k

Re:What does a Kernel actually do?

Post by Whatever5k »

The user requests something via system calls. These system calls are realized by the IDT...
DarylD

Re:What does a Kernel actually do?

Post by DarylD »

I don't know how many times you need to be told Perica, but BUY SOME BOOKS! This is all explained in books. I personally recommend the Silbershatz one, it explains things very well.

Also, don't worry about building a GUI, this won't happen for months at least. You need a good strong foundation before this can happen.

Basically, a kernel does the following:

Manage memory
Manage hardware (resource/devices)
Manage processes and threads
Manage any kernel objects
Manage I/O (file systems etc)

Pretty much everything can be covered by what I have listed. The hard bit is making it do all this well.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:What does a Kernel actually do?

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:43 pm, edited 1 time in total.
Mr_Spam

Re:What does a Kernel actually do?

Post by Mr_Spam »

you will have to make your own libary for your kernel support, untill your kernel supports the system calls made by the standard libary. you will still want your own libary for kernel specific proccesses.
jrfritz

Re:What does a Kernel actually do?

Post by jrfritz »

Berserk has a username! :o

Well, I suggest to understand what a OS does...and to, you must get this book: Operating Systems: Design and Implemetation

It shows you whatever will happen in a OS...everything you need to know about what a OS does.

I don't think you can really understand a OS without this book.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:What does a Kernel actually do?

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:44 pm, edited 1 time in total.
PlayOS

Re:What does a Kernel actually do?

Post by PlayOS »

Is it really possible that you cannot see what Tom is saying?

This book will give you experience, you will get better results following this book that you will from following some online tutorial. If I understand correctly, this book details everything that is needed to get a decent little OS up and running, what more could you want?

And why do you still ask for things to be done for you, you got a simple list from DarylID, I am sure you can work out what functions you will need.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:What does a Kernel actually do?

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:44 pm, edited 1 time in total.
jrfritz

Re:What does a Kernel actually do?

Post by jrfritz »

Well, it is done many ways like:

Ints, RAM, memory locations, etc...

and the book explains stuff like that.

I tried to escape books...but you just can't.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:What does a Kernel actually do?

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:44 pm, edited 1 time in total.
Slasher

Re:What does a Kernel actually do?

Post by Slasher »

hi,
we are not annoyed, just giving you the RIGHT answers!
anyway, after you have explained your situatuion here is some advice and info

visit a library near you ask for the system programming section under computing or computer science.
Then you can get the Intel docs, seach this forum with 'Intel Manaul' or 'Intel Docs'

This is how I see the kernel:-
The kernel is just a libray of fuctions that provide users with a much easier to use and more useful machine!
That is basically what the Kernel does, so if you right one that just accepts input from the keyboad and prints it to the screen, that is what your KERNEL is designed for! Its up to you what you put in the kernel!

The big question is 'HOW DO I PUT XXXXX IN A KERNEL'?
First place to start learning would be with the docs for the platform you will support in the os ie download docs on KEYBOARDS,the PIC, FLOPPY DRIVE etc for how to access the registers and program them directly.
For the Kernel design, you will need BOOKS ( I KNOW YOU HAVE TOLD US NOT TO PULL THAT WORD OUT OF OUR BAGS AGAIN!)
Kernels are usually designed as Monolithic or MICRO, of course there are other types of design.

Monolithic kernel: - EVERYTHING THE KERNEL DOES IS COMPILED TOGETHER into a single BINARY

Micro Kernel: - The kernel is divided into parts that perform one specific task. each section communicate with one another (only when necessary) by a mechanisim called INTERPROCESS COMMUNICATION AND SYNCHRONISATION
this can be done with SEMAPHORES, MESSAGE PASSING, MONITORS etc (Use google to seach for these keywords combined with operating system).

In any design, the kernel is the one that
Monitors the programs(processes) in execution
allocates resources(MEMORY,FILE BLOCKS,DMA etc) to the processes as they demand them
Handles the scheduling of processes based on some policy(ies)
Protectes one process from another
controls the hardware.

Your kernel could support
single process :- only one process runs at a time and is the only one loaded in memory

multi process: - more than one process is running at any particlar time T, but there are many such programs in memory that can run, they only need to be given the CPU to do so. this is achieved by switching rapidly between these tasks to give the user(s) the impression that all the programs are running simultaneously at the same time! (this is where the SCHEDULING POLICES AND TASK SWITCHING FUNCTIONS OF THE KERNEL COME INTO PLAY)

Talking about kernels can fill VOLUMES, as you know.
So Tell us what exactly you need.
hope i have not CONFUSED you any Further! :)
Schol-R-LEA

Re:What does a Kernel actually do?

Post by Schol-R-LEA »

I understand that you learn best through experience, Perica, but trying to understand operating system design through cut and try, without any theoretical background, really is a futile task. At least some of these books should be available in an university library, or even a medium-sized city's public library.

If nothing else, it would be a good idea to skim through the mirror of An Operating Systems Vade Mecum that is on the OSRC site (under 'Miscellaneous Software'). While it is quite dated in many respects, and a bit too theorectically inclinded, it covers most of the important material in a clear manner. Not too shabby for a free resource, eh?
Post Reply