[Prev][Next][Index][Thread]
Re: RV: Exec
> From: "Hector Facundo Arena" <trax@abaconet.com.ar>
> Subject: RV: Exec
>
> For example: I've got a program (a command interpreter) that I want o run
> just after the kernel finish the initialization rutine. The command
> interpreter is a binary ELF. Can I run it directly with the exec functions
> of the oskit? Is there any other way to do that? Thanks!
Well, the oskit by itself does not provide a process and system call model
whereby you can "exec" (in the unix sense) a program. The exec functions in
the oskit are more like utility functions that can be used to load binaries
into memory using a set of callbacks that do all the hard stuff. Check out
Chapter 30 "Executable Program Interpreter" in the documentation.
If what you want to do is run a command interpreter as an oskit kernel,
then you can link your interpreter as an oskit kernel, and call its
entrypoint from the main program.
Or, you might want to check out the RTLD library which allows you to load
shared objects (ELF format) into the oskit address space. There is not a
whole lot of difference between this approach and above, since the object
to be loaded has to be linked against the kernel libraries. But, I suppose
you get some flexibility. See Chapter 21 "Runtime Linker/Loader", and the
example program in examples/dyntest. Note how "dummy.so" is built, loaded
into a running oskit kernel, and executed.
Hope this helps.
Lbs
---------------------------------------------------------------------------
Leigh B. Stoller Computer Science - Flux Research Group
stoller@cs.utah.edu University of Utah
http://www.cs.utah.edu/~stoller Salt Lake City, Utah 84112
Voice: (541) 758-6252 FAX: (801) 585-3743
---------------------------------------------------------------------------