STDIN / STDOUT

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.
Post Reply
pepito

STDIN / STDOUT

Post by pepito »

Hello:

I want to implement the STDIN/STDOUT into my OS, but I don't know how.

If I open this streams for each process then I will have so much STDIN/STDOUT streams (one for each process).

But if I open this streams at kernel level (when the OS starts), how can I access this streams from the user process?

Any idea?

Thank you very much,

pepito
carbonBased

RE:STDIN / STDOUT

Post by carbonBased »

Open the streams at the kernel level, as all OSs do, and assign the streams to one app at a time.

No more then one app at a time can access STDIN/STDOUT at the same time, anyway, unless they agree upon a sharing API.

Jeff
proxy

RE:STDIN / STDOUT

Post by proxy »

"No more then one app at a time can access STDIN/STDOUT at the same time, anyway, unless they agree upon a sharing API."

Sorry, not to be argumentative, but this is not entirely true.  It really depends on your definition of stdin and stdout.  For example, does each process have a virtual console?  if so, then there is an independant virtual screen for each of these processes stdin/stdout and thus can each output concurrently.  It all depends on how you implement it.

In fact in my OS, all processes have a single console and multiple processes can use stdout concurrently as well.

on an SMP system these litterally can be at "the same time" so it must all modifications must be made thread safe.

just some thoughts.

proxy
Anton

RE:STDIN / STDOUT

Post by Anton »

//For example, does each process have a virtual console?  if so, then there is
//an independant virtual screen for each of these processes stdin/stdout.
Exactly, thats the point of carbonBased. Because, you are inventing a new API=virtual screens, which lets all processs think as if they have there own stdin/stdout. And therefore use the same std... througth an this API.
Antopn.
Post Reply