Re: [Qemu-devel] User mode restart execution

2010-12-08 Thread Mulyadi Santosa
Hi...

On Tue, Dec 7, 2010 at 18:43, John Vele jve...@gmail.com wrote:
 Grettings,

 I am using user mode qemu for running stand-alone i386 binaries in linux.
 What I want to do is this:
 I want to run a binary until it ends,  but I don't want qemu-i386 to exit
 (that is what
 it does normally) but restart the execution of the same binary from the
 beginning
 without exiting.

Not sure why you wanna do such thing, but an idea crossed my mind:
quite likely, a program exit with exit() C function. This is related
to close() syscall AFAIK.

Thus, how about modifying close() syscall handler in qemu user mode
and make it jump again to load ELF from scratch?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



[Qemu-devel] User mode restart execution

2010-12-07 Thread John Vele
Grettings,

I am using user mode qemu for running stand-alone i386 binaries in linux.
What I want to do is this:
I want to run a binary until it ends,  but I don't want qemu-i386 to exit
(that is what
it does normally) but restart the execution of the same binary from the
beginning
without exiting.
I tried to modify the source code (where it starts to execute a loaded
binary) but
I don't know what variables or structs must be reinitialized in order to
start the
execution from the beginning of binary without exiting.
Any comment will be very very helpuf.

Thanx in advance