how many bytes are reserved for stdin, std_out, stdderror, stdprt, and stdaux? every pc seems to describe the std streams as set up by the os, yet i'm trying to build my own os, and that means making my own std streams, I'D LIKE DETAILS FOR CONSOLE, FILE AND NETWORK its because i'm using masm and need to give it at least an initial storage size
Asked
Active
Viewed 35 times
-2
-
You likely want a position, some way to identify the the backing file and maybe a buffer. – Jester Sep 25 '22 at 17:19
-
It will vary, depending on what kind device the streams are bound to, whether interactive console, file, or network. – Erik Eidt Sep 25 '22 at 17:21
-
Do you mean size of buffer for block-buffering `stdio`? By defauls it is `BUFSZ`, likely defined as 8192 bytes. – dimich Sep 25 '22 at 17:22
-
1IF you mean how big a stream buffer should be then, you can pick up any size. Including zero. The output streams write to their respective devices, if a program attempt to write while a write is still in progress the call blocks. If the user types too fast the key is lost (pretty much like what happens in DOS when a program freezes but the BIOS can still accept input from the keyboard). Buffers decouple the writer side from the reader side. The exact size is kind of eye-balled. I'd make it 4KiB to start with. – Margaret Bloom Sep 25 '22 at 18:53
-
"I'D LIKE DETAILS FOR CONSOLE, FILE AND NETWORK" - **Single problem** for a question post, please. Also make sure you have searched enough before the asking a question. E.g. size of the buffer for stdin is described in [that question](https://stackoverflow.com/questions/10904067/in-c-whats-the-size-of-stdout-buffer). – Tsyvarev Sep 25 '22 at 21:45
-
this is a a single question – Huw Piggin Sep 25 '22 at 22:15
-
Not that it matters for the choice of buffer sizes, but you tagged this [nasm] but said in the question you're using MASM. – Peter Cordes Sep 27 '22 at 07:02