Standard C library functions in freestanding systems

Discussion in 'C Programming' started by J de Boyne Pollard, Sep 19, 2007.

  1. 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().
     
    J de Boyne Pollard, Sep 19, 2007
    #1
    1. Advertising

  2. On Wed, 19 Sep 2007 05:53:26 -0700, J de Boyne Pollard wrote:

    > 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
    --
    Martin Golding DoD #0236 |
    Always code as if the person who ends up maintaining your code will be a
    violent psychopath who knows where you live.
     
    Martin Golding, Sep 19, 2007
    #2
    1. Advertising

  3. Martin Golding <> writes:
    > On Wed, 19 Sep 2007 05:53:26 -0700, J de Boyne Pollard wrote:
    >> 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.
     
    Rainer Weikusat, Sep 19, 2007
    #3
  4. "J de Boyne Pollard" <> wrote in message
    news:...
    > 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
     
    Rod Pemberton, Sep 19, 2007
    #4
  5. J de Boyne Pollard

    Army1987 Guest

    [removed f'up to clc, I can't see what this have to do with C]
    On Wed, 19 Sep 2007 05:53:26 -0700, J de Boyne Pollard wrote:
    > 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.
    --
    Army1987 (Replace "NOSPAM" with "email")
    If you're sending e-mail from a Windows machine, turn off Microsoft's
    stupid “Smart Quotes†feature. This is so you'll avoid sprinkling garbage
    characters through your mail. -- Eric S. Raymond and Rick Moen
     
    Army1987, Sep 19, 2007
    #5
  6. J de Boyne Pollard

    CBFalconer Guest

    Martin Golding wrote:
    > On Wed, 19 Sep 2007 05:53:26 -0700, J de Boyne Pollard wrote:
    >
    >> 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.

    --
    Chuck F (cbfalconer at maineline dot net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net>



    --
    Posted via a free Usenet account from http://www.teranews.com
     
    CBFalconer, Sep 20, 2007
    #6
  7. Martin Golding <> writes:
    >On Wed, 19 Sep 2007 05:53:26 -0700, J de Boyne Pollard wrote:
    >
    >> 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
     
    Scott Lurndal, Sep 21, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Cunningham

    freestanding vs hosted implementations

    Bill Cunningham, Jul 5, 2003, in forum: C Programming
    Replies:
    5
    Views:
    450
    Morris Dovey
    Jul 6, 2003
  2. Vijay Kumar R Zanvar

    Freestanding Environment

    Vijay Kumar R Zanvar, Mar 3, 2004, in forum: C Programming
    Replies:
    19
    Views:
    776
    Keith Thompson
    Mar 5, 2004
  3. 50 SOMETHING GAL
    Replies:
    3
    Views:
    416
  4. freestanding enviroment !

    , Mar 16, 2006, in forum: C Programming
    Replies:
    6
    Views:
    357
    Thad Smith
    Mar 18, 2006
  5. J de Boyne Pollard

    Standard C library functions in freestanding systems

    J de Boyne Pollard, Sep 19, 2007, in forum: C Programming
    Replies:
    20
    Views:
    797
Loading...

Share This Page