VOGONS

Common searches


DOSBox-X branch

Topic actions

Reply 381 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

Another update:

http://hackipedia.org/Projects/DOSBox-X/dosbo … 7c7a-src.tar.xz

commit fd2866c10b6f435c86ffa121b46fa3944c817c7a
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 15:09:42 2014 -0700

add code (commented out by default) to show memory writes if they occur
in protected mode post-killswitch

commit 2a164a5ad26d82ba7d3cbf30187e4e73ee22a955
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 14:58:03 2014 -0700

BOOT command now shuts down on booting a guest OS:

- EMM Expanded Memory Manager emulation
- XMS Extended Memory Manager emulation
- The DOS kernel object (INT 21h is not needed for guest OS)
- SBLASTER and GUS environment variables (destructors for
Autoexec objects were responsible for writing to memory and
triggering page faults from within 32-bit OSes on shutdown).

These changes appear to have resolved the issue of Instant Page Fault
BSODs with NT when you use DOSBox's kill switch.

commit 9f8e05dc1518fc9020e2ede1d4cf024f225e4387
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 14:57:18 2014 -0700

add functions to snap the CPU into and back from a temporary "real
mode". intended for code that needs to operate in real-mode addresses
regardless of the CPU state when the code was executed.

commit 106c3608f5b96716bad20446c86610a8d4787f7c
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 14:54:13 2014 -0700

whoops, forgot shell.h

commit eb65a29c7ba6f71a1721c6ac39dbb9f5b358e45f
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 14:53:38 2014 -0700

Autoexec object: added Uninstall() function as a way to remove the
environment variable without destroying the object

commit e0125bebf007521b5968795e64e64b15cd70c480
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 13:57:37 2014 -0700

Up until now, when running a guest OS like Windows NT, DOSBox has had a
strange bug where pressing the "kill switch" (CTRL+F9) does not shutdown
DOSBox but instead instantly causes a page fault. It turns out there is
still code in DOSBox trying to set/clear environment blocks and other
structures despite the fact those structures are long gone and
overwritten by a guest OS! But more importantly, these memory writes
cause a page fault in NT because at the time they are executed, that
part of linear memory is mapped out, thus, the Kill Switch was
effectively an Instant Page Fault and BSOD Windows NT switch instead. As
a temporary hack, I added code to the Kill Switch callback and to the
CPU core that forces the CPU back into real mode before throwing the
int(1) exception, which ensures that when DOSBox writes to memory on
Show last 57 lines
    shutdown, the page fault never happens and DOSBox shuts down properly.

Stack trace of the DOSBox shutdown process that triggers a guest OS page
fault:

#0 PAGING_NewPageFault (lin_addr=lin_addr@entry=300, page_addr=323584, faultcode=faultcode@entry=0, prepare_only=false) at paging.cpp:327
#1 0x0807c2b8 in PAGING_NewPageFault (faultcode=0, prepare_only=false, page_addr=<optimized out>, lin_addr=300) at paging.cpp:277
#2 InitPage (prepare_only=false, writing=false, lin_addr=300, this=0x98cf79c <init_page_handler>) at paging.cpp:733
#3 NewInitPageHandler::readd (this=0x98cf79c <init_page_handler>, addr=300) at paging.cpp:653
#4 0x08135013 in mem_readd_inline (address=300) at ../../include/paging.h:310
#5 mem_readd (address=300) at memory.cpp:609 #6 0x08065f32 in RealGetVec (vec=<optimized out>) at ../../include/mem.h:219
#7 CALLBACK_HandlerObject::Uninstall (this=0xa9f90dc) at callback.cpp:536
#8 0x08290da9 in ~EMS (this=0xa9f90c8, __in_chrg=<optimized out>) at ems.cpp:1420
#9 EMS::~EMS (this=0xa9f90c8, __in_chrg=<optimized out>) at ems.cpp:1456
#10 0x082ae346 in Section::ExecuteDestroy (this=this@entry=0xa686640, destroyall=destroyall@entry=true) at setup.cpp:770
#11 0x082ae383 in Section_prop::~Section_prop (this=0xa686640, __in_chrg=<optimized out>) at setup.cpp:729
#12 0x082ae460 in Section_prop::~Section_prop (this=0xa686640, __in_chrg=<optimized out>) at setup.cpp:733
#13 0x082ae490 in Config::~Config (this=0xbffffa54, __in_chrg=<optimized out>) at setup.cpp:779
#14 0x08051ec6 in main (argc=1, argv=0xbffffc04) at sdlmain.cpp:3099

