/[osn-commons]/trunk/plibc/x86_64/syscalls.s
ViewVC logotype

Annotation of /trunk/plibc/x86_64/syscalls.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (hide annotations)
Fri Aug 16 18:34:43 2024 UTC (7 months, 2 weeks ago) by rakinar2
File MIME type: text/x-asm
File size: 978 byte(s)
feat: add basic utilities and more system calls

1 rakinar2 47 .text
2    
3 rakinar2 51 .globl sys_write
4     .type sys_write, @function
5 rakinar2 47
6 rakinar2 51 sys_write:
7 rakinar2 47 mov $1, %rax
8     syscall
9     ret
10    
11 rakinar2 51 .globl sys_exit
12     .type sys_exit, @function
13     sys_exit:
14 rakinar2 47 mov $60, %rax
15     syscall
16     ret
17    
18 rakinar2 51 .globl sys_sbrk
19     .type sys_sbrk, @function
20     sys_sbrk:
21 rakinar2 47 mov $12, %rax
22     syscall
23     ret
24    
25 rakinar2 51 .globl sys_brk
26     .type sys_brk, @function
27     sys_brk:
28 rakinar2 47 mov $0, %rdi
29     call sbrk
30     ret
31    
32 rakinar2 51 .globl sys_mmap
33     .type sys_mmap, @function
34 rakinar2 47
35 rakinar2 51 sys_mmap:
36 rakinar2 47 mov $9, %rax
37     syscall
38     ret
39    
40 rakinar2 51 .globl sys_munmap
41     .type sys_munmap, @function
42 rakinar2 47
43 rakinar2 51 sys_munmap:
44 rakinar2 47 mov $11, %rax
45     syscall
46     ret
47    
48 rakinar2 51 .globl sys_sysinfo
49     .type sys_sysinfo, @function
50 rakinar2 47
51 rakinar2 51 sys_sysinfo:
52 rakinar2 47 mov $99, %rax
53     syscall
54     ret
55    
56 rakinar2 51 .global sys_kill
57     .type sys_kill, @function
58 rakinar2 47
59 rakinar2 51 sys_kill:
60 rakinar2 47 mov $62, %rax
61     syscall
62 rakinar2 51 ret
63 rakinar2 47
64 rakinar2 51 .globl sys_open
65     .type sys_open, @function
66    
67     sys_open:
68     mov $2, %rax
69     syscall
70     ret
71    
72     .globl sys_close
73     .type sys_close, @function
74    
75     sys_close:
76     mov $3, %rax
77     syscall
78     ret
79    
80 rakinar2 47 .section .note.GNU-stack,"",@progbits

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26