Re: Rosetta and Code Injection
Re: Rosetta and Code Injection
- Subject: Re: Rosetta and Code Injection
- From: Bob Murphy <email@hidden>
- Date: Wed, 23 Apr 2008 11:32:36 -0700
Hi Shantonu,
This doesn't seem like a kernel issue, and Rosetta is not part of
Darwin. You might have better luck contacting the author or
development team of mach_star.
It's a question of how to use kernel routines to do things not
normally permitted to user-space programs, and what to do if the
kernel doesn't contain functionality I need.
Among other things, mach_star allows one MacOS X process to take a
chunk of code out of bundle on disk, and spawn it as a thread in an
arbitrary unrelated process. This can then be used for a variety of
purposes, most commonly to do an OS X equivalent of Classic's trap
patching for an individual app.
As you can imagine, that's a rather dodgy activity, and something
Apple doesn't exactly provide sample code for. :-)
And with mach_star, there's nobody official you can contact to ask
questions. mach_star is a more-or-less open-source project that
nobody is actively maintaining, and that evolves when people hack on
it and then post their modified sources somewhere. Then if the
original author notices and feels like it, he merges those changes
into his version.
However, mach_star uses routines like vm_allocate() and vm_write()
and thread_create_running() that are implemented in xnu. I figured
this list is a good place to ask about my problem because:
a. The problem I'm having is with how the underpinnings of
thread_create_running() operate in the kernel.
b. Given the number and types of kernel routines it uses, chances are
good that anybody who is actively hacking on mach_star is reading
this list.
However, I will leave you with this thought experiment: Do you
believe that ./osfmk/ppc/status.c is compiled into the Intel I386
kernel running on Intel-based Macintosh?
I have thought the chances of this were almost zero. If nothing else,
in the absence of something like C preprocessor juju, building both
osfmk/ppc/status.c and osfmk/i386/pcb.c into the same executable
would lead to multiply-defined symbols at link time.
However, I feel I owe it to the people paying me to examine the
possibility that there is some official, Apple-supported way to do
code-inject a PPC executable running under Rosetta, or that someone
else has succeeded in doing this, before rushing off to do what I
consider a dubious hack. And I thought there might be a faint chance
that Apple might, for some odd reason, support this by some means I
hadn't considered.
Best regards,
Bob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden