Commit graph

59 commits

Author SHA1 Message Date
Aleksandar Andrejevic e765c894f0 [NTVDM]
Set AL to 0 for unimplemented functions in INT 21h.


svn path=/branches/ntvdm/; revision=61161
2013-12-01 00:17:46 +00:00
Hermès Bélusca-Maïto 4fb7f6e1d7 [NTVDM]
- Move some PS/2 initialization from bios.c to ps2.c
- NULLify interrupt entries which are in fact pointers to data tables.
- Add a framework for adding I/O port handlers.

svn path=/branches/ntvdm/; revision=61107
2013-11-26 20:20:51 +00:00
Aleksandar Andrejevic cf559336a1 [NTVDM]
The command line in the PSP consists only of the parameters, the program
name is omitted.


svn path=/branches/ntvdm/; revision=60959
2013-11-12 01:56:18 +00:00
Aleksandar Andrejevic 1ff6bc0f8f [NTVDM]
Report the correct number of paragraphs in the PSP of a COM program.


svn path=/branches/ntvdm/; revision=60958
2013-11-12 00:49:02 +00:00
Hermès Bélusca-Maïto dd9dafc7ff [NTVDM]
Finish my Interruption revamp.
- Move interrupt-related code from bop.c to int32.c
- Introduce InitializeInt32 helper so that one can initialize all the needed 16-bit stubs for the 32-bit interrupts.
- Remove unneeded defines in emulator.h and an exported variable in ntvdm.h.