Hm, the EMS (Expanded Memory Manager) is causing this? Why is the EMS
still active when the guest OS is running?!?

So it looks like the next step is to modify the BOOT command to shutdown
Expanded Memory and Extended Memory functions before running the guest
OS.

commit b8effd6af0e88b0302475044cc46418400f49a0d
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 13:03:25 2014 -0700

comment out debug messages. add reminders to self about INT 15h mouse
emulation and future changes to handle it's reliance on the AUX port
verses the user's wishes that the guest OS not talk to the AUX port.

commit da27ede399448241a861995e8b7afaf5b4772e8d
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 01:07:00 2014 -0700

add INT 15h AX=0xC206 BH=0x00, which is apparently used by NT. added
more keyboard debug printf's. Added commentary on what Windows NT does
with the keyboard controller.

commit 151a05bbbbfa7cb38dc133acb93d2ed9a924a88a
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Sun Apr 20 23:59:51 2014 -0700

INT 15h mouse functions INIT and RESET now use SET DEFAULTS command for
PS/2 mice to help get them initialized. PS/2 mouse emulation now
defaults to streaming mode by default. See web site
http://www.computer-engineering.org/ps2mouse/ for more info. I was
wrong to assume PS/2 mice started in remote mode. Also a win for Windows
NT which does not bother commanding the mouse to enter streaming mode,
for this very reason, I assume. Removed "aux device reset streaming"
option, the above fix makes it unnecessary. Added debug print to AUX
emulation and INT 15h mouse calls for debugging.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 382 of 2397, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

There's a nmi dosbox patch: Post 178269
but it doesn't work too well yet, which may or may not be the fault of the patch.
pcem has nmi, sbos fares better than the above. If you want to hear better than OPL SBOS output, check out ultrabots/xenobots intro, pcem gets that far.

From your TODO
>The question to ask is: how does the NMI interrupt system work?

NMI has the highest interrupt priority, aka it trumps irq 0. It's not run through the PIC, CPUs have a separate pin for NMI. There are three ways to generate an NMI, illegal instruction sent to the FPU, memory parity check, and IO check line on the bus. Type can be determined between fpu and the others by checking .. I forget, ppi/8042 or pit, and I'm unsure if parity and io check are discernible.

Reply 383 of 2397, by truth_deleted

User metadata

I've been importing bits of your emulation code into dosbox-SVN. I believe I have your PS/2 emulation imported, but not the latest update which appears to be quite extensive (you wrote an incredible amount of code in two days!). I noted that the PS/2 mouse doesn't generate "page faults" in 95 as does the default mouse option in dosbox; it also appears very responsive where moving the cursor in the 95 shell. Your work on booting NT is also very extensive and I look forward to trying NT 3.1. Thank you for the additional emulations! 😀

Reply 384 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
truth5678 wrote:

I've been importing bits of your emulation code into dosbox-SVN. I believe I have your PS/2 emulation imported, but not the latest update which appears to be quite extensive (you wrote an incredible amount of code in two days!). I noted that the PS/2 mouse doesn't generate "page faults" in 95 as does the default mouse option in dosbox; it also appears very responsive where moving the cursor in the 95 shell. Your work on booting NT is also very extensive and I look forward to trying NT 3.1. Thank you for the additional emulations! 😀

There is a document I wrote in the NOTES section of the source tree describing why: The INT 33h emulation uses mem_readb() to read from the BIOS data area (specifically the byte the BIOS uses to remember the active video mode) which takes the same execution path as a CPU read or write, which means that if the guest OS has paging enabled, it is beholden to the same rules as paging including causing a page fault if the guest OS has that page marked as "not present".

