about summary refs log tree commit diff stats
path: root/init.linux
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-11-11 22:58:29 -0800
committerKartik Agaram <vc@akkartik.com>2020-11-11 23:25:55 -0800
commit307745bcc2efbd4c5b8191b45d5e1885be1c0089 (patch)
treea0da43e2258fea744143b24e2560e042c481125a /init.linux
parent7d15b0884eb57657b130b98f3701544fedaf4b7f (diff)
downloadmu-307745bcc2efbd4c5b8191b45d5e1885be1c0089.tar.gz
7225
Both manual tests described in commit 7222 now work.

To make them work I had to figure out how to copy a file. It
requires a dependency on a new syscall: lseek.
Diffstat (limited to 'init.linux')
-rw-r--r--init.linux6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.linux b/init.linux
index 6e482b96..f151d80f 100644
--- a/init.linux
+++ b/init.linux
@@ -43,6 +43,12 @@ syscall_close:  # fd/ebx: int -> status/eax
     cd/syscall 0x80/imm8
     c3/return
 
+# http://man7.org/linux/man-pages/man2/lseek.2.html
+syscall_lseek:  # fd/ebx: int, offset/ecx: int, whence/edx: int
+    b8/copy-to-eax 0x13/imm32
+    cd/syscall 0x80/imm8
+    c3/return
+
 # http://man7.org/linux/man-pages/man2/creat.2.html
 syscall_creat:  # filename/ebx: (addr kernel-string) -> fd-or-error/eax: int
     b8/copy-to-eax 8/imm32