svn path=/branches/ntvdm/; revision=60908
2013-11-09 23:01:11 +00:00
Hermès Bélusca-Maïto 6da6a5ce56 [NTVDM]
Start my work on modularizing registration of "32-bit" interrupts, i.e.
interrupts that are implemented in 32-bit mode, but are stubbed with 16-bit
code (so that 16-bit apps can call them).
The 16-bit stub code uses a BOP call to our Control BOP function (BOP 0xFF) which
can handle in theory many sub-functions (as the BOP 0x58 documented here: http://www.ragestorm.net/tutorial?id=27)
specified as an additional BYTE in the call:
0xC4 0xC4 bop_code <optional_bop_subfunction>
Here, for calling 32-bit interrupts we use our BOP 0xFF, subfunction 0xFF.
The final aim would be to generate the 16-bit stub code when one calls the RegisterInt32 helper function
(contrary to what's happening now, that is, the 16-bit stub code is generated for all of the interrupts
at BIOS initialization time, and we use it for BIOS and DOS interrupts).

svn path=/branches/ntvdm/; revision=60907
2013-11-09 22:15:40 +00:00
Aleksandar Andrejevic 81a5adf885 [NTVDM]
Allow COM programs to exit with a simple near return to PSP:0000. Spotted by Thomas Faber.


svn path=/branches/ntvdm/; revision=60904
2013-11-09 18:10:21 +00:00
Hermès Bélusca-Maïto 53d6212640 [NTVDM]: Fix informative comment.
svn path=/branches/ntvdm/; revision=60901
2013-11-09 16:19:14 +00:00
Aleksandar Andrejevic c6b2a6efc7 [NTVDM]
Instead of repeating the BOP, simply handle both 0x51 and 0x62 as the same function.


svn path=/branches/ntvdm/; revision=60900
2013-11-09 16:15:24 +00:00
Hermès Bélusca-Maïto fa940c2075 [NTVDM]
DOS: Implement INT 21h, AH 62h as a call to INT 21h, AH 51h.

svn path=/branches/ntvdm/; revision=60899
2013-11-09 16:11:52 +00:00
Hermès Bélusca-Maïto 860c121da8 [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

svn path=/branches/ntvdm/; revision=60889
2013-11-08 23:15:58 +00:00
Hermès Bélusca-Maïto da33c5532e Fix a comment.
svn path=/branches/ntvdm/; revision=60791
2013-10-29 21:46:47 +00:00
Hermès Bélusca-Maïto 4784c22d50 [NTVDM]: DOS:
- The DosErrorLevel is stored as a WORD: its LOWORD is the return code and the HIWORD is the termination code.
- When copying CurrentDirectories[...], be sure that we copy maximum DOS_DIR_LENGTH chars.
- Implement (or stubplement) bunch of INT 21h functions: 0x03, 0x04, 0x05, 0x0C, 0x0D, 0x26, 0x37, 0x47, 0x4D and 0x50. Functions 0x18, 0x1D, 0x1E and 0x20 are NULL functions present in DOS for CP/M compatibility only.
- Fix DOS version querying.
- Use set/getAX() instead of EmulatorSet/GetRegister, and use setCF instead of EmulatorSetFlag.

svn path=/branches/ntvdm/; revision=60790
2013-10-29 01:55:54 +00:00
Aleksandar Andrejevic 1c1febed17 [NTVDM]
Save the error code returned by applications.


svn path=/branches/ntvdm/; revision=60789
2013-10-29 00:10:14 +00:00
Hermès Bélusca-Maïto 76708ef246 [NTVDM]
- DOS: the DOS file attributes are one byte.
- BIOS: don't use hardcoded values; use the SEG_OFF_TO_PTR macro introduced earlier; use get/setAX instead of EmulatorGet/SetRegister.

svn path=/branches/ntvdm/; revision=60781
2013-10-27 23:39:52 +00:00
Hermès Bélusca-Maïto 09d991b838 [NTVDM]
DOS: Make use of get/setAX and consorts instead of EmulatorGet/SetRegister(EMULATOR_REG_AX, ...).
Start to implement real (but undocumented?) behaviour according to http://www.delorie.com/djgpp/doc/rbinter/
and http://www.datadoctor.biz/fr/data_recovery_programming_book_chapter6-pageXX.html (change XX by a valid page number)
and http://spike.scu.edu.au/~barry/interrupts.html

svn path=/branches/ntvdm/; revision=60778
2013-10-27 22:31:53 +00:00
Aleksandar Andrejevic 37430c188b [NTVDM]
Simplify BiosPeekCharacter.
Implement DOS direct console I/O functions.


svn path=/branches/ntvdm/; revision=60772
2013-10-27 16:34:27 +00:00
Aleksandar Andrejevic 68de967fb2 [NTVDM]
Fix the "Read Buffered Input" command and implement "Get STDIN Status".


svn path=/branches/ntvdm/; revision=60753
2013-10-26 18:01:40 +00:00
Aleksandar Andrejevic 01d5a36cf5 [NTVDM]
Remove the code that performs waiting in 32-bit mode since that blocks the emulator
and prevents interrupts from working.
Implement a 16-bit waiting system in the interrupt handlers.
Fix the PS/2 interrupt code.


svn path=/branches/ntvdm/; revision=60739
2013-10-24 01:01:49 +00:00
Aleksandar Andrejevic ba466dbba3 [NTVDM]
Implement the "Get Default Drive" DOS command.


svn path=/branches/ntvdm/; revision=60724
2013-10-20 15:01:28 +00:00
Aleksandar Andrejevic e1c4d780c1 [NTVDM]
Fix the INT 12h handler to call the correct function (DosOpenFile not DosCreateFile).


svn path=/branches/ntvdm/; revision=59754
2013-08-16 19:40:02 +00:00
Hermès Bélusca-Maïto e3345a32fb [NTVDM]
Do not rely on the internal format for console handles. Instead, use a more reliable way, by checking for success when calling a simple console function acting on in/out console handles.

svn path=/branches/ntvdm/; revision=59746
2013-08-15 21:10:09 +00:00
Aleksandar Andrejevic 08dc1d3e16 [NTVDM]
Make the BIOS Data Area accessible to other parts of ntvdm.
Properly redirect read/write access to the console to the keyboard and VGA systems, respectively.


svn path=/branches/ntvdm/; revision=59741
2013-08-15 01:40:50 +00:00
Aleksandar Andrejevic a9fdfb3371 [NTVDM]
Fix bug in DosTerminateProcess.


svn path=/branches/ntvdm/; revision=59740
2013-08-14 23:28:45 +00:00
Aleksandar Andrejevic f86c0161e0 [NTVDM]
Fix bug in DosChangeDirectory.


svn path=/branches/ntvdm/; revision=59701
2013-08-11 21:07:09 +00:00
Aleksandar Andrejevic 5921c465db [NTVDM]
Keep a list of current directories for all drives.
Implement functions that change the default drive and current directory.


svn path=/branches/ntvdm/; revision=59700
2013-08-11 20:54:07 +00:00
Aleksandar Andrejevic b60ee76f22 [NTVDM]
Use DOS_CMDLINE_LENGTH instead of MAX_PATH.
Fix bug in DosInitializePsp which allowed writing past the end of the Program Segment Prefix (PSP).


svn path=/branches/ntvdm/; revision=59693
2013-08-10 21:41:20 +00:00
Hermès Bélusca-Maïto 2288b2c576 [NTVDM]
- Use up to 256 parameters for programs (as suggested by the parsing while loop), but don't hardcode this values in many other places.
- The passed command line to ntvdm should be as long as MAX_PATH.

svn path=/branches/ntvdm/; revision=59691
2013-08-10 20:50:37 +00:00
Aleksandar Andrejevic b4ed87bb3a [NTVDM]
Fix coding style.
Fix initial cursor position bug.
Fix memory limit constant for VGA memory modes 0 and 1 (64 KB not 32 KB).


svn path=/branches/ntvdm/; revision=59669
2013-08-07 19:56:28 +00:00
Aleksandar Andrejevic bcdc670ae9 [NTVDM]
Fix more MSVC warnings.


svn path=/branches/ntvdm/; revision=59667
2013-08-07 15:42:32 +00:00
Aleksandar Andrejevic 5e69cb4dcb [NTVDM]
Fix MSVC warnings.


svn path=/branches/ntvdm/; revision=59666
2013-08-07 15:01:38 +00:00
Aleksandar Andrejevic b49476f20c [NTVDM]
Modify the flags on the stack instead of the flags register directly.
The flags register is restored during IRET so changing it directly does nothing.


svn path=/branches/ntvdm/; revision=59566
2013-07-23 21:43:57 +00:00
Aleksandar Andrejevic 7bcfe7b2a8 [NTVDM]
Implement several INT 21h functions.


svn path=/branches/ntvdm/; revision=59563
2013-07-23 14:43:03 +00:00
Aleksandar Andrejevic be2e1f0907 [NTVDM]
Add the program name after the environment block.


svn path=/branches/ntvdm/; revision=59559
2013-07-22 20:21:46 +00:00
Aleksandar Andrejevic 87fc3759e3 [NTVDM]
Fix bug while initializing and copying the environment strings.


svn path=/branches/ntvdm/; revision=59557
2013-07-22 16:36:05 +00:00
Aleksandar Andrejevic c04b008f1f [NTVDM]
Add debug output.


svn path=/branches/ntvdm/; revision=59555
2013-07-22 13:51:26 +00:00
Aleksandar Andrejevic f603441db9 [NTVDM]
Implement multiple allocation strategies.


svn path=/branches/ntvdm/; revision=59530
2013-07-20 06:14:13 +00:00
Aleksandar Andrejevic bac747f151 [NTVDM]
Fix several bugs.


svn path=/branches/ntvdm/; revision=59502
2013-07-18 12:31:11 +00:00
Aleksandar Andrejevic 495320af6e [NTVDM]
Implement Upper Memory Blocks (UMB) support.


svn path=/branches/ntvdm/; revision=59501
2013-07-18 11:44:06 +00:00
Aleksandar Andrejevic bebaf9e812 [NTVDM]
Add a compile-time option (not default) to run ntvdm manually with the target executable as a parameter.
Fix screen clearing bug.
Rewrite several INT 10h functions to work for all video pages.


svn path=/branches/ntvdm/; revision=59497
2013-07-18 00:01:18 +00:00
Aleksandar Andrejevic 7ba3013923 [NTVDM]
Implement the IOCTL command in VDM DOS.
Rewrite the BIOS video pages support to use only one console buffer (not yet complete).
Fix the BIOS video mode table and several bugs in video functions.


svn path=/branches/ntvdm/; revision=59460
2013-07-13 01:56:36 +00:00
Aleksandar Andrejevic 25cbe37d30 [NTVDM]
Fix bugs in the VDM DOS executable loader.


svn path=/branches/ntvdm/; revision=59452
2013-07-09 17:28:16 +00:00
Aleksandar Andrejevic 988c4490a8 [NTVDM]
Fix bugs in video memory access emulation.
Implement several missing INT 10h functions.
Resize the console screen buffer on startup.


svn path=/branches/ntvdm/; revision=59421
2013-07-03 23:38:51 +00:00
Aleksandar Andrejevic 36f251eca0 [NTVDM]
Fix several bugs:
The file was not entirely read due to an integer overflow.
The second WORD of the Program Segment Prefix (PSP) is not the number of allocated
paragraphs, but the segment of the last paragraph.
Fix the order of registers (SI and DI were mixed up with SP and BP).
Implement interrupt 0x11.
Implement redirection for reading/writing characters.


svn path=/branches/ntvdm/; revision=59409
2013-07-02 02:08:30 +00:00
Aleksandar Andrejevic 40e7d3a9fb [NTVDM]
Implement file creation, opening, reading and writing.


svn path=/branches/ntvdm/; revision=59406
2013-07-01 02:29:29 +00:00
Aleksandar Andrejevic ed9f26ccca [NTVDM]
Fix several bugs.
Implement some interrupt 1Ah services in the BIOS.


svn path=/branches/ntvdm/; revision=59374
2013-06-29 21:37:44 +00:00
Aleksandar Andrejevic 944d6e8b5a [NTVDM]
Implement "Get DOS Version" API call.
Implement BIOS keyboard IRQ handler and some "INT 16h" functions.


svn path=/branches/ntvdm/; revision=59350
2013-06-28 20:52:40 +00:00
Aleksandar Andrejevic 4c4c69fc37 [NTVDM]
Clean up the code and properly separate different modules into different files.


svn path=/branches/ntvdm/; revision=59344
2013-06-26 22:58:41 +00:00
Aleksandar Andrejevic 44f2787b1f [NTVDM]
Use 286 mode in softx86.
Implement "Get / Set Disk Transfer Area".
Start implementation of PS/2 controller.
Improve hardware interrupts. Fix CLI / STI / HLT instruction support.


svn path=/branches/ntvdm/; revision=59343
2013-06-26 17:15:45 +00:00
Aleksandar Andrejevic 53fbdf6bc9 [NTVDM]
Implement the "Get Interrupt Vector" and "Set Interrupt Vector" DOS API functions.


svn path=/branches/ntvdm/; revision=59340
2013-06-25 17:56:05 +00:00