[rhn-users] Newbie Question - What is actually executing the binary?

Edward C. Bailey ed at redhat.com
Mon Jun 7 17:10:27 UTC 2004


>>>>> "snodx" == snodx  <snodx at hotmail.com> writes:
...
snodx> Which is the software program that is opening the "ls" binary
snodx> executable file, traversing through the binary instructions in this
snodx> file, understanding it and executing it?

As others replying to your original post have noted, the shell does basic
command interpreting, and execs the appropriate binary (if the command is
not built into the shell itself; some are).

But it sounds like you have a slight misunderstanding.  Once /bin/ls has
been exec'ed, the binary instructions it contains are "understood" and
executed by the processor itself -- no software is involved at this level.

snodx> What I am getting out of Linux books is that there is a shell which
snodx> is interacting with the user and there is the kernel which is
snodx> actually executing the instructions but I want to know more.

The kernel plays a slightly different role than you apparently think it
does.  The kernel's role is to share system hardware (such as the processor
and memory) between all running programs.  The kernel controls when /bin/ls
can execute on the processor, and when it must wait.  The kernel also
provides "services" to programs, such as I/O.  Otherwise, /bin/ls would
have to contain all the binary instructions necessary to create the
appropriate spots of light and dark on your monitor when it has to display
a listing of files.  Instead, the kernel (in conjunction with system
libraries such as glibc) provide a means of abstracting I/O in such a way
as to allow /bin/ls to say (in essence), "go print this filename".

snodx> Sorry for this dumb question. I did'nt where else to post it.

It's best to find either a course you can take, or some basic books on
operating system theory.  Questions of this type are certainly not the kind
of thing discussed on this list...

                        Hope this helps,

                                Ed
-- 
Ed Bailey        Red Hat, Inc.          http://www.redhat.com/





More information about the rhn-users mailing list