From owner-freebsd-emulation@freebsd.org Thu Mar 24 12:21:36 2016 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 240C3ADB2A3 for ; Thu, 24 Mar 2016 12:21:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0F96C1E67 for ; Thu, 24 Mar 2016 12:21:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0899BADB2A1; Thu, 24 Mar 2016 12:21:36 +0000 (UTC) Delivered-To: emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 057DAADB29F; Thu, 24 Mar 2016 12:21:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B6BDA1E65; Thu, 24 Mar 2016 12:21:35 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc91230-cmbg18-2-0-cust661.5-4.cable.virginm.net [82.1.230.150]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id u2OCLS6g017173 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Mar 2016 12:21:33 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc91230-cmbg18-2-0-cust661.5-4.cable.virginm.net [82.1.230.150] claimed to be [192.168.0.7] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: FreeBSD MachO File format, your comments on it. From: David Chisnall In-Reply-To: Date: Thu, 24 Mar 2016 12:21:23 +0000 Cc: emulation@freebsd.org, current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <7554521E-81AB-43DE-A7FC-A9F334F660B7@FreeBSD.org> To: mokhi X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 12:21:36 -0000 On 24 Mar 2016, at 12:05, mokhi wrote: >=20 > Hi. >=20 > I'm agreed with point you told about improvements we can do for fat > format (or more). > And I'm ready to do them (with your helps, sure :D). >=20 > But we need short steps and more of them (a local proverb :D) IMO. > If we completely do this image activator, then we can have 2 sub plans > for OSX emulation and/or fat data segment redesign. FatELF binaries do not depend on this work. Fat Mach-O binaries do, but = the pain of working with Mach-O is not worth it (talk to some of the = Apple toolchain team some time about how much effort Mach-O is - I=E2=80=99= m glad it=E2=80=99s their problem and not mine). I don=E2=80=99t believe that the work to support FatELF would be = particularly large. The format is pretty simple (basically a small = header that tells you where within the binaries to find the real ELF for = your architecture). Teaching all of the associated bits of the = toolchain (especially debuggers) about it is a lot of tedious work, but = not particularly hard if someone is motivated to do it. Teaching clang = and lld to produce fat binaries as part of normal ELF compilation would = be a bit more work. > I saw netbsd's way of mach-kernel/darwin emulation. > They have been stopped in porting/simulating quartz (the reason > described lack of developers' interest IIRC), and that relates to OSX > emulating. That wasn=E2=80=99t the only reason. The XNU kernel interfaces for = graphics and sound are large and mostly undocumented (at least, = publicly) and change between OS X revisions. Even if you implement = *all* of this, then you=E2=80=99d still need most of an OS X userland to = be able to run OS X applications. This would involve violating the OS X = EULA unless you ran it on a Mac and the only thing that you=E2=80=99d = then be able to do that you couldn=E2=80=99t with OS X is run FreeBSD = binaries in the background or in XQuartz (which you can already do = pretty well with xhyve on OS X). If you are willing to violate the OS X = EULA then you should probably just run OS X in a VM. > If we wanna complete/continue that way, first we need this image > activator, what's your opinion about it? >=20 > BTW, in brief I believe we can have strategies to do (sub plans) and > it worth (at least for me, because I'll learn good things). What's > your opinion? As a learning exercise, I definitely encourage you to continue. Writing = a new image activator will teach you a lot. If you want to do some of = the rtld work to make a partial Mach-O rtld then you=E2=80=99ll learn = even more. I just don=E2=80=99t think that the end result will be = something that=E2=80=99s particularly useful to anyone. David