Commit Graph

15759 Commits

Author SHA1 Message Date
Jonathan Campbell
e1ce5b8d07 add the ability to set CD-ROM drive spin up/down/change delays from the
IDE controller section
2014-03-29 09:53:38 -07:00
Jonathan Campbell
ece9635592 change IDE delays. a longer CD insert delay makes windows 95's
auto-insert a lot more reliable
2014-03-29 09:22:46 -07:00
Jonathan Campbell
f7eef61dc9 cleanup 2014-03-29 00:03:18 -07:00
Jonathan Campbell
0b88acd600 remove old orig 2014-03-28 23:30:52 -07:00
Jonathan Campbell
810dec9214 more header cleanup 2014-03-28 23:30:14 -07:00
Jonathan Campbell
a87e106c56 clarify private area size parsing and meaning 2014-03-28 22:58:10 -07:00
Jonathan Campbell
a369336d2a more cleanup 2014-03-27 08:42:21 -07:00
Jonathan Campbell
5fa412c688 main dosbox.cpp cleanup 2014-03-27 02:00:21 -07:00
Jonathan Campbell
6833bd786d Win32 build, with some corrections 2014-03-24 01:39:26 -07:00
Jonathan Campbell
8b61f6a867 IDE ATAPI CD-ROM media change complete. If I do a CTRL+F4 to change CDs,
MSCDEX.EXE is able to pick up that the media changed and show fresh
contents. Windows 95 is able to see the change (not automatically, but
if you hit F5 (refresh) after the change the contents reflect CD media
change).
2014-03-24 00:53:19 -07:00
Jonathan Campbell
10eb4326f1 IDE ATAPI CD-ROM drive emulation now emulated spin up/down times, delays
commands for spinup, and returns appropriate TEST UNIT READY and sense
data for media change and first spinup. Win95 is happy, at least.
2014-03-23 23:47:03 -07:00
Jonathan Campbell
afe1d0d3ed OK. great. my timer tick functions work. modified code to print debug
message ONLY if the event is fired late.
2014-03-23 22:59:22 -07:00
Jonathan Campbell
ee361cea04 add TODO and comments so far on how much RAM is needed to boot various
versions of PC/MS-DOS.
2014-03-23 20:50:10 -07:00
Jonathan Campbell
4802c37c6e update code to lower minimum to 4KB. 2014-03-23 20:26:55 -07:00
Jonathan Campbell
8c76696489 added sanity check for "mainline compatible mapping" to make sure that
8KB of RAM is present first. Without that check, mainline DOSBox's fixed
segment assignments would reach beyond available memory (if less than
8KB) and crash. added option to specify that DOSBox should allocate all
kernel structures in the UMB private area, leaving as much lower system
RAM available as possible. Doing this makes it possible to set memsize=4
(4KB) and run very small DOS programs.
2014-03-23 20:23:09 -07:00
Jonathan Campbell
e77d349baa whoops. forgot dynamic allocation sanity check for when dynamic
allocation is on, and private pool is NOT stored in UMB
2014-03-23 20:03:45 -07:00
Jonathan Campbell
b6dedd76a4 BOOT: some modifications to stack value on setup. change hard-coded
0x7C00 offset to variable that is set to 0x7C00. Add code to refuse
booting a guest OS if less than 32KB of RAM is being emulated (the IBM
PC boot process requires 32KB of RAM). added TODO where the user should
be able to override that lockout if they feel adventerous.
2014-03-23 19:57:14 -07:00
Jonathan Campbell
7d297b2b3b bugfix: calculation needs to subtract one paragraph NOT one page. 2014-03-23 19:30:52 -07:00
Jonathan Campbell
05735c0807 BOOT: pick a more appropriate segment value than simply assuming 0x7000
to ensure that it points to RAM. Prior to this fix, SS could point to
unassigned RAM if less than about 500KB was allocated for emulation.
2014-03-23 19:28:36 -07:00
Jonathan Campbell
654758ea5f allow 8KB minimum after all. 2014-03-23 19:01:05 -07:00
Jonathan Campbell
d57b8e9ea3 add debug code to show private area vs assignment. modified initial
dynamic private allocation to subtract 1 paragraph from memory total,
because some parts of the emulation use that for UMB linkage. added code
to error out in non-dynamic case if there is insufficient room for the
private area. this fixes cases where random crashes could result from
memsizekb=16 and private area size=16384, for example.
2014-03-23 18:44:03 -07:00
Jonathan Campbell
8320c36236 fix up DOS execute function to dynamically choose COM stack pointer
value rather than assume 0xFFFE. The choice is based on the size of the
memory block allocated for the image, which means that if there's plenty
of RAM, then SP=0xFFFE anyway, BUT, if the memory block is smaller, the
stack pointer is assigned the largest value (minus 2) that fits within
the memory block. Doing this resolves the random crashes that occured
with most DOS programs, including DOSBox's builtin commands, when less
than 72KB of RAM was assigned. Because of this fix, it is now possible
to assign as little as 16KB of RAM and run without crashing. Programs
that still fit work fine. Programs that are too large silently fail.
Programs that can load, but cannot allocate the memory they need, error
out fine without crashing.

