m6845Vga.c
资源名称:ixp425BSP.rar [点击查看]
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:45k
源码类别:
VxWorks
开发平台:
C/C++
- /* m6845Vga.c - motorola 6845 vga console driver routines */
- /* Copyright 1993-1993 Wind River System, Inc. */
- #include "copyright_wrs.h"
- /*
- modification history
- --------------------
- 01e,12feb97,hdn fixed the bug causes workQ panic. (SPR#7923)
- 01d,03aug95,myz fixed the warning message
- 01c,14jun95,hdn removed function declarations defined in sysLib.h.
- 01b,30mar94,hdn changed CONSOLE_TTY to PC_CONSOLE.
- 01a,20oct93,vin created
- */
- /*
- DESCRIPTION
- This is the driver fo Video Contoroller Chip (6845) normally used in the
- 386/486 personal computers.
- USER CALLABLE ROUTINES
- The routines in this driver are accessed from a generic console
- driver through the hook routine, the pointer to which is initialized
- in the VGA_CON_DEV structure at the time of initialization.
- This makes the access to these routines more generic without declaring
- these functions as external.
- The routines in this driver which are accessed from an external module
- are vgaWriteString() and vgaHrdInit(). vgaWriteString() is installed
- as a device transmit start-up routine in tyDevInit(). vgaHrdInit() is
- called to initialize the device descriptors and the vga console.
- All virtual consoles are mapped to the same screen buffer. This is a
- very basic implementation of virtual consoles. Multiple screen
- buffers are not used to switch between consoles. This implementation
- is left for the future. Mutual exclusion for the screen buffer is
- guaranteed within the same console but it is not implemented across multiple
- virtual consoles because all virtual consoles use the same screen buffer. If
- multiple screen buffers are implemented then the mutual exclusion between
- virtual consoles can be implemented.
- Before using the driver, it must be initialized by calling vgaHrdInit().
- This routine should be called exactly once. Normally, it is called from
- a generic driver for eg. from tyCoDrv() which is called before tyCoDevCreate.
- SEE ALSO
- tyLib
- NOTES
- The macro N_VIRTUAL_CONSOLES should be defined in config.h file.
- This refers to the number of virtual consoles which the user wishes to have.
- The user should define INCLUDE_ANSI_ESC_SEQUENCE in <target>.h file if
- the ansi escape sequences are required. Special processing in the vga
- driver is done if an escape sequence exists.
- */
- /* includes */
- #include "vxWorks.h"
- #include "iv.h"
- #include "ioLib.h"
- #include "iosLib.h"
- #include "memLib.h"
- #include "rngLib.h"
- #include "tyLib.h"
- #include "private/funcBindP.h"
- #include "intLib.h"
- #include "taskLib.h"
- #include "errnoLib.h"
- #include "stdio.h"
- #include "string.h"
- #include "config.h"
- #include "drv/serial/pcConsole.h"
- /* externals */
- IMPORT PC_CON_DEV pcConDv [N_VIRTUAL_CONSOLES] ;
- /* locals */
- LOCAL VGA_CON_DEV vgaConDv [N_VIRTUAL_CONSOLES];
- LOCAL UCHAR curSt,curEd; /* current cursor mode */
- LOCAL int tyWrtThreshold = 20; /* min bytes free in output
- * buffer before the next
- * writer will be enabled */
- LOCAL int jobaddThreshold = 20; /* bytes processed in int lvl */
- LOCAL UCHAR * vgaCharTable [] =
- {
- /* 8-bit Latin-1 mapped to the PC charater set: ' ' means non-printable */
- (unsigned char *)
- "