Author: hbelusca Date: Fri Nov 8 23:15:58 2013 New Revision: 60889
URL: http://svn.reactos.org/svn/reactos?rev=60889&view=rev Log: [NTVDM] - BIOS: Implement INT 12h (BiosGetMemorySize) - BOP/DOS: Add some DPRINTs for INT 25h, 2Fh and for unimplemented functions of INT 21h. It's for helping in testing 4DOS.COM
Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/bios.h branches/ntvdm/subsystems/ntvdm/bop.c branches/ntvdm/subsystems/ntvdm/dos.c
Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?re... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -467,6 +467,13 @@ /* Initialize the BDA */ Bda = (PBIOS_DATA_AREA)SEG_OFF_TO_PTR(BDA_SEGMENT, 0); Bda->EquipmentList = BIOS_EQUIPMENT_LIST; + /* + * Conventional memory size is 640 kB, + * see: http://webpages.charter.net/danrollins/techhelp/0184.HTM + * and see Ralf Brown: http://www.ctyme.com/intr/rb-0598.htm + * for more information. + */ + Bda->MemorySize = 0x0280; Bda->KeybdBufferStart = FIELD_OFFSET(BIOS_DATA_AREA, KeybdBuffer); Bda->KeybdBufferEnd = Bda->KeybdBufferStart + BIOS_KBD_BUFFER_SIZE * sizeof(WORD);
@@ -1294,6 +1301,12 @@ { /* Return the equipment list */ setAX(Bda->EquipmentList); +} + +VOID BiosGetMemorySize(LPWORD Stack) +{ + /* Return the conventional memory size in kB, typically 640 kB */ + setAX(Bda->MemorySize); }
VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack)
Modified: branches/ntvdm/subsystems/ntvdm/bios.h URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.h?re... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.h [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -26,6 +26,7 @@
#define BIOS_VIDEO_INTERRUPT 0x10 #define BIOS_EQUIPMENT_INTERRUPT 0x11 +#define BIOS_MEMORY_SIZE 0x12 #define BIOS_KBD_INTERRUPT 0x16 #define BIOS_TIME_INTERRUPT 0x1A #define BIOS_SYS_TIMER_INTERRUPT 0x1C @@ -131,6 +132,7 @@ VOID BiosSetCursorPosition(BYTE Row, BYTE Column, BYTE Page); VOID BiosVideoService(LPWORD Stack); VOID BiosEquipmentService(LPWORD Stack); +VOID BiosGetMemorySize(LPWORD Stack); VOID BiosKeyboardService(LPWORD Stack); VOID BiosTimeService(LPWORD Stack); VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack);
Modified: branches/ntvdm/subsystems/ntvdm/bop.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bop.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bop.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bop.c [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -19,6 +19,7 @@ //#include "pic.h" //#include "ps2.h" //#include "timer.h" +#include "registers.h"
LPCWSTR ExceptionName[] = { @@ -376,6 +377,12 @@ BiosEquipmentService(Stack); break; } + case BIOS_MEMORY_SIZE: + { + /* This is the BIOS "get memory size" command, call the BIOS */ + BiosGetMemorySize(Stack); + break; + } case BIOS_KBD_INTERRUPT: { /* This is the keyboard BIOS interrupt, call the BIOS */ @@ -407,6 +414,13 @@ case 0x23: { DosBreakInterrupt(Stack); + break; + } + case 0x2F: + { + DPRINT1("DOS System Function INT 0x2F, AH = %xh, AL = %xh NOT IMPLEMENTED!\n", + getAH(), getAL()); + Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; break; } default:
Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -1691,6 +1691,7 @@ case 0x25: { DWORD FarPointer = MAKELONG(getDX(), getDS()); + DPRINT1("Setting interrupt 0x%x ...\n", getAL());
/* Write the new far pointer to the IDT */ ((PDWORD)BaseAddress)[getAL()] = FarPointer; @@ -2393,7 +2394,8 @@ /* Unsupported */ default: { - DPRINT1("DOS Function INT 0x21, AH = 0x%02X NOT IMPLEMENTED!\n", getAH()); + DPRINT1("DOS Function INT 0x21, AH = %xh, AL = %xh NOT IMPLEMENTED!\n", + getAH(), getAL()); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; } }