Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

All RTOS (linux Based ) Other than RT-Linux

 
Goto page Previous  1, 2
   Soft32 Home -> Linux2 Arch -> Setup RSS
Next:  Linux XP Freespire Edition and Ubuntu Version 7.0..  
Author Message
The Natural Philosopher

External


Since: Jun 15, 2007
Posts: 161



(Msg. 16) Posted: Tue Aug 07, 2007 7:47 am
Post subject: Re: All RTOS (linux Based ) Other than RT-Linux [Login to view extended thread Info.]
Archived from groups: comp>os>linux>setup (more info?)

Matt Giwer wrote:
> The Natural Philosopher wrote:
>> Matt Giwer wrote:
>>> Peter Köhlmann wrote:
>>>> Matt Giwer wrote:
>>>>> The Natural Philosopher wrote:
>>>>>> Matt Giwer wrote:
>>>>> ...
>>>>>>> Change the BIOS to no keyboard? Or something like that. The
>>>>>>> keyboard is not a linux function. It only reads the BIOS.
>>>>>> Shows how little you know..most ROM BIOSES are TOTALLY bypassed by
>>>>>> linux. Their sole function is to get the OS in place with some
>>>>>> form of
>>>>>> basic keyboard and screen control. In case intervention is needed.
>>>>> I guess I have been confused by the necessity to have the BIOS
>>>>> reflect new
>>>>> hardware before linux notices it is there.
>>>> And right here you made the next error
>>> Odd that it is required. Perhaps you could take the time to explain.
>
>> Th BIOS merely provide a set of routines that are hopefully
>
>> - enough to get the machine to boot something else and
>> - MAY be used by whatever else runs to access the hardware, but its
>> only MAY.
>
>> In fact most OS'es these days simply use the BIOS to bootstrap the
>> boot loader, and maybe access the boot disk: Once the OS is loaded it
>> is completely bypassed.
>
>> So in reality, all the BIOS dos in most systems is run the disk system
>> and select a boot drive, and provide a minimal amount of
>> screen/keyboard stuff for boot diagnostics.
>
> What started this was my statement that the keypresses are found by
> accessing BIOS.
>
> However my experience is that all hardware changes have to be
> registered in BIOS before they are recognized by the OS, linux or
> otherwise. I can see how once in BIOS the OS knows what to "look" for
> and then deal with it.
>
> Not having actually followed the motherboard traces from the
> keyboard plug to see where they lead I cannot swear the BIOS is the only
> place where an OS can get the keypresses. However if the BIOS is not
> needed what his the physical access point the linux uses to get the
> keypress data?
>

Interrupt off the hardware controller that services the keyboard.

The vectors for these are held in RAM. They can be changed. You can
install your own. Most systems do. IIRC the first thing a bios will do
on boot is set these vectors up. Until it does the keyboard won;t work.
As soon as the OS kernel comes in, it will rewrite some or all of them
to point to its handlers.

What happens is that - say - a keypress is recogniosed by the keyboard
peripheral chip. A small computer in its own right, whose job is to wait
for keypresses and maybe mouse movements and the like. These days its
probably the generic USB controller, and every time a block of data
comes in,depending on how its programmed, it will either raise an
interrupt line on every byte, or when its small internal buffer is full.

The interrupt lines go into another small piece of hardware - the
interrupt controller - and that will register which peripheral has
raised the interrupt, and pass a general interrupt along to the
processsor, which will stop, shove its program counter in the stack,
read the interrupt NUMBER from teh interrupt controller, and jump
immdiately to the contents of teh NUMBERE'th row of a table held in
(low?) RAM That might at one time have been pointing at BIOS ROM, but
fter te OS has does its laoding, itr won;t be. It will point to the USB
interrupt service routine.

What THAT des is read te USB device directly, and find out something
about the device that caused the USB port to wake up. Decide its a
keyboard key press and jump to a specific bit of code that will reda
that byte of data, put it in a buffer, raise a flag to say 'keyboard
data available' and then probabably call the scheduling part of the
multitasker to tell it to resume any threads that are halted pending
keyboard input. Then it will issue a return from interrupt and teh
processor will resume what it was doing by popping its program cunter
from the stack.

