From owner-freebsd-emulation@FreeBSD.ORG Sat Mar 17 14:26:07 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 605A1106564A; Sat, 17 Mar 2012 14:26:07 +0000 (UTC) (envelope-from superbisquit@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id DFF308FC0C; Sat, 17 Mar 2012 14:26:06 +0000 (UTC) Received: by pbcwz17 with SMTP id wz17so514321pbc.13 for ; Sat, 17 Mar 2012 07:26:06 -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=oE0CGy4ZuFfMYMuu9/ZDxc/7mFbXldAcG8fZx1alAgk=; b=Oolihk7lszTHIvVnFmZGOazGltzf44/a8PrnLehjEloSb5Id7Q/9kCEKBa7CoqRkvb rXWbKg442mOu6Gk4xz6bvtt4tu/9Ikrbi2ulfJsWxg83h0ErB0jPRVBsKbGfkPTJ6uei V9euw9OlGbcvXbBYYzLV/v1BOhYhJhKzkUhtxAUOgvoo/Uj7YI4ZzEOizwfHyvNYzqJl AmrfrE24fUIpgCJzg2MidSb2QhgrfVDJBduaSrNqLwoLpDpe+4/PTbQHJdY7ZZ0vKRD2 dTQ+oWWVGZEZx93QZpexsLSOEAKeRNgHUkpU17PbIKYFE1Hnq19VfmYRhJptYYXA87ig yuhQ== MIME-Version: 1.0 Received: by 10.68.132.41 with SMTP id or9mr24239403pbb.8.1331994366464; Sat, 17 Mar 2012 07:26:06 -0700 (PDT) Received: by 10.68.208.168 with HTTP; Sat, 17 Mar 2012 07:26:06 -0700 (PDT) In-Reply-To: <20120317091952.2e8c4fcf@kan.dyndns.org> References: <20120316155901.77ca48ee@kan.dyndns.org> <20120317091952.2e8c4fcf@kan.dyndns.org> Date: Sat, 17 Mar 2012 10:26:06 -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: Sat, 17 Mar 2012 14:26:07 -0000 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.