diff --git a/reactos/drivers/dd/blue/blue.c b/reactos/drivers/dd/blue/blue.c index 7918f7c54f7..941aceffd81 100644 --- a/reactos/drivers/dd/blue/blue.c +++ b/reactos/drivers/dd/blue/blue.c @@ -122,9 +122,8 @@ NTSTATUS ScrCreate (PDEVICE_OBJECT DeviceObject, PIRP Irp) outb_p (CRTC_DATA, 0x07); __asm__("sti\n\t"); - Status = STATUS_SUCCESS; - + Irp->IoStatus.Status = Status; IoCompleteRequest (Irp, IO_NO_INCREMENT); @@ -144,11 +143,9 @@ NTSTATUS ScrWrite (PDEVICE_OBJECT DeviceObject, PIRP Irp) DeviceExtension = DeviceObject->DeviceExtension; vidmem = DeviceExtension->VideoMemory; -// cursorx = DeviceExtension->CursorX; -// cursory = DeviceExtension->CursorY; - cursorx = __wherex(); - cursory = __wherey(); - + cursorx = DeviceExtension->CursorX; + cursory = DeviceExtension->CursorY; + for (i = 0; i < stk->Parameters.Write.Length; i++, pch++) { switch (*pch) @@ -221,7 +218,6 @@ NTSTATUS ScrWrite (PDEVICE_OBJECT DeviceObject, PIRP Irp) /* Set the cursor position */ - offset = (cursory * NR_COLUMNS) + cursorx; outb_p (CRTC_COMMAND, CRTC_CURSORPOSLO); @@ -230,10 +226,8 @@ NTSTATUS ScrWrite (PDEVICE_OBJECT DeviceObject, PIRP Irp) offset >>= 8; outb_p (CRTC_DATA, offset); -// DeviceExtension->CursorX = cursorx; -// DeviceExtension->CursorY = cursory; - __goxy(cursorx, cursory); - + DeviceExtension->CursorX = cursorx; + DeviceExtension->CursorY = cursory; Status = STATUS_SUCCESS; diff --git a/reactos/ntoskrnl/exports.lst b/reactos/ntoskrnl/exports.lst index c13590b20ee..638caa93a65 100644 --- a/reactos/ntoskrnl/exports.lst +++ b/reactos/ntoskrnl/exports.lst @@ -7,11 +7,11 @@ # # # -__putchar -__goxy -__wherex -__wherey -__getscreensize +#__putchar +#__goxy +#__wherex +#__wherey +#__getscreensize DbgPrint ExAcquireFastMutex ExAcquireFastMutexUnsafe diff --git a/reactos/ntoskrnl/hal/x86/printk.c b/reactos/ntoskrnl/hal/x86/printk.c index 9fd1650bd04..7435dd386ea 100644 --- a/reactos/ntoskrnl/hal/x86/printk.c +++ b/reactos/ntoskrnl/hal/x86/printk.c @@ -132,6 +132,11 @@ void HalSwitchToBlueScreen(void) cursorx=0; cursory=0; + outb_p(CRTC_COMMAND, CRTC_CURLO); + outb_p(CRTC_DATA, 0); + outb_p(CRTC_COMMAND, CRTC_CURHI); + outb_p(CRTC_DATA, 0); + /* * This code section is taken from the sample routines by * Jeff Morgan (kinfira@hotmail.com) @@ -185,6 +190,14 @@ void __putchar(char c) outb_p(SER_THR, c); #endif + outb_p(CRTC_COMMAND, CRTC_CURHI); + offset = inb_p(CRTC_DATA)<<8; + outb_p(CRTC_COMMAND, CRTC_CURLO); + offset += inb_p(CRTC_DATA); + + cursory = offset / NR_COLUMNS; + cursorx = offset % NR_COLUMNS; + switch(c) { case '\n': @@ -241,15 +254,13 @@ void __putchar(char c) * Set the cursor position */ - offset = cursory * NR_COLUMNS; - offset = offset + cursorx; - + offset = (cursory * NR_COLUMNS) + cursorx; + outb_p(CRTC_COMMAND, CRTC_CURLO); outb_p(CRTC_DATA, offset); outb_p(CRTC_COMMAND, CRTC_CURHI); offset >>= 8; outb_p(CRTC_DATA, offset); - } asmlinkage void printk(const char* fmt, ...) @@ -343,6 +354,7 @@ void HalInitConsole(boot_param* bp) * bp = Parameters setup by the boot loader */ { + int offset; #ifdef SERIAL_DEBUGGING /* turn on DTR and RTS */ @@ -354,33 +366,17 @@ void HalInitConsole(boot_param* bp) outb_p(SER_LCR, SERIAL_LINE_CONTROL); #endif - cursorx=bp->cursorx; - cursory=bp->cursory; -} - - -void __goxy(unsigned x, unsigned y) -{ - - cursorx = x; - cursory = y; - -} - -unsigned __wherex (void) -{ - return cursorx; -} - - -unsigned __wherey (void) -{ - return cursory; -} - -void __getscreensize (unsigned *maxx, unsigned *maxy) -{ - - *maxx = (unsigned)(NR_COLUMNS); - *maxy = (unsigned)(NR_ROWS); + /* Set cursor position */ + + cursorx=bp->cursorx; + cursory=bp->cursory; + +#if 0 + offset = (cursory * NR_COLUMNS) + cursorx; + outb_p(CRTC_COMMAND, CRTC_CURLO); + outb_p(CRTC_DATA, offset); + outb_p(CRTC_COMMAND, CRTC_CURHI); + offset >>= 8; + outb_p(CRTC_DATA, offset); +#endif }