Answer to: What is a kernel?

Dirk Broer OADDAB at abacus.gsfc.nasa.gov
Thu Oct 27 14:46:30 GMT 1994


I'm going to add my .02...

>| Question: what is a kernel?
>
>It's like an operating system. It dispatches and organizes the execution of
>various tasks (a scheduler). It provides a mean for inter-task communication

Kernals can be far less - only if its multi-tasking would it have a scheduler.  
But the question would be "why bother?" if it wasn't multitasking.

>and task isolation. For example, the task controlling injector duration
>does not need to know how to measure, say, the coolant temp. The kernel
>periodically runs a task that does that and communicates that value to the
>injector duration task. It provides a higher degree of isolation and
>structure to the problem. It also organizes competing task for things like

It could also cause the program to be larger and slower - something to be 
looked at.

>hardware. By the use of semaphores, the resource of an ADC can be
>allocated to the coolant measurement task, air temp measurement task, O2
>sensor measurement task, etc. All of which can run at different rates and be

One thing you can do - you can write your own kernel - very easily in fact.  
Might I suggest rather than semaphores you go with drivers that have exclusive 
control over a resource.  Less chance of a programming error (did you remember 
to check and lock and then unlock the resource?  What if an interrupt happened 
at just the wrong time and another string of code tried to lock etc.)

>unaware of the others. Bottom line: a large problem like EFI can be broken up
>into several smaller tasks that may only need a few lines of C-code!
>
>It's an alternative to writing one long "loop" of software that must keep
>track of timing and on which loops to measure what and when to do this or
>that. The kernel will do all that for you. Ok... It's a luxury... :)

One big thing to look at is the timing available.  Some commercially available 
kernals don't have provisions for very accurate timing.  There are more than a 
few that say they guarrantee + or - .05 seconds or resolution to 1/10 of a 
second - maybe not good enough.  The problem is the kenel gets an interrupt 
every lets say 1/10 of a second - it then suspends the current task and then 
selects the next task to run - and then returns from the interrupt.  The 
question becomes "How many interrupts per second can the hardware support 
without significantly affecting the task execution?"

You'll have to look at your hardware and decide what kind of load it can take.  
If you have hardware - like a separate chip - that handle ignition timing.  And 
this chip required only a number for timing advance - and the chip controled 
the spark - then yes telling it every 1/10 of a second will be O.K.  Now if 
your processor can handle 1000 interrupts a second (there will be a spec on how 
long it takes to service and interrupt) you might make this work without the 
special chip.  All things to consider...

Dirk




More information about the Diy_efi mailing list