while solving http://stackoverflow.com/questions/34435741/fcb-and-int-21h-function-23h/34443223#34443223, I found a bug in dosbox wherein a divide by zero error crashes the emulator, while attempting to populate a FCB using service 23h.
~~~~CONFIG:Loading primary settings from config file /home/jcomeau/.dosbox/dosbox-0.74.conf
[New Thread 0xf23a9b40 (LWP 20383)]
MIXER:Got different values from SDL: freq 44100, blocksize 512
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
MIDI:Opened device:none
Program received signal SIGFPE, Arithmetic exception.
0x080d9673 in ?? ()
(gdb) bt
(gdb) ~~~~
the problem is caused by not filling in the rec_size field of the FCB, as MSDOS would do, and as your own DOS_FCBOpen function does. I believe the minimal patch that solves the problem involves making DOS_FCBOpen return a handle instead of a boolean, and using that instead of the current code for service 23h.
here is what it should show, using the DOS debug program from https://sites.google.com/site/pcdosretro/enhdebug, and does after patching. before the patch, it would crash right after executing int 21:

the formatting broke, sorry. I'll add the patch and screenshot again here.
Those "return (Bit16u) false" lines in your patch gave me a chuckle.
Anyway, "if (rec_size==0) rec_size=128;" seems a much simpler patch...
hey, I'm only an occasional and reluctant C programmer :^)
whatever works is OK with me, but I prefer the DRY principle.
Last edit: John Comeau 2015-12-28
new patch without the comical
(Bit16u) falsecasts, after refreshing my memory at stackoverflow.fixed in 3962