Windows 3.1, 95, and 98 (and even Windows ME to some extent) leave pages 0x0000-0xFFFF mapped and accessible (Win 95 and earlier maps it read/write, Win 98 and later read only, and Windows ME maps it out not present for 32-bit code). So when INT 33h code used mem_readb() to read the BIOS area, nothing happened.

Windows ME and NT however, map pages 0x0000-0xFFFF as not present (Windows ME does it when executing 32-bit driver or Win32 code, Windows NT maps it out at all times). When the INT 33h emulation used mem_readb() in that case, mem_readb() caused a page fault exception, which caused DOSBox to recursively reenter itself to handle it (so that Windows NT could handle it and take the "Blue Screen of Death" route) or in extreme cases, crash DOSBox with the "PF queue full" error.

MS-DOS of course, does not use paging. Most DOS extenders like DOS4GW and DOS32A will run the 32-bit DOS program in 32-bit protected mode with paging turned off if possible, or if EMM386.EXE and VCPI is active, will use a limited form of paging that will usually map the lower 1MB region one-to-one with real mode anyway. Which is why the INT 33h mem_readb() was never an issue with DOS games either.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 385 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
ih8registrations wrote:
There's a nmi dosbox patch: Post 178269 but it doesn't work too well yet, which may or may not be the fault of the patch. pcem […]
Show full quote

There's a nmi dosbox patch: Post 178269
but it doesn't work too well yet, which may or may not be the fault of the patch.
pcem has nmi, sbos fares better than the above. If you want to hear better than OPL SBOS output, check out ultrabots/xenobots intro, pcem gets that far.

From your TODO
>The question to ask is: how does the NMI interrupt system work?

NMI has the highest interrupt priority, aka it trumps irq 0. It's not run through the PIC, CPUs have a separate pin for NMI. There are three ways to generate an NMI, illegal instruction sent to the FPU, memory parity check, and IO check line on the bus. Type can be determined between fpu and the others by checking .. I forget, ppi/8042 or pit, and I'm unsure if parity and io check are discernible.

I know that part. What I was asking (if I remember the note to myself correctly) was: How does the Gravis Ultrasound use the NMI interrupt to fake the MPU and Sound Blaster functions? What do you program into the chip's registers to enable that? What does the card expect you to do with the registers when that happens? If Gravis Ultrasound NMI emulation were implemented, DOSBox-X could accurately recreate for historical interest what it's like to use MEGA-EM and SBOS to try and play Sound Blaster based DOS games.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 386 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
ih8registrations wrote:

There's a nmi dosbox patch: Post 178269
but it doesn't work too well yet, which may or may not be the fault of the patch.
pcem has nmi, sbos fares better than the above. If you want to hear better than OPL SBOS output, check out ultrabots/xenobots intro, pcem gets that far.

Also, I can't seem to access that part of the forum. I'm not authorized, apparently.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 387 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

Another minor update that fixes some crashiness with the mouse and Windows 3.1.

http://hackipedia.org/Projects/DOSBox-X/dosbo … 2d28-src.tar.xz

commit ba68b07d36867e80ebeb56b0a780a082807b2d28
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 16:51:03 2014 -0700

PS/2 device callback: make sure seg != 0 and ofs != 0 before calling.
INT 15h: Mouse reset function now turns off mouse. This resolves random
crashes that can occur if you enter into Windows 3.1, then exit back to
DOS, then move the mouse.

commit 657351c2f5d79914af288b9376c4d6ead3b1fc2b
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 16:27:38 2014 -0700

comment out read port 0x61

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 388 of 2397, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie
TheGreatCodeholio wrote:
ih8registrations wrote:
There's a nmi dosbox patch: Post 178269 but it doesn't work too well yet, which may or may not be the fault of the patch. pcem […]
Show full quote