Because of this fix, the check in the DOS memory setup code has been
modified to set the minimum to 16KB instead of 72KB.
2014-03-23 18:21:37 -07:00
Jonathan Campbell
d8476654ad add define to debug alloc/free memory allocation. also added code to
disable "minimum memory requirement" error if you do so.
2014-03-23 17:39:02 -07:00
Jonathan Campbell
99d57f1a0c note DOSBox emulator instability below 72KB 2014-03-23 16:57:07 -07:00
Jonathan Campbell
a6743deb4b yikes! DOS kernel disable flag was set to TRUE by default! This
prevented the shell from operating.
2014-03-23 16:44:29 -07:00
Jonathan Campbell
064295696e reduce minimum memory size to 72KB, the lowest we can go before the
emulator is unable to boot anything at all. IBM PC-DOS 1.0 apparently
runs in that little memory with no trouble.
2014-03-23 16:38:10 -07:00
Jonathan Campbell
250371e11a add "dos_kernel_disabled" flag. added code to "BOOT" command to set this
flag so that other parts of the program have a way to know the DOS
kernel is no longer in charge. Added code to Program::SetEnv() and other
environment block code to fail and print a BUG message if emulator code
attempts to modify the environment block if the DOS kernel is disabled,
since, once the guest OS boots, that environment block is probably long
gone by then and overwritten. This fixes a bug I found where if you set
the memory size to 246KB or less, boot PC-DOS 1.0, and then hit CTRL+F9
to terminate the emulator, the emulator will instead run through
thousands of "illegal memory read" messages as code within the emulator
does a string scan from what is obviously now unmapped or overwritten
memory.
2014-03-23 16:30:50 -07:00
Jonathan Campbell
4af0b5a4e7 more cleanup 2014-02-10 02:05:30 -08:00
Jonathan Campbell
5cf7a344ef whoops, sense data length not set by function. this fixes MSCDEX.EXE
hanging on audio-only CDs.
2014-02-10 01:04:14 -08:00
Jonathan Campbell
4300b30d32 undo cleanup 2014-02-10 00:51:28 -08:00
Jonathan Campbell
ae5adb4972 more magic values... to no avail... in MODE SENSE. some cleanup. 2014-02-10 00:48:48 -08:00
Jonathan Campbell
442b37e454 add comments 2014-02-10 00:12:25 -08:00
Jonathan Campbell
0b82515a82 cleanup play/pause status byte, DOSBox's code will not return pause=1
when play=0. Fix PLAY AUDIO MSF command code mistake that converted
M:S:F to LBA without considering the 150-sector offset. This fixes the
bug where pausing and resuming would skip forward 2 seconds.
2014-02-10 00:09:24 -08:00
Jonathan Campbell
2d556e92ca cleanup SCSI sense emulation by using sense[] buffer and providing
function to set contents
2014-02-09 23:35:27 -08:00
Jonathan Campbell
dea2ec4f4c bugfix: loop until events are carried out. this fixes the clocks
stopping at an arbitrary time.
2014-02-03 07:41:31 -08:00
Jonathan Campbell
18201b443f add PCI bus clock. consolidate integer/float/ratio parser into it's own
function.
2014-02-03 06:58:19 -08:00
Jonathan Campbell
c25da05cba clock domain event system complete. updated DOSBox normal core with call
to run_hw() which takes care of event dispatch.
2014-02-03 06:40:53 -08:00
Jonathan Campbell
b9c952ff4f clean up comment in clockdom.h 2014-02-03 04:14:07 -08:00
Jonathan Campbell
6e564299de ISA BCLK is configurable now in dosbox.conf 2014-02-02 17:23:00 -08:00
Jonathan Campbell
d2e736a040 more clock domain work. master/slave relationships. 2014-02-02 16:41:02 -08:00
Jonathan Campbell
7d4ea49a60 new clock domain code, ISA BCLK/OSC and PIT timer clock domains,
diagnostic command to list them.
2014-02-02 02:28:10 -08:00
Jonathan Campbell
052665a5a2 more comments 2014-02-01 12:02:05 -08:00
Jonathan Campbell
315eed171a more notes 2014-02-01 11:51:15 -08:00
Jonathan Campbell
188ad88496 Alpha Waves notes 2014-02-01 11:46:09 -08:00
Jonathan Campbell
8b5b970816 remove self-reminder, add notice to comment that the setting is
runtime-changeable using the builtin A20GATE command.
2014-02-01 10:27:50 -08:00
Jonathan Campbell
38d20d6fcc VFRCRATE and CGASNOW programs: removed STOP functions (not used)
Added A20GATE builtin command to change A20 masking emulation at
runtime.
2014-02-01 10:24:25 -08:00
Jonathan Campbell
1e06ad0795 remove #if 0 block 2014-02-01 09:40:43 -08:00
Jonathan Campbell
52244be623 a20 gating: add on_fake/off_fake setting. the _fake settings allow the
control bit to be toggled but with no effect on actual A20 gating, a
setting intended to test whether a particular program OS is properly
checking the HMA region rather than just assuming it worked (and then
crashing). added reminder to self.
2014-02-01 09:37:45 -08:00
Jonathan Campbell
4e79c89b38 a20: set default back to "fast" for mainline DOSBox compat, and make
sure to indicate the setting is only changeable at start.
2014-02-01 09:17:57 -08:00
Jonathan Campbell
e55d9763ba more notes 2014-02-01 00:43:03 -08:00