Now the next time the scheduler suspends the thread the processor was
executing, it will immediately resume whatever task(s) was/were waiting
for keyboard input. In whatever priority they were listed. Example: Some
keys are flagged as super keys' and may be examined and acted on by the
low level daemons..a break key for example will be examined by low level
software t see if it means it needs to do Something Awful. So every
process that MIGHT want to know what key is pressed or what button is
clicked must examine all the inputs, and if they decide its not for
them, leave it there and go back to sleep. Finally someone - say the
application focus - gets the keystroke and says 'aha' I must type an A
on the application..AND REMOVE IT FROM THE BUFFER. At this point its
gone, No other application will get it, and if there are other lower
priority task that might be waiting for it, they will either find no
data, or won't even be woken up. If the keyboard interface is written
well, it will call the scheduler when the command 'empty the buffer' is
received and clear all wakeup flags from threads waiting for keyboard input.

Don;'t hold me to the exact details of this, buts thats broadly how it
happened the last time I wrote this sort of stuff, which was 20 years
ago on an 8086...Smile

The fundamental thing is that a BIOS ONLY has to carry enough code to
boot the OS. Essentially that means

- set up a basic screen and keyboard and disk driver kernel
- read the NVRAM to find out where to boot from, and what type of built
in driver to use.
-load and dive into the boot loader
- bye bye kansas.

After that the whole machine apart from the BIOS PROMS is available
for modification, and in most cases, it will be modified completely.

In general the kernel will rush around interrogating I/O ports to find
responses it recognises, and setting up handlers for what it finds: In
case of unknown issues, it will refer to its disk based config files to
load the correct stuff. Once it is relatively happy, it will launch the
init daemon, which looks in ITS config files and carries on spawning
daemons that get the machine up and running, until it finally spawns
some kind of user interface.

At that point the BIOS is just a set of ROMS, idle and silent, and
completely forgotten.

If for no other reason than the ROM bus speed is often WAY below the RAM
bus speed: Using the ROMS will slow you down.

So, The onboard ROM BIOS only needs to understand the boot hardware. Of
course you COULD talk about the hardware interface systems in the kernel
as a BIOS as well, and be correct to do so, but BIOS on Intel machines
of the PC variety is generally held to be that part that comes with the
hardware in ROM: In a Linux context the terns 'device drivers' or
'device subsystem' and 'kernel' would be used instead to talk about
various aspects of the kernel that deal with interfacing with the hardware.

I hope that helps.
Back to top
Login to vote
Matt Giwer

External


Since: Jun 08, 2006
Posts: 201



(Msg. 17) Posted: Tue Aug 07, 2007 8:20 pm
Post subject: Re: All RTOS (linux Based ) Other than RT-Linux [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The Natural Philosopher wrote:
....
> I hope that helps.

Yes, thank you.

--
Every paid position as a university professor originated as a labor of love
without any form of financial reward.
-- The Iron Webmaster, 3849
nizkor http://www.giwersworld.org/nizkook/nizkook.phtml
Iraqi democracy http://www.giwersworld.org/911/armless.phtml a3
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Linux web based online conferencing systems - I need a simple but stable online conferencing system which also supports user file upload and download. We'd rather....

Can you run a GUI-based file manager from CD-booted Linux? - Hello, Please bear with me if my question sounds too novice, because I am. Is it possible to launch a GUI-based file..

linux.kernel, mlist.linux.kernel, lucky.linux.kernel, comp.. - Hi *, .. you could compile an application into the kernel, but I was wondering what a difference does it actually make...

Red Hot Linux v9.0 [2 DVDs]. Red Hot Linux v9.0 [3 CDs]. R.. - Red Hot Linux v9.0 [2 DVDs]. Red Hot Linux v9.0 [3 CDs]. Redhat Enterprise Linux ES v3.0 REPACK [4 CDs]. Mandrake Linux...

Hello good hearted linux folks: help me this time in linux.. - Hello good hearted linux folks: Due to hard drive crash or something, I lost all my windows systems and the data and..

Problems with finding headers for linux 2.4.22 during util.. - While attempting to build linux from scratch ( see www.linuxfromscratch.org ) I run into a nasty problem with util-linu...
       Soft32 Home -> Linux2 Arch -> Setup All times are: Pacific Time (US & Canada) (change)
Goto page Previous  1, 2
Page 2 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
 Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]