OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 11:01 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How does process system work?
PostPosted: Sun May 20, 2001 11:00 pm 
Hello people,
Anyone know how does the process system should work?
My problem is with the concept that if the CPU is
keep on switching back and forth b/t several processes
, if the user is using say process C and whie the
user is typing in something the CPU switched off
to another process say D, what happens to the user
then? Is the process model saying that any data
intercepted are stored in the stack later poped back
out as the user program (process C in this case)
is using the CPU again? Or is it just simply that
all other processes have to wait until an user process
is done? Or is my concept entirely wrong?

Thanks.


Top
  
 
 Post subject: RE:How does process system work?
PostPosted: Mon May 21, 2001 11:00 pm 
Except in as single tasking OS a process is not directly
resonsible for things like reading from the keyboard.
The typically model as I understand it is that when a keyboard interrupt
occurs the OS switches to the keyboard handler and saves the keystrokes.
What makes everything work out ok is that in addition to saving the keystrokes
the OS also saves information about what application was currently selected
in the forground). Then it's possible that when a process in a certain
application calls an OS service to read from the keyboard, then the OS figures
out what keystrokes to report back to the process.

Is that kind of what you where asking?


Top
  
 
 Post subject: RE:Howšdoesšprocessšsystemšwork?
PostPosted: Sat Jun 09, 2001 11:00 pm 
>On 2001-05-21 11:17:22, Ben Hsu wrote:
>Hello people,
> Anyone know how does the process system should work?
>My problem is with the concept that if the CPU is
>keep on switching back and forth b/t several processes
>, if the user is using say process C and whie the
>user is typing in something the CPU switched off
>to another process say D, what happens to the user
>then? Is the process model saying that any data
>intercepted are stored in the stack later poped back
>out as the user program (process C in this case)
>is using the CPU again? Or is it just simply that
>all other processes have to wait until an user process
>is done? Or is my concept entirely wrong?

There is only one program which allows user input,
e.g. a program that holds input focus. You don't
have 2 keyboards or 2 users, do you? :)
So one of the processes holds the focus and
input from the keyboard and mouse (if the pointer
is inside the program's window or the program
occupies the entire screen) and everything goes
to this process.
Now, there's also only one process that is
currently executed by the OS and CPU. And this one
doesn't have to be the same focused process, they
can be different ones.
You may wonder how would you get anything in the
focused program if it's not the current one, right?
But it's not a problem. Pressed buttons and
mouse movements generate IRQs that are handled
right away and the OS may either copy this info to
the focused process or put it into a buffer and
finish everything later, when focused becomes
current.


Top
  
 
 Post subject: RE:Howšdoesšprocessšsystemšwork?
PostPosted: Sat Jun 09, 2001 11:00 pm 
>On 2001-05-21 11:17:22, Ben Hsu wrote:
>Hello people,
> Anyone know how does the process system should work?
>My problem is with the concept that if the CPU is
>keep on switching back and forth b/t several processes
>, if the user is using say process C and whie the
>user is typing in something the CPU switched off
>to another process say D, what happens to the user
>then? Is the process model saying that any data
>intercepted are stored in the stack later poped back
>out as the user program (process C in this case)
>is using the CPU again? Or is it just simply that
>all other processes have to wait until an user process
>is done? Or is my concept entirely wrong?

There is only one program which allows user input,
e.g. a program that holds input focus. You don't
have 2 keyboards or 2 users, do you? :)
So one of the processes holds the focus and
input from the keyboard and mouse (if the pointer
is inside the program's window or the program
occupies the entire screen) and everything goes
to this process.
Now, there's also only one process that is
currently executed by the OS and CPU. And this one
doesn't have to be the same focused process, they
can be different ones.
You may wonder how would you get anything in the
focused program if it's not the current one, right?
But it's not a problem. Pressed buttons and
mouse movements generate IRQs that are handled
right away and the OS may either copy this info to
the focused process or put it into a buffer and
finish everything later, when focused becomes
current.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 204 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group