X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrv%2Fvterm.c;h=cedcb33ef82adb1363ef509bbb08e064007a50a9;hb=ca05044548d5c1de87c030d625a305731a6cc665;hp=0e66601a2c2d8fcb388091a84d284c542aca7c9c;hpb=7514bb8053931759b99f77d3f9ad70446b0625ac;p=tpg%2Facess2.git diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index 0e66601a..cedcb33e 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -190,7 +190,7 @@ int VT_Install(char **Arguments) // Set kernel output to VT0 Debug_SetKTerminal("/Devices/VTerm/0"); - return MODULE_INIT_SUCCESS; + return MODULE_ERR_OK; } /** @@ -318,7 +318,7 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) break; case TERM_MODE_FB: - case TERM_MODE_OPENGL: + //case TERM_MODE_: while(pos < Length) { while(term->InputRead == term->InputWrite) Threads_Yield(); @@ -348,6 +348,28 @@ Uint64 VT_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) case TERM_MODE_TEXT: VT_int_PutString(term, Buffer, Length); break; + case TERM_MODE_FB: + if( term->RealWidth > term->Width || term->RealHeight > term->Height ) + { + #if 0 + int x, y, h; + x = Offset/4; y = x / term->Width; x %= term->Width; + w = Length/4+x; h = w / term->Width; w %= term->Width; + while(h--) + { + VFS_WriteAt( giVT_OutputDevHandle, + (x+y*term->RealWidth)*4, + term->Width * 4, + Buffer + ); + Buffer = (void*)( (Uint)Buffer + term->Width*term->Height*4 ); + } + #endif + return 0; + } + else { + return VFS_WriteAt( giVT_OutputDevHandle, Offset, Length, Buffer ); + } } //LEAVE('i', 0); @@ -364,6 +386,10 @@ int VT_Terminal_IOCtl(tVFS_Node *Node, int Id, void *Data) tVTerm *term = Node->ImplPtr; ENTER("pNode iId pData", Node, Id, Data); + if(Id >= DRV_IOCTL_LOOKUP) { + if( Threads_GetUID() != 0 ) return -1; + } + switch(Id) { case DRV_IOCTL_TYPE: @@ -407,6 +433,11 @@ int VT_Terminal_IOCtl(tVFS_Node *Node, int Id, void *Data) Log("VT_Terminal_IOCtl - RETURN term->Height = %i", term->Height); LEAVE('i', term->Height); return term->Height; + + case TERM_IOCTL_FORCESHOW: + VT_SetTerminal( Node->Inode ); + LEAVE('i', 1); + return 1; } LEAVE('i', -1); return -1; @@ -453,6 +484,11 @@ void VT_SetTerminal(int ID) /** * \fn void VT_KBCallBack(Uint32 Codepoint) * \brief Called on keyboard interrupt + * \param Codepoint Pseudo-UTF32 character + * + * Handles a key press and sends the key code to the user's buffer. + * If the code creates a kernel-magic sequence, it is not passed to the + * user and is handled in-kernel. */ void VT_KBCallBack(Uint32 Codepoint) { @@ -922,8 +958,8 @@ void VT_int_ChangeMode(tVTerm *Term, int NewMode) free(Term->Text); Term->Buffer = calloc( Term->Width*Term->Height, sizeof(Uint32) ); break; - case TERM_MODE_OPENGL: - return; + //case TERM_MODE_OPENGL: + // return; } Term->Mode = NewMode;