Standard C library functions in freestanding systems

J

J de Boyne Pollard

M> The library functions which are included to allow process
M> launch, forking, and termination, imply that it is both
M> possible and desirable for a process to fork itself. This
M> is a fundamental part of the Unix thought process, but is
M> not essential for a working OS.

RP> How do you intend for users to run programs? You'd
RP> still need to allow process launch and termination, even
RP> if you eliminated forking. [...]

Note that what Matt wrote was confused. Forking _is_ process
launching. It is how one creates a new process. The phrase "launch,
forking, and termination" is like the phrase "glucose and sugar" used
in Mars Bar advertisements in some countries during the 20th century,
which at least one chemist used to translate to "sugar and more
sugar". The correct third action, to group with forking and
termination, is program image overlay -- i.e. execve().
 
M

Martin Golding

M> The library functions which are included to allow process M> launch,
forking, and termination, imply that it is both M> possible and
desirable for a process to fork itself. This M> is a fundamental part of
the Unix thought process, but is M> not essential for a working OS.

RP> How do you intend for users to run programs? You'd RP> still need
to allow process launch and termination, even RP> if you eliminated
forking. [...]

Note that what Matt wrote was confused. Forking _is_ process launching.
It is how one creates a new process.

Fork() is, I believe, a unix invention. I have worked on OSs which
did not require fork(), some of which OSs did not implement fork().
For some process and executable implementations it is trivial to
create a process starting at a specified instruction or with a
specified executable, and non-trivial to impossible to create a
process that shares or copies the state of a running process.

<OT>
I have also worked on an OS which, on boot, fully populated its
(fixed size) task table with running processes, most of which
rapidly entered some wait-for-event state. "Launching" a process
required acquiring one of the active-but-unallocated processes
and modifying its top-of-stack to goto the desired instruction.
I strongly doubt that there has ever been a C compiler for such
an OS.
</OT>

Martin
 
R

Rainer Weikusat

Martin Golding said:
M> The library functions which are included to allow process M> launch,
forking, and termination, imply that it is both M> possible and
desirable for a process to fork itself. This M> is a fundamental part of
the Unix thought process, but is M> not essential for a working OS.

RP> How do you intend for users to run programs? You'd RP> still need
to allow process launch and termination, even RP> if you eliminated
forking. [...]

Note that what Matt wrote was confused. Forking _is_ process launching.
It is how one creates a new process.

Fork() is, I believe, a unix invention.

That doesn't make it any more sensible to include both 'process launching'
and 'forking' in a list of primitives.
 
R

Rod Pemberton

J de Boyne Pollard said:
M> The library functions which are included to allow process
M> launch, forking, and termination, imply that it is both
M> possible and desirable for a process to fork itself. This
M> is a fundamental part of the Unix thought process, but is
M> not essential for a working OS.

RP> How do you intend for users to run programs? You'd
RP> still need to allow process launch and termination, even
RP> if you eliminated forking. [...]

Note that what Matt wrote was confused. Forking _is_ process
launching. It is how one creates a new process.

I understood his mention of forking to be one user process creating another
user process. Whereas, I understood process launch and termination as the
OS creating and destroying a user process. Depending on the OS
implementation these may be indentical or different or non-existent in part
or full.


Rod Pemberton
 
A

Army1987

[removed f'up to clc, I can't see what this have to do with C]
Note that what Matt wrote was confused. Forking _is_ process
launching. It is how one creates a new process. The phrase "launch,
forking, and termination" is like the phrase "glucose and sugar" used
in Mars Bar advertisements in some countries during the 20th century,
which at least one chemist used to translate to "sugar and more
sugar". The correct third action, to group with forking and
termination, is program image overlay -- i.e. execve().
On some OSes, you can create a new process which is not a copy of
an existing one, much like sucrose is a sugar which is not
glucose.
 
C

CBFalconer

Martin said:
M> The library functions which are included to allow process M> launch,
forking, and termination, imply that it is both M> possible and
desirable for a process to fork itself. This M> is a fundamental part of
the Unix thought process, but is M> not essential for a working OS.

RP> How do you intend for users to run programs? You'd RP> still need
to allow process launch and termination, even RP> if you eliminated
forking. [...]

Note that what Matt wrote was confused. Forking _is_ process launching.
It is how one creates a new process.

Fork() is, I believe, a unix invention. I have worked on OSs which
did not require fork(), some of which OSs did not implement fork().
For some process and executable implementations it is trivial to
create a process starting at a specified instruction or with a
specified executable, and non-trivial to impossible to create a
process that shares or copies the state of a running process.

The above messing up of the previous quotations is a sufficient
reason to avoid non-standard quotation markings. M. Pollard should
take note.
 
S

Scott Lurndal

Martin Golding said:
M> The library functions which are included to allow process M> launch,
forking, and termination, imply that it is both M> possible and
desirable for a process to fork itself. This M> is a fundamental part of
the Unix thought process, but is M> not essential for a working OS.

RP> How do you intend for users to run programs? You'd RP> still need
to allow process launch and termination, even RP> if you eliminated
forking. [...]

Note that what Matt wrote was confused. Forking _is_ process launching.
It is how one creates a new process.

Fork() is, I believe, a unix invention. I have worked on OSs which
did not require fork(), some of which OSs did not implement fork().

Tell that to the Burroughs B-5500 engineers. The routine in the
Master Control Program (MCP) to create a new task/process was called
"motherforker". This predated unix.

scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top