Who knows the history of the Unix plug?

Fork is a great tool for unix. We can use it to create our copy and change its behavior. But I do not know the history of fork.

Can anyone tell me a story?

+3
source share
1 answer

In fact, unlike many of the core functions of UNIX, it forkwas relative lateness (a) .

The earliest existence of several processes on UNIX consisted of several (fixed) processes, one per terminal that was attached to the PDP-7 (b) machine .

, , , , .

( ) .

, exit, exit, . exit , , .

, exec, , .

exec , , , exec, exit.

, , Multics, UNIX .

exec fork . , " , ", , fork exec UNIX. fork.

Unix, The Evolution of the Unix Time-Sharing System , 1979 , AT & T.


(a) , "", 0,00000000001 . . </humor> .


(b) , , , Unix Unix, , , .

init.s , ( ):

    ...
    mov    $itab, r1        / address of table to r1
1:
    mov    (r1)+, r0        / 'x, x=0, 1... to r0
    beq    1f               / branch if table end
    movb   r0, ttyx+8       / put symbol in ttyx
    jsr    pc, dfork        / go to make new init for this ttyx
    mov    r0, (r1)+        / save child id in word offer '0, '1, etc
    br     1b               / set up next child
1:
    ...

itab:
    '0; ..
    '1; ..
    '2; ..
    '3; ..
    '4; ..
    '5; ..
    '6; ..
    '7; ..
    0

, . , . itab , , , , (, - ), 1, , 1b 1 ).

, dfork, getty, . getty, , . , .


(c) ( , ), , GECOS , , uber-geeks.

+4

Source: https://habr.com/ru/post/1794130/


All Articles