diff options
author | fxqnlr <[email protected]> | 2024-09-20 00:22:43 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-20 00:22:43 +0200 |
commit | 9c5783f030d7c876ccf6e05e8182d88f84a97fc3 (patch) | |
tree | 150f2cccd904d1ed787cc6f413a12960ef26e5d2 /sys.asm | |
parent | f0b8e96b51b1a8b19365c9d010639c8d67a42506 (diff) | |
download | asmsite-9c5783f030d7c876ccf6e05e8182d88f84a97fc3.tar asmsite-9c5783f030d7c876ccf6e05e8182d88f84a97fc3.tar.gz asmsite-9c5783f030d7c876ccf6e05e8182d88f84a97fc3.zip |
it works, sometimes
Diffstat (limited to 'sys.asm')
-rw-r--r-- | sys.asm | 38 |
1 files changed, 13 insertions, 25 deletions
@@ -6,6 +6,10 @@ O_RDONLY equ 0 | |||
6 | O_WRONLY equ 1 | 6 | O_WRONLY equ 1 |
7 | O_RDWR equ 2 | 7 | O_RDWR equ 2 |
8 | 8 | ||
9 | AF_INET equ 2 | ||
10 | SOCK_STREAM equ 1 | ||
11 | INADDR_ANY equ 0 | ||
12 | |||
9 | macro scall1 v_rax, v_rdi | 13 | macro scall1 v_rax, v_rdi |
10 | { | 14 | { |
11 | mov rax, v_rax | 15 | mov rax, v_rax |
@@ -38,31 +42,15 @@ macro ls_open filename, flags, mode { scall3 2, filename, flags, mode } | |||
38 | 42 | ||
39 | macro ls_close fd { scall1 3, fd } | 43 | macro ls_close fd { scall1 3, fd } |
40 | 44 | ||
41 | ;; kernel: arch/x86/include/uapi/asm/stat.h | 45 | ;; macro ls_stat filename, statbuf { scall2 4, filename, statbuf } |
42 | ;; struc stat | 46 | |
43 | ;; { | 47 | macro ls_socket family, type, protocol { scall3 41, family, type, protocol } |
44 | ;; .st_dev rd 1 | 48 | |
45 | ;; .st_ino rd 1 | 49 | macro ls_accept fd, upeer_sockaddr, upeer_addrlen { scall3 43, fd, upeer_sockaddr, upeer_addrlen } |
46 | ;; .st_mode rw 1 | 50 | |
47 | ;; .st_nlink rw 1 | 51 | macro ls_bind fd, umyaddr, addrlen { scall3 49, fd, umyaddr, addrlen } |
48 | ;; .st_uid rw 1 | 52 | |
49 | ;; .st_gid rw 1 | 53 | macro ls_listen fd, backlog { scall2 50, fd, backlog } |
50 | ;; .st_rdev rd 1 | ||
51 | ;; .st_size rd 1 | ||
52 | ;; .st_blksize rd 1 | ||
53 | ;; .st_blocks rd 1 | ||
54 | ;; | ||
55 | ;; .st_atime rd 1 | ||
56 | ;; .st_atime_nsec rd 1 | ||
57 | ;; .st_mtime rd 1 | ||
58 | ;; .st_mtime_nsec rd 1 | ||
59 | ;; .st_ctime rd 1 | ||
60 | ;; .st_ctime_nsec rd 1 | ||
61 | ;; | ||
62 | ;; .__unused4 rd 1 | ||
63 | ;; .__unused5 rd 1 | ||
64 | ;; } | ||
65 | macro ls_stat filename, statbuf { scall2 4, filename, statbuf } | ||
66 | 54 | ||
67 | macro ls_exit status { scall1 60, status } | 55 | macro ls_exit status { scall1 60, status } |
68 | 56 | ||