There's a nmi dosbox patch: Post 178269
but it doesn't work too well yet, which may or may not be the fault of the patch.
pcem has nmi, sbos fares better than the above. If you want to hear better than OPL SBOS output, check out ultrabots/xenobots intro, pcem gets that far.

From your TODO
>The question to ask is: how does the NMI interrupt system work?

NMI has the highest interrupt priority, aka it trumps irq 0. It's not run through the PIC, CPUs have a separate pin for NMI. There are three ways to generate an NMI, illegal instruction sent to the FPU, memory parity check, and IO check line on the bus. Type can be determined between fpu and the others by checking .. I forget, ppi/8042 or pit, and I'm unsure if parity and io check are discernible.

I know that part. What I was asking (if I remember the note to myself correctly) was: How does the Gravis Ultrasound use the NMI interrupt to fake the MPU and Sound Blaster functions? What do you program into the chip's registers to enable that? What does the card expect you to do with the registers when that happens? If Gravis Ultrasound NMI emulation were implemented, DOSBox-X could accurately recreate for historical interest what it's like to use MEGA-EM and SBOS to try and play Sound Blaster based DOS games.

Ultrasound generates an NMI when Adlib/SB ports are accessed, SBOS listens for an NMI then does its emulation from/to the ports.

In case you don't know, SBOS source is available: http://alsa.cybermirror.org/datasheets/gus/amd960214.tar.gz. It's the interwave version(I believe iwsbos is sbos & megaem merged,) GUS DOS driver sources used to be available as well, http://toogam.com/software/archive/drivers/so … nd/gussound.htm, need to find someone who grabbed the code before that server went down. I've attached the dosbox nmi patch from the thread you can't access, but I'd definitely be looking at how Sarah did it in PCEM, she may have implemented whatever that's key to make it work better.

Attachments

  • Filename
    sbos.diff
    File size
    14.12 KiB
    Downloads
    68 downloads
    File license
    Fair use/fair dealing exception
Last edited by ih8registrations on 2014-04-22, 05:35. Edited 2 times in total.

Reply 389 of 2397, by truth_deleted

User metadata

Thank you for the very interesting explanation of the INT 33h emulation where paging is active! I read your notes, but the additional descriptions have helped me to better appreciate the inner-workings. 😀

Also, thanks for the latest set of updates! I'm amazed at how much work you have put into the keyboard and mouse emulation to allow the Windows guest. I think it will take me longer to read your code then it took you to write and debug it. 😀

Reply 391 of 2397, by truth_deleted

User metadata

I almost was able to install NT 3.1 by use of hints here: http://gunkies.org/wiki/Installing_Windows_NT_3.1_on_Qemu. Probably better to create a working image in another emulator and then boot it with dosbox-x. At the least, it appears that it has helped so far to debug the emulation.

The IDE/PS2/Paging updates are working very well in 95. 😀 The latest PS/2 emulation seems to increase the responsiveness and stability in Win95. Half-life ran nicely with CD audio where the updates were active; prior to these updates there was an infrequent page fault problem.

Reply 393 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
SA1988 wrote:

is it me or when pressing Ctrl-F4 when booting a guest OS it crashes dosbox completely with the latest source changes (April 21)?

That's another bug I just recently fixed. It has to do with the stale pointers left behind in the Drives[] array after the DOS kernel is shut down during the BOOT command. The disk swapping routine then chokes on the stale pointers and DOSBox crashes.

I have another release up to fix that and a few other problems with INT33h vs Windows 3.1.
(coming up next..)

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 394 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

http://hackipedia.org/Projects/DOSBox-X/dosbo … 010f-src.tar.xz

commit 0db69db9b14d72a50002c56c0e44676753b3010f
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 05:23:27 2014 -0700

separate INT 33h mouse coordinates from PS/2 mouse coordinates. This
fixes a bug where a DOS program in Windows 3.1 DOS box could
potentially have a cursor that, instead of being properly constrained to
the screen, was permitted to go WAY out of bounds off the edge of the
screen. This means for example that if you run the built-in EDIT
command, and then move the cursor to the left and up several times, the
cursor "block" would eventually reach way past VRAM and into the UMB and
ROM area. Or worse, if the cursor goes beyond the edge of the screen,
Microsoft CodeView will crash with a runtime error. Separating the two
allows the PS/2 mouse events to reflect relative motion while keeping
INT 33h cursor movement confined properly.

