.KF
.if "\*(.T"mag" \{\
.	nr PS 12
.	nr VS 14
.	ps \n(PS
.	vs \n(VS
.\}
.PP
.PS
#ifdef figure1
boxht = .3i
boxwid = .8i
movewid = .2i
Syscalls: [
	A: box "read()"; move
	B: box "open()"; move
	C: box "stat()"; move
	D: box "..."
]

boxht = last [].ht+1.2i
boxwid = last [].wid+.1i
Userlevel: box dashed with .n at last [].n + (0i, .3i)
line from Syscalls.A.s to Userlevel.s
line from Syscalls.B.s to Userlevel.s
line from Syscalls.C.s to Userlevel.s
line from Syscalls.D.s to Userlevel.s
"\s+4A User's Program\s-4" at Userlevel.se + (0, .075i) rjust
#endif

#ifdef figure1
boxwid = boxwid + 1.5i
boxht = boxht + 1i
System: box dashed with .n at last box.s - (0, .3i)

#else
boxwid = 5.5i
boxht = 2i
System: box dashed
#endif
"\s+4UNIX Kernel\s-4" at System.se + (0, .075i) rjust

#ifdef figure1
arrow from Userlevel.s to System.n
#else
arrow from System.n + (0, .3i) to System.n
#endif
boxht = .3i
boxwid = 1.5i
Sysinterface: box "Syscall Interface" dashed .02i with .n at System.n

boxht = .3i
boxwid = .8i
movewid = .2i
Rwuio: box "rwuio()" with .w at System.w + (.1i, 0); move
Copen: box "copen()"

movewid = (-.2i)
Etc: box "..." with .e at System.e - (.1i, 0)
Stat1: box "stat1()" with .e at Etc.w - (.2i, 0)

arrow from Sysinterface.s to Copen.n
#ifdef figure1
arrow from Sysinterface.s to Rwuio.n
arrow from Sysinterface.s to Etc.n
arrow from Sysinterface.s to Stat1.n
#endif

#ifdef figure1
Namei: box "namei()" at System.c - (0, .4i)
#endif
#ifdef figure2
Namei: box "namei()" at System.c - (0, .4i)
#endif
#ifdef figure3
Namei: box wid 1.8*boxwid ht 2.5*boxht at System.c - (0, .5i)
"namei()" at Namei above
Remotecheck: box wid 1.15*boxwid ht 1.3*boxht with .se at Namei.se
"check for" at Remotecheck above
"``remoteness''" at Remotecheck below
#endif

spline -> right .4i from Copen.e then to Namei.n - (.1i, 0)
#ifdef figure1
spline -> left .4i from Stat1.w then to Namei.n + (.1i, 0)
spline -> down .2i from Etc.s + (.025i, 0) then to Namei.e
#endif
boxht = 1i
boxwid = 3i

Devices: box dashed with .n at System.s - (0, .3i)
"\s+4Device Drivers\s-4" at Devices.se + (0, .075i) rjust
boxht = .5i
boxwid = 1i

#ifdef figure1
Disk: box dashed .02i with .n at Devices.n
#endif

#ifdef figure2
Disk: box dashed .02i with .ne at Devices.ne - (.2i, 0)
Pseudo: box dashed .02i with .nw at Devices.nw + (.2i, 0)
"Pseudo\-Disk" at Pseudo above
"Interface" at Pseudo below
#endif

#ifdef figure3
Disk: box dashed .02i with .ne at Devices.ne - (.2i, 0)
Net: box dashed .02i with .nw at Devices.nw + (.2i, 0)
"Network" at Net above
"Connection" at Net below
#endif

"Disk" at Disk above
"Interface" at Disk below

#ifdef figure1
arrow from Rwuio.s to Disk.n - (.025, 0)
arrow from Namei.s to Disk.n + (.025, 0)
#endif
#ifdef figure2
arrow from Rwuio.s to Pseudo.n - (.025, 0)
arrow from Namei.s to Pseudo.n + (.025, 0)
#endif
#ifdef figure3
arrow from Rwuio.s to Net.n - (.033, 0)
arrow from Copen.s to Net.n
arrow from Namei.s to Disk.n + (.025, 0)
#endif
.PE
.ce
#ifdef figure1
\fIFigure 1\fP
#endif
#ifdef figure2
\fIFigure 2\fP
#endif
#ifdef figure3
\fIFigure 3\fP
#endif
.SP
.KE
