diff options
Diffstat (limited to 'anim/scenes/syscalls.zig')
| -rw-r--r-- | anim/scenes/syscalls.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/anim/scenes/syscalls.zig b/anim/scenes/syscalls.zig index db67045..0d39089 100644 --- a/anim/scenes/syscalls.zig +++ b/anim/scenes/syscalls.zig @@ -58,11 +58,15 @@ fn frame(s: *anim.Frame) void { says.line(s, "`main` calls `open` by its stub in the PLT. The arguments\nare in rdi and rsi: \"note\" and O_RDONLY."); canim.descent.step(cur, s, .moment); s.wait(t.phrase_rest); - says.line(s, "The call went down: main's window keeps its call, ringed;\nthe stub's jmp reads the GOT, and goes on to libc."); + says.line(s, "The call went down: main's window keeps its call, ringed,\nand the stub's three rows open under it."); + says.line(s, "The stub's jmp reads open@got, the GOT's slot,\nand goes on to libc's `open`."); canim.descent.step(cur, s, .moment); s.wait(t.phrase_rest); - says.line(s, "libc's `open` is a wrapper: it puts openat's number in rax\nand its arguments in rdi, rsi, rdx and r10."); - cur.hurry(s, .moment, crossing, .{}); + // The wrapper at a run, veiled; its last three instructions walked, named as they run. + says.line(s, "libc's `open` is a wrapper: no source, its own code,\nup to the instruction that calls the kernel."); + cur.hurry(s, .moment, crossing - 3, .{}); + says.line(s, "Its last three set r8 to 0, rdi to AT_FDCWD (-100)\nand rax to 257: openat's number."); + cur.walk(s, .moment, crossing); says.line(s, "`syscall` crosses down. The kernel opens the file\nand answers in rax: 3, the descriptor."); canim.descent.step(cur, s, .moment); s.wait(t.phrase_rest); |
