Saturday, May 22, 2010

C++ in console mode?

When a console mode C++ program is ran and the program calls for input, for instance from the keyboard, does the CPU access the keyboard buffer and bring the input into the CPU or into memory for processing or does the operating system have to retrieve the information and give it to the CPU or load it into memory? I know with a Windows program the operating system controls everything but I wasn't sure how a console mode program operated. If someone could give me a step by step of the processes for each type (Windows and console) it would be most appreciated. Also does standard output to the display occur in a similar mannner? Hopefully I have expressed my question clearly enough that someone can help me out. Thanks.

C++ in console mode?
*NOT POSITIVE*


No matter what, the OS will marshall requests to hardware. So even if you make a Win32 console program, you are still within the bounds of the operating system and at any time, it may alter, trap, or otherwise modify the request to or the response from the hardware. For example, when you call cin, the compiler linked in stdio, which in turns references the driver installed in windows, which in turn communicates with the hardware.


No comments:

Post a Comment