Author: hbelusca Date: Sun Feb 23 19:43:31 2014 New Revision: 62311
URL: http://svn.reactos.org/svn/reactos?rev=62311&view=rev Log: [NTVDM]: We can call now directly the interrupts instead of the internal functions BiosPeekCharacter and VidBiosPrintCharacter (so that if some program hooks them, we behave correctly).
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.c branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.h branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.h branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/bios.c branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/dos.c
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bios... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Sun Feb 23 19:43:31 2014 @@ -81,7 +81,7 @@ return TRUE; }
-WORD BiosPeekCharacter(VOID) +static WORD BiosPeekCharacter(VOID) { WORD CharacterData = 0;
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.h URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bios... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/kbdbios32.h [iso-8859-1] Sun Feb 23 19:43:31 2014 @@ -38,7 +38,6 @@
/* FUNCTIONS ******************************************************************/
-WORD BiosPeekCharacter(VOID); WORD BiosGetCharacter(VOID);
BOOLEAN KbdBios32Initialize(HANDLE ConsoleInput);
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bios... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] Sun Feb 23 19:43:31 2014 @@ -1045,7 +1045,7 @@ return TRUE; }
-VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page) +static VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page) { WORD CharData = MAKEWORD(Character, Attribute); BYTE Row, Column;
Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.h URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bios... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/vidbios32.h [iso-8859-1] Sun Feb 23 19:43:31 2014 @@ -36,8 +36,6 @@
/* FUNCTIONS ******************************************************************/
-VOID VidBiosPrintCharacter(CHAR Character, BYTE Attribute, BYTE Page); - BOOLEAN VidBios32Initialize(HANDLE BiosConsoleOutput); VOID VidBios32Cleanup(VOID);
Modified: branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/bios.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos/dos32... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] Sun Feb 23 19:43:31 2014 @@ -93,8 +93,18 @@
if (IsConsoleHandle(Handle)) { + /* Save AX */ + USHORT AX = getAX(); + /* Call the BIOS */ - return (BiosPeekCharacter() != 0xFFFF); + setAH(0x01); // or 0x11 for enhanced, but what to choose? + Int32Call(&DosContext, BIOS_KBD_INTERRUPT); + + /* Restore AX */ + setAX(AX); + + /* Return keyboard status */ + return (getZF() == 0); } else {
Modified: branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/dos.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos/dos32... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Sun Feb 23 19:43:31 2014 @@ -809,8 +809,23 @@ { for (i = 0; i < Count; i++) { - /* Call the BIOS to print the character */ - VidBiosPrintCharacter(((LPBYTE)Buffer)[i], DOS_CHAR_ATTRIBUTE, Bda->VideoPage); + /* Save AX and BX */ + USHORT AX = getAX(); + USHORT BX = getBX(); + + /* Set the parameters */ + setAL(((PCHAR)Buffer)[i]); + setBL(DOS_CHAR_ATTRIBUTE); + setBH(Bda->VideoPage); + + /* Call the BIOS INT 10h, AH=0Eh "Teletype Output" */ + setAH(0x0E); + Int32Call(&DosContext, BIOS_VIDEO_INTERRUPT); + + /* Restore AX and BX */ + setBX(BX); + setAX(AX); + BytesWritten32++; } } @@ -2513,14 +2528,17 @@ USHORT AX = getAX(); USHORT BX = getBX();
+ /* Set the parameters (AL = character, already set) */ setBL(DOS_CHAR_ATTRIBUTE); setBH(Bda->VideoPage); + + /* Call the BIOS INT 10h, AH=0Eh "Teletype Output" */ setAH(0x0E); - Int32Call(&DosContext, 0x10); + Int32Call(&DosContext, BIOS_VIDEO_INTERRUPT);
/* Restore AX and BX */ + setBX(BX); setAX(AX); - setBX(BX); #endif }