doscmd under 8-stable, anyone?

Joerg Wunsch freebsd-current at
Wed Jun 15 14:37:17 UTC 2011

As Kostik Belousov wrote:

> > So does anyone have an idea
> > why this mmap() call:


> > yields an EINVAL now under 8-stable?
> Do sysctl security.bsd.map_at_zero=1

Ah, thanks!  Now it works.  Well, at least it doesn't crash anymore (I
somehow have to fix my boot environment, hopefully I'll be able to
perform a fresh installation of FreeDOS there.)

So I guess this should be added to doscmd's documentation then.

As Jeremy Chadwick wrote:

> I'm not sure why a person would need or want MAP_FIXED in this
> situation; why can't they just take the result of mmap() (a void *) and
> use that as a base address offset instead of assuming zero in their
> software?

Because MS-DOS utilities are written in the assumption of running at
address 0 (or only slightly beyond).  Remember, this mmap() maps the
MS-DOS emulator base memory (that's why it is fatal if the allocation
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

More information about the freebsd-stable mailing list