testing
[tpg/acess2.git] / Kernel / drv / vterm.c
index 2cdd84f..af92717 100644 (file)
@@ -15,7 +15,7 @@
 #define DEFAULT_INPUT  "/Devices/PS2Keyboard"
 #define        DEFAULT_WIDTH   80
 #define        DEFAULT_HEIGHT  25
-#define        DEFAULT_COLOUR  (VT_COL_BLACK|(VT_COL_WHITE<<16))
+#define        DEFAULT_COLOUR  (VT_COL_BLACK|(0xAAA<<16))
 
 #define        VT_FLAG_HIDECSR 0x01
 
@@ -62,7 +62,7 @@ void  VT_int_UpdateScreen( tVTerm *Term, int UpdateAll );
 
 // === CONSTANTS ===
 const Uint16   caVT100Colours[] = {
-               VT_COL_BLACK, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, VT_COL_LTGREY,
+               VT_COL_BLACK, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, 0xAAA,
                VT_COL_GREY, 0xF00, 0x0F0, 0xFF0, 0x00F, 0xF0F, 0x0FF, VT_COL_WHITE
        };
 
@@ -72,6 +72,7 @@ tDevFS_Driver gVT_DrvInfo = {
        NULL, "VTerm",
        {
        .Flags = VFS_FFLAG_DIRECTORY,
+       .Size = NUM_VTS,
        .Inode = -1,
        .NumACLs = 0,
        .ReadDir = VT_ReadDir,
@@ -194,7 +195,7 @@ char *VT_ReadDir(tVFS_Node *Node, int Pos)
 {
        if(Pos < 0)     return NULL;
        if(Pos >= NUM_VTS)      return NULL;
-       return gVT_Terminals[Pos].Name;
+       return strdup( gVT_Terminals[Pos].Name );
 }
 
 /**
@@ -242,10 +243,9 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
        case VT_MODE_TEXT8:
                while(pos < Length)
                {
-                       while(term->InputRead == term->InputWrite)      Proc_Yield();
+                       while(term->InputRead == term->InputWrite)      Threads_Yield();
                        while(term->InputRead != term->InputWrite)
                        {
-                               LOG("WriteUTF8(%p, 0x%x)", Buffer+pos, term->InputBuffer[term->InputRead]);
                                pos += WriteUTF8(Buffer+pos, term->InputBuffer[term->InputRead]);
                                term->InputRead ++;
                                term->InputRead %= MAX_INPUT_CHARS;
@@ -256,7 +256,7 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
        case VT_MODE_TEXT32:
                while(pos < Length)
                {
-                       while(term->InputRead == term->InputWrite)      Proc_Yield();
+                       while(term->InputRead == term->InputWrite)      Threads_Yield();
                        while(term->InputRead != term->InputWrite)
                        {
                                ((Uint32*)Buffer)[pos] = term->InputBuffer[term->InputRead];

UCC git Repository :: git.ucc.asn.au