From owner-freebsd-emulation@FreeBSD.ORG Sun Mar 18 02:51:04 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F35C1065674; Sun, 18 Mar 2012 02:51:04 +0000 (UTC) (envelope-from superbisquit@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id E969A8FC1E; Sun, 18 Mar 2012 02:51:03 +0000 (UTC) Received: by dald2 with SMTP id d2so8690639dal.13 for ; Sat, 17 Mar 2012 19:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NuZSCxgxVAenItXk0EwXlzSRwvDcPmBrqSUROfjBEeM=; b=ulUFL+4a74ZjXYTq810t75QAN5U48hxUccl3I8CAOop9dDe4G1U4AUKgQ+vbRDUOKs BR8sy286IZ4i6ERRhHMT+5fmzYplrTsfFjFnzeBI4Pocfuai514acsbhwrOR7wD5HBfW wOGIWzj1rMQdcU9HtSBFpAIQhIRgK2kdyfgDOMlTZebIZMPVNNS9SWC8KgYsdk7lgxQU zuANW3zAckYYVt1kwoUvA267pOX45Kvo1Fd2hS/lk2jIWogQxwOPSlUzQVjpGygpw/uG IwbFcphV9TOsoU4bzjYjkSgxd/yDvsKFXTMwnA4s3FupecYy5vh6Q/tzcfB7oBbrhhiM 9RQg== MIME-Version: 1.0 Received: by 10.68.189.5 with SMTP id ge5mr28275272pbc.50.1332039063603; Sat, 17 Mar 2012 19:51:03 -0700 (PDT) Received: by 10.68.208.168 with HTTP; Sat, 17 Mar 2012 19:51:03 -0700 (PDT) In-Reply-To: References: <20120316155901.77ca48ee@kan.dyndns.org> <20120317091952.2e8c4fcf@kan.dyndns.org> Date: Sat, 17 Mar 2012 22:51:03 -0400 Message-ID: From: Super Bisquit To: Alexander Kabaev Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-emulation@freebsd.org, FreeBSD PowerPC ML Subject: Re: ELF header adjusting X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 18 Mar 2012 02:51:04 -0000 On Sat, Mar 17, 2012 at 10:26 AM, Super Bisquit wrote: > > > On Sat, Mar 17, 2012 at 9:19 AM, Alexander Kabaev wrote: > >> On Fri, 16 Mar 2012 23:51:30 -0400 >> Super Bisquit wrote: >> >> > On Fri, Mar 16, 2012 at 3:59 PM, Alexander Kabaev >> > wrote: >> > >> > > On Fri, 16 Mar 2012 15:45:47 -0400 >> > > Super Bisquit wrote: >> > > >> > > > "Okay, what in the hell is he trying to do now?" >> > > > The answer to your question is: >> > > > I've looked at the header file for the bin/java and bin/java_vm in >> > > > the ibm powerpc java binaries. There is a reference >> > > > to /lib/ld.so.1 in a Linux installation which is very similar >> > > > to /usr/libexec/ld-elf.so.1 in a FreeBSD installation. >> > > > >> > > > chipchop# pwd >> > > > /tmp/install.dir.53010/Linux/resource/jre/bin >> > > > chipchop# ls >> > > > ControlPanel ikeyman java_vm jcontrol keytool >> > > > ktab rmid unpack200 >> > > > classic j9vm javaw jdmpview kinit >> > > > pack200 rmiregistry >> > > > ikeycmd java javaws jextract klist >> > > > policytool tnameserv >> > > > chipchop# elfedit --input-osabi=FreeBSD --output-osabi=FreeBSD >> > > > java elfedit: Error: java: Unmatched EI_OSABI: 0 is not 9 >> > > > chipchop# elfedit --input-osabi=FreeBSD --output-osabi=FreeBSD >> > > > java_vm elfedit: Error: java_vm: Unmatched EI_OSABI: 0 is not 9 >> > > > chipchop# elfedit --output-osabi=FreeBSD java_vm >> > > > chipchop# elfedit --output-osabi=FreeBSD java >> > > > chipchop# >> > > > >> > > > If in doubt about my finding for similarities >> > > > between /lib/ld.so.1 and /usr/lbexec/ld-elf.so.1 then open the >> > > > former with nano orvi and the latter with vi to see the headers. >> > > >> > > Would it be a much of a shock to discover that two export largely >> > > intersecting list of functions, both being ELF loaders? >> > >> > >> > Would rewriting the header to use the FreeBSD equivalent to the Linux >> > ones possibly work? >> > Ignore - for the moment- the reference to ld-elf.so.1. >> > /usr/lib/ld.so.1 FreeBSD /lib/ld.so.1 Linux. (I did a re-search)Both >> > serve the same purpose. The binaries are obviously checking for the >> > Linux path. >> > > >> > > Sadly, you >> > > provide no answer to the question you yourself ask on the very first >> > > line of own messages, so the point of your message is somewhat >> > > unclear to me still. >> > > >> > > -- >> > > Alexander Kabaev >> > > >> > >> > Has anyone reported anything on changing the called for libraries and >> > such in the file to use the FreeBSD path instead? >> >> No, this won't work. By rewriting headers you change the library to >> _look_ like FreeBSD one, but you do not change what library _does_. >> Linux and FreeBSD differ in how syscalls are processed and what >> parameters they take, they setup floating point processing unitt in a >> subtly different ways by default, and so on and so on. Linux ELF loader >> expects an information from the kernel that FreeBSD kernel won't >> provide and vice versa. If library were not communicating with outside >> world at all, then it likely will be possible possible to rewrite its >> headers and use it in FreeBSD, but that theoretical case is hardly >> interesting in real world. >> >> -- >> Alexander Kabaev >> > > An honest thanks, man, for the feedback. > Okay, I hope no one on either list gets pissed at my next questions and > statements. > I basically learn by pattern recognition- comparison, reverse engineering > (I finally have to admit that's what I'm doing.), and such. I would ask to > be pointed to a set of tutorials to learn disassembling elf files. > I have elfkickers installed; is that set of programs enough to get > started. I've seen references to elfutils; will having that program help? > I realize that by learning how to edit makefiles and other config > statements that I'm learning some about C and shell slowly; what would be > some other FreeBSD projects that I can work with to learn more? > > This is what I am trying/doing right now related to FreeBSD. > > Porting to Xbox360 and wii: I'm missing the wireless controller to the wii > and have to borrow one. I pulled the Xbox360 out of atrash heap and I'm > ring to repair it. > Making the ibm-java-binaries work on FreeBSD powerpc: That is what the > conversation has been about. The project is being started at school and > will be continued at the next one- community college now to a university > later. > Having more people know about FreeBSD: This is why I am introducing it at > school. It is also why I try to make my tutorials thorough. > > > > Ignore above- as many have already