File: cow.jgr

package info (click to toggle)
jgraph 83-25
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,008 kB
  • sloc: ansic: 4,596; makefile: 145; sh: 106; awk: 104
file content (48 lines) | stat: -rw-r--r-- 1,730 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
(* This is a picture of the Copy-on-write checkpointing algorithm. *)

newgraph
xaxis min 0 max 3 size 2.5 nodraw
yaxis min 0 max 2.0 size 2 nodraw

(* Draw the address space *)
newstring fontsize 9 hjc vjt x 0.25 y -0.07 : Address\
Space

(* Draw the page boundaries with awk *)

newcurve marktype ellipse marksize 0.1 .14 fill 1 pts
shell : echo "" | awk '{ for (i = 0.67; i < 2.0; i += 0.14) printf("0.5 %f\n", i, i);}'
newcurve marktype box fill 1 marksize 0.5 2.0 pts 0.25 1
shell : echo "" | awk '{ for (i = 0.6; i < 2.0; i += 0.14) printf("newline pts 0 %f 0.5 %f\n", i, i);}'

(* Draw the registers *)
newline pts 0.0 0.6    0.5 0.6
shell : echo "0.7 0" | awk -f regs.awk
newstring hjc vjc fontsize 7 x 1.3 y 0.3 : . . .
newstring fontsize 9 hjc vjt x 1.05 y -0.07 : CPU\
States

(* Draw the second address space *)
newcurve fill 1 marktype ellipse marksize 0.2 1.5 pts 2.2 1.25
newcurve marktype box marksize 0.5 2.0 fill 1 pts 1.95 1
copycurve marksize 0.5 1.4 fill .5 pts 1.95 1.3
copycurve marksize 0.5 0.1 pts 1.95 0.55

(* Draw the second address space's page boundaries *)

shell : echo "" | awk '{ for (i = 0.6; i < 2.0; i += 0.14) printf("newline pts 1.7 %f 2.2 %f\n", i, i);}'
shell : echo "" | awk '{ for (i = 0.67; i < 2.0; i += 0.14) printf("newline linetype dotted rarrow asize .07 .04  pts 0.55 %f 1.65 %f\n", i, i);}'

newstring fontsize 9 hjc vjt x 1.95 y -0.07 : New Address\
Space

(* Draw the arrows *)
newline pts 1.3 0.575   1.22  0.4
newline pts 1.3 0.575   1.3  0.4
newline pts 1.3 0.575   1.38  0.4
newline rarrow asize .07 .04  pts 1.0 0.6   1.3 0.575   1.6 0.55

newline linetype longdash rarrow asize .07 .04  pts 2.3 1.25 2.6 0.45

(* Draw the disk *)
shell : echo "2.5 0.0" | awk -f disk.awk