CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.92k stars 553 forks source link

Console Class list of not implemented methods #272

Open fanoI opened 8 years ago

fanoI commented 8 years ago

List of Console not implemented methods

In the following issue there is a list of the properties methods not implemented for the Console class.

Properties or Methods regarding streaming redirection

This is the list of not implemented properties:

This is the list not implemented methods:

The original Console has two objects inside it TextWriter and TextReader that abstract the console standard out, standard error and standard input. The Cosmos console is based on a TextScreen that is a low level implementation of BIOS console. This difference could be a problem?

Properties regarding Cursor

This is the list of not implemented properties:

It is possible to change the size (shape) of the Cursor and hide / show it writing in the BIOS register documented here. The code is really similar to the one used for the implementation SetCursorPosition.

Properties or Methods regarding Virtual Consoles

This is the list of not implemented properties:

This is the list of not implemented methods:

These properties / methods regards surely Virtual Consoles as the BIOS have not these properties these could have sense if - in future - we have Virtual Consoles implemented in VGA / VESA for this could be implemented later.

Properties / Methods regarding Keyboard

This is the list of not implemented properties:

This is the list of partially implemented methods but that have bugs:

To be yet investigated. I suggest to give the "method not implemented" string instead of bugged / wrong behavior in any case.

Methods to write values on Console

This is the list of partially implemented methods but that have bugs::

This is the list of not implemented methods:

It seems that a lot of problems are because the method toString() is not yet implemented (or be incorrectly implemented) for a lot Objects as a lot of Write() could be simply implemented as a call to the corresponding toString() for example:

 String Write(Double d) {
     return d.toString();
 }

The Write()/WriteLine() with format are really useful from the programmer point of view but seems a nightmare to implement: not only the placeholder substitution is needed but printf() like format specifiers could be used (for example to print a number as hexadecimal), localization takes a place here too: a Date could shown in the user culture preferred way (2015/11/23 for en/US but 23/11/2015 for it/EU!). A first version could be simplified:

This is the list of not implemented properties:

For the BIOS Console a character has the size of one Byte, the characters from 0 to 127 are the classical ASCII characters, the characters with value > 127 have a representation that depends from the code pages used. For .NET, instead, a character is expressed in UFT-16 (typically 2 byte) so if the user enters a not ASCII character a conversion from UTF-16 to the specified code page is needed and when a character not ASCII is read (for example with Console.ReadLine()) the inverse conversion should happen.

This a possible list of the modification to do:

  1. A method to select the code page in BIOS should be implemented. Console in its constructor should select a default code page for example 850 / 858 (to have the € sign). Possible extension to the Console class a property to set / get CodePage or it need to be put in some other place?
  2. When a character is read from keyboard if is more that > 127 it should be converted in the target code page. This class should be used.
  3. When a character is read from the keyboard (for example with Console.ReadLine()) a conversion from the code page to UFT-16 should be done when read in a String
github-actions[bot] commented 3 years ago

As this issue has received no new activity, it has been marked as stale

selkij commented 2 years ago

This is very outdated as of today

quajak commented 2 years ago

Which part of it? Quickly going through the list, it seems accurate.

selkij commented 2 years ago

It is 7 years old, for sure most of them have been plugged, I'll check when I get on my pc