From owner-freebsd-stable@FreeBSD.ORG Wed Jun 15 14:37:17 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474951065670 for ; Wed, 15 Jun 2011 14:37:17 +0000 (UTC) (envelope-from j@uriah.heep.sax.de) Received: from uriah.heep.sax.de (uriah.heep.sax.de [213.240.137.9]) by mx1.freebsd.org (Postfix) with ESMTP id CE6FB8FC17 for ; Wed, 15 Jun 2011 14:37:16 +0000 (UTC) Received: by uriah.heep.sax.de (Postfix, from userid 107) id 91A757A; Wed, 15 Jun 2011 16:37:15 +0200 (MET DST) Date: Wed, 15 Jun 2011 16:37:15 +0200 From: Joerg Wunsch To: freebsd-stable@freebsd.org Message-ID: <20110615143715.GR23206@uriah.heep.sax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110615140051.GL48734@deviant.kiev.zoral.com.ua> <20110615141240.GA61227@icarus.home.lan> X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-GPG-Fingerprint: 5E84 F980 C3CA FD4B B584 1070 F48C A81B 69A8 5873 User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Kostik Belousov , Jeremy Chadwick Subject: Re: doscmd under 8-stable, anyone? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Joerg Wunsch List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 14:37:17 -0000 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 fails). -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)