commit afb6643f9dac8cfb6df0ad5cd9b78f43b83acb13
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 05:13:04 2014 -0700

move INT10_SetCurMode() call out to INT 10 video modesetting, AWAY from
the SDL GUI mouse event function call. always compute mickeys moved
using the last known video mode. Move the INT 33h's cursor redraw
function to within INT 74h callback, where on real hardware it is likely
to happen. These changes resolve crashiness issues with Windows 3.1
because it moves the parts that access VRAM and the BIOS DATA AREA to
within IRQ 12 where Windows 3.1 expects real-mode code to do that,
rather than "out of the blue" as DOSBox used to prior to the fix.
Booting DOSBox-X with int33=true and biosps2=true and running Windows
3.1 directly from DOSBox's native command interpreter no longer causes
erratic crashes a) if you move the mouse during the bootup logo or b)
move the mouse while running a DOS program fullscreen in a DOS box.

commit 69b9ccbee65063e3bfc1415d5c3cb4e3e04849f6
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 05:04:41 2014 -0700

remove unused function from mouse.cpp

commit e5bca45c39a333ad6b2c5b44114730aba67eb0ed
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 04:54:39 2014 -0700

add notes about Microsoft Windows 3.11, including PS/2 mouse cursor
problems with DOS boxes, and serious conflicts between Windows 3.1 and
DOSBox's INT 33h mouse emulation (when running Windows 3.1 directly from
DOSBox's DOS prompt).

commit 446a79d47dffcafb7557c9c2f46dd923b91491f3
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 00:53:30 2014 -0700

add INT 15h mouse diagnostic param that, if set, saves all CPU registers
on the stack. If the guest OS or DOS program is acting erratically when
the mouse is involved, setting this option can help to determine if the
fault lies in the device callback failing to preserve CPU registers.

commit c9056fac61c7a65e3dfef69bb5f7d327bb0f1147
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 00:06:39 2014 -0700
Show last 29 lines

update NOTES

commit 7be6d5a7c738304fe4a3b15e4ad586f4c8d0aa7a
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 22:51:04 2014 -0700

Add more notes

commit 06808abbba1f920626514092806776cbd9025cfb
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 22:22:11 2014 -0700

bugfix: When the DOS kernel shuts down, make sure the Drives[] array is
zeroed as well. Prior to this fix, mounting drive c: then booting a
guest OS would leave behind stale (invalid) pointers in the Drives[]
array once the BOOT program shut the DOS kernel down. This wouldn't
cause any problems until you attempted to use the Disk Swap hotkey, at
which point, DOSBox would crash.

commit 4c6d5991f817cf5fd4b579f4943d6b2258d426c4
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Mon Apr 21 22:21:45 2014 -0700

serial mouse emulation: double the dy coordinate value so that when
using Windows 1.0 with serial mouse the movement isn't so "squished" and
seems more normal.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 395 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

Ah... shit.

Alright. The fact that the DOS kernel is clearing Drives[] even if the CD-ROM emulation or floppy emulation intends to use it means that I've now created a use-after-free bug and DOSBox will eventually crash when you swap CDs. Zeroing the array on free resolved the possibility of stale pointers but didn't fix that issue.

I have to head into work now but I'll fix that as soon as I can. I'm really sorry.

If you need the functionality now you could try commenting out the for() loop in the ~DOS() destructor on line 1729 of src/dos/dos.cpp that frees the Drives[] array to see if that helps.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 397 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

Okay. another update.
I fixed the aforementioned use-after-free bug and then went ahead and went through the code with Valgrind to look for other memory leaks and patch them up.

The bad news: My Windows NT 3.1 installation bluescreens again 🙁 I'm reinstalling the image to see if that resolves it.

