If it works on a real machine but not in Dosbox, then Dosbox is to blame. It's not an accurate emulator so it could crash for many reasons.
You could try with another build of Dosbox (Dosbox SVN, Dosbox-X, etc) or another, more accurate, emulator (PCem, 86box)
