initial commit
[A2k.git] / src / i386-text_console.ads
blob0255e252945c4cbb774db5eb343c71cb5b339100
1 with I386.Port_IO;
3 package I386.Text_Console is
5 procedure Put (C : Character);
7 procedure Put (S : String);
9 procedure Cls;
11 procedure New_Line;
13 procedure Put_Line (S : String);
15 private
17 type Console_Index is new Unsigned_32;
18 for Console_Index'Size use 32;
20 Max_Line : constant Console_Index := 25;
21 Max_Column : constant Console_Index := 80;
23 subtype Line_Index is Console_Index range 1 .. Max_Line;
24 subtype Column_Index is Console_Index range 1 .. Max_Column;
26 Video_Base_Address : constant I386.Port_IO.Port_Address := 16#B8000#;
28 type Unsigned_4 is new Unsigned_8 range 0 .. 15;
29 for Unsigned_4'Size use 4;
31 type Text_Attribute is
32 record
33 F_Color : Unsigned_4;
34 B_Color : Unsigned_4;
35 end record;
36 for Text_Attribute'Size use 8;
37 pragma Pack (Text_Attribute);
39 type Text_Element is
40 record
41 Text : Unsigned_8;
42 Attribute : Text_Attribute := (15, 0);
43 end record;
44 for Text_Element'Size use 16;
46 type Text_Line_Buffer is array (Column_Index) of Text_Element;
48 type Text_Buffer is array (Line_Index) of Text_Line_Buffer;
49 for Text_Buffer'Size use 32000;
51 Blank_Text_Element : constant Text_Element :=
52 (Character'Pos (Ascii.NUL), (15, 0));
54 end I386.Text_Console;