http://hackipedia.org/Projects/DOSBox-X/dosbo … 98fe-src.tar.xz

commit 49269ee06136b0fe73a2ccce93d6f30152bc98fe
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 23:16:02 2014 -0700

add to build script commentary about -g3 and -O0 flags and dynamic core

commit a50cb931a7fa391829e06156a16bc6a32473a772
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 22:24:02 2014 -0700

Final comments on what was found during Valgrind hunting.

commit 07c288ccdbd1116faa9b6561fafa13662fc0bbe0
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 22:04:54 2014 -0700

Valgrind hunting: call GUI toolkit to free all fonts in it's registry on
shutdown. one less memory leak reported by Valgrind.

commit 51ca1f23e9c42ae4a8153ade62a85ce3b904a8fc
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 21:55:52 2014 -0700

Valgrind hunting: free bindlist on shutdown in mapper, remove another
source of memory leaks.

commit 6534e27817723dfd1d4c41c11cb421d1de1e27da
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 21:38:57 2014 -0700

more fiddling. there's this persistent memory leak from a std::string in
the Section_line object I'm trying to get rid of.

commit 805f6ac6089cc57df4bbc0075397142a73d50cef
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 21:09:41 2014 -0700

more

commit 596ddebb5d3e8c817cdd298d3c4604f9381cc61d
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 20:59:21 2014 -0700

hm, make destructors virtual

commit 31985a8682a4f14f0248428a7fcb08ffb4641ff3
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 20:40:16 2014 -0700

Valgrind hunting: Free ISAPNP objects on shutdown

commit 76a8c34f7f14509cd1e36b30b96aa0f0e8a8af25
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 20:33:51 2014 -0700

more

commit d587f13df46adb53fa0a77414e792c4623b444f7
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 20:24:04 2014 -0700
Show last 158 lines

hm... minor revision

commit a9a8046bfd218f9774e39a933bbd29d0181abe08
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 19:19:14 2014 -0700

Cleanup: make sure to clear properties list on destruct. Fix bug in
config file parsing where unknown sections are treated as if continuing
the previous section, which is silly.

commit 8289fc8c1c5367ac1d2931f2a3bc6397a7695064
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 18:59:11 2014 -0700

add build script for maxiumum debugging

commit 0848f5b98312dcbb054d0613906dd12fc743e07f
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 18:44:15 2014 -0700

Valgrind hunting: CD-ROM emulation allocates a mixer channel object. Now
to avert memory leaks, it frees the object. One less memory leak
reported.

commit a3d3f7c4c9f2827935bb62f1e807f10ba9d668dd
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 18:33:21 2014 -0700

Valgrind hunting: rewrite PROGRAMS code to better track their resources,
including the tiny amount of memory used to generate the executable
"stub". this eliminates the many tiny memory leaks reported by Valgrind
here.

commit 67bd3d71cb18b168ec49a193287f26091117c192
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 18:10:44 2014 -0700

Valgrind hunting: add shutdown function for virtual filesystem code, to
free the linked list it allocates when emulating a virtual drive (such
as the default drive Z:) on shutdown. This eliminates a whole bunch of
memory leak messages from Valgrind.

commit f4482911219f53bc132ff196921f0d7b049152c9
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 18:04:51 2014 -0700

Valgrind hunting: cleanup sdl_mapper to release allocated bindings,
events, etc. on shutdown. Changed destructors to virtual to ensure
derived classes clean themselves and the base class up properly. This
eliminates Valgrind complains about memory leaks in that part of the
code. Conversely, I see plenty of code using "new" to allocate an object
not to assign a pointer from it but on the assumption the constructer
adds itself to a list. I don't approve of that kind of C++ style and I
will clean that up later.

commit 13760a7094fbe892c9357b9758655bb021808c09
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 17:31:22 2014 -0700

Valgrind hunting: add shutdown procedure for dynamic core, to free X86
register "generators" (or whatever they are) and reduce the number of
things not freed on shutdown.

