News for hackers. Stuff that matters.
Re:Linux x86 Program Start Up by umanwizard on Friday December 12, 2014 @04:37PM (#8742860)
This appears to only be about userland stuff. Would be nice to explain what "execve" does.
Re:Linux x86 Program Start Up by Animats on Saturday December 13, 2014 @12:46AM (#8744319)
It's a hack left over from the early days when AT&T UNIX became BSD. Under pre-BSD UNIX systems, a program was started by forking a new process, which meant sharing the code and copying the data. Then the new process did an exec, which loaded a new code segment and wiped the data segment that had just been copied. Copying the data segment and immediately overwriting it was inefficient, so several new flavors of "exec" were developed to get around that.

There probably should have just been a "run" call, which started a subprocess given the indicated executable. Some UNIX-like operating systems have that. It has the nice property that it scales to clusters; there's no reason a subprocess can't run on another machine. QNX, for example, supports that.

Re:Linux x86 Program Start Up by yuubi on Saturday December 13, 2014 @12:53AM (#8744341)
> Copying the data segment and immediately overwriting it was inefficient, so several new flavors of "exec" were developed to get around that.

The several different flavors of exec are just convenience functions that lead to an execve syscall (execl* makes the vector out of some of its args; exec*p searches the path first, etc). Maybe you're thinking of vfork (a restricted fork), which seems to have gone away about when copy-on-write came in.

Re:Linux x86 Program Start Up by Animats on Saturday December 13, 2014 @03:05PM (#8746183)
Right.
Re:Linux x86 Program Start Up by Alupis on Friday December 12, 2014 @06:14PM (#8743290)
> executes the program pointed to by filename[1]

[1] http://linux.die.net/man/2/execve

man pages are your friend ;P

(I think they assume if you are doing this level of debugging, you are familiar with the typical linux sys calls, and/or know where to look-up more information about them)

Re:Linux x86 Program Start Up by umanwizard on Wednesday December 24, 2014 @04:37PM (#8794614)
I know what execve does. Hypothetically, someone may be able to find out the programmer-visible interface (through this man page) without actually knowing what is going on in the kernel when it happens (allocating memory to the process, paging in the necessary parts of it, adding it to the scheduler's queue, ...).