diff --git a/src/sys/sys/video.c b/src/sys/sys/video.c index 4810d2c..bd8149f 100644 --- a/src/sys/sys/video.c +++ b/src/sys/sys/video.c @@ -30,8 +30,10 @@ #include #include #include +#include static unsigned char *videoBuffer = (char *)0xB8000; +static spinLock_t videoSpinLock = SPIN_LOCK_INITIALIZER; int printColor = defaultColor; @@ -58,7 +60,7 @@ kprint(char *string) { unsigned int bufferOffset = 0x0, character = 0x0, i = 0x0; - + spinLock(&videoSpinLock); /* We Need To Get The Y Position */ outportByte(0x3D4, 0x0e); bufferOffset = inportByte(0x3D5); @@ -95,6 +97,7 @@ outportByte(0x3D5, ((bufferOffset & 0x0ff) & 0xFF)); outportByte(0x3D4, 0x0e); outportByte(0x3D5, ((bufferOffset >> 8) & 0xFF)); + spinUnlock(&videoSpinLock); return; } @@ -103,7 +106,7 @@ clearScreen() { unsigned int i = 0x0; - + spinLock(&videoSpinLock); for (i = 0x0; i < (80 * 25); i++) { /* Fill the screen with */ /* background Color */ videoBuffer[i * 2] = 0x20; @@ -114,10 +117,14 @@ outportByte(0x3D5, 0); /* upper-left corner of the */ outportByte(0x3D4, 0x0e); /* screen */ outportByte(0x3D5, 0); + spinUnlock(&videoSpinLock); } /* clearScreen() */ /*** $Log$ + Revision 1.5 2004/07/16 04:06:32 reddawg + Tune ups this stuff should of been taken care of months ago + Revision 1.4 2004/06/29 11:41:44 reddawg Fixed some global variables