commit 50e1ac5cd8cfc67786f6365b25902fdfe2414ebb
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 17:20:48 2014 -0700

Valgrind hunting: adjust vga_memory.cpp to memset from the base
allocation not the adjusted (aligned pointer). This resolves a complaint
from Valgrind that the memset() is writing beyond the end of the char[]
array.

commit f149e86ca043c4708d7d67765b8563c74081c8d8
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 17:15:21 2014 -0700

Valgrind hunting: CSerial destructor made virtual so classes derived
from it still clean up resources properly on destruction. Added code to
delete device object as well as remove from DOS kernel. added code to
delete the FIFO objects properly from the destructor. Serial port
emulation no longer leaks memory.

commit a90af711a291f6dce2c6b20637267e07100c14b3
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:59:56 2014 -0700

Valgrind hunting: PIC tick handler cleanup, deallocate tick handler
linked list at shutdown to resolve minor memory leak. Keyboard code
updated to remove tick handler on shutdown.

commit 0592dbb64b1569774b40de0d1d0688b0230c8605
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:44:17 2014 -0700

Valgrind hunting: resolve memory leaks with callback string allocation,
and make sure the callback array is initialized properly.

commit c3028def408f29fec9fbf232daad936a8221f42b
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:33:52 2014 -0700

Valgrind hunting: Add code to ensure Devices[] array is initialized to
NULL on startup, and all Devices[] are freed on shutdown, to eliminate
memory leak.

commit 9f3419c92ef621798f437fb6528c6313ffa07b3a
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:28:35 2014 -0700

Valgrind hunting: close memory leak caused by code that frees the
Files[] array but not the Files objects in the array.

commit 60fb86ac66a63924b7a7603fc67e52a5912b880a
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:17:34 2014 -0700

Valgrind hunting round: found mismatched new/free allocation of int
array (type int[]). Updated deletion of array to use delete[] instead of
delete.

commit f33d13a31d564bd3de6a6874954ed45c372947ed
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:13:23 2014 -0700

ne2000=true by default? No way.

commit 65b10129ae210b0f379f15cd2302e31024f8ce18
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 16:02:02 2014 -0700

src/ints/bios.cpp: Valgrind shows "use of uninitialized variable" which
at first looks spurious (it's pointing at a constant+(variable*2)
expression passed to mem_readw), but at closer examination, comes as a
result of the function's declaration of int port; being overshadowed
inside the for() loop by Bitu port, in a manner that assigns the value
of mem_readw(port) to port, like this:

Bitu port = mem_readw(constant+(port*2));

The guy who wrote this code, I think, thought that the compiler would
declare "port" for the inner scope, then use "port" from the outer scope
and multiply by 2 and add to the const expr and assign to the "port"
variable on the inner scope. Instead, the "undefined" error happens
because GCC interprets it as taking the (undefined) value of "port",
multiply by 2, add to constexpr, and assign back. Thus, the undefined
value warning.

commit df1b715ae276fe345121de87b2b6d8df2a3b25ca
Author: Jonathan Campbell <jonathan@castus.tv>
Date: Tue Apr 22 15:38:28 2014 -0700

Modified DOS kernel NOT to free the Drives[] array on DOS kernel
shutdown. This fixes crashes when you use CTRL+F4 to swap CDs, and
resolves what was obviously a use-after-free bug. sdlmain.cpp was
updated to free Drives[] on shutdown instead.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 398 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie

Update: Reinstalling did in fact help. I guess that's what happens when you prematurely shut down Windows NT too often (either by CTRL+F9 or because it crashed too much)

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.

Reply 399 of 2397, by TheGreatCodeholio

User metadata
Rank Oldbie
Rank
Oldbie
SA1988 wrote:

looks like for me your gui menu is quite buggy with NT since it still does that trap bsod when clicking to the menu or to the close button of DOSBox 🙁

I'll look into that when I can. It's probably the same issue as DOSBox's "kill" switch triggering page faults in NT. Perhaps the popup menu reads state. I didn't write that code, it was added when I merged in code from Taewoong's branch.

DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.