commit 284596be4936dbc22794922b2c8a6710ce14a32e from: Benjamin Stürz date: Sun Feb 18 04:19:24 2024 UTC add syscalls.inc commit - 28b38de889c28ccc6b2435687c449769964fb3b9 commit + 284596be4936dbc22794922b2c8a6710ce14a32e blob - 0124be0d0399890d4e4aa77f2999f84e02b39223 blob + b862efd1a319407c20f8397f6fa3a7b6fd65b9b9 --- .gitignore +++ .gitignore @@ -2,4 +2,5 @@ *.core *.o *.elf +rvemu blob - 0fcace3e0ae1c76939fbc8d1ad79106c9290e4e6 blob + 3b928603eeb236751aa7330bac45315c53fb97d8 --- Makefile +++ Makefile @@ -24,7 +24,7 @@ rvemu: ${OBJ} ${CC} -c -o $@ $< ${CFLAGS} -.S.o: +.S.o: syscalls.inc ${CROSS}-as -o $@ $< .o.elf: linker.ld blob - e48a65d5ceb0daab64effa974cba050b24acdd14 blob + 2d4bd3fa404ee1f85babb18ff8609923bbd281e4 --- hello.S +++ hello.S @@ -1,5 +1,7 @@ -.set SYS_write, 64 -.set SYS_exit, 93 +.include "syscalls.inc" +#include "syscalls.inc" +#.set SYS_write, 64 +#.set SYS_exit, 93 .section .rodata str: .string "Hello World\n" blob - b9cf831a66327caa176a853f9239c030145d5cc8 (mode 755) blob + /dev/null Binary files rvemu and /dev/null differ blob - /dev/null blob + 5df22c2c59aad064533fec3b092b5bd3b62773b7 (mode 644) --- /dev/null +++ syscalls.inc @@ -0,0 +1,233 @@ +.set SYS_getcwd, 17 +.set SYS_dup, 23 +.set SYS_dup3, 24 +.set SYS_fcntl, 25 +.set SYS_ioctl, 29 +.set SYS_flock, 32 +.set SYS_mknodat, 33 +.set SYS_mkdirat, 34 +.set SYS_unlinkat, 35 +.set SYS_symlinkat, 36 +.set SYS_linkat, 37 +.set SYS_renameat, 38 +.set SYS_umount, 39 +.set SYS_mount, 40 +.set SYS_pivot_root, 41 +.set SYS_nfsservctl, 42 +.set SYS_statfs, 43 +.set SYS_fstatfs, 44 +.set SYS_truncate, 45 +.set SYS_ftruncate, 46 +.set SYS_fallocate, 47 +.set SYS_faccessat, 48 +.set SYS_chdir, 49 +.set SYS_fchdir, 50 +.set SYS_chroot, 51 +.set SYS_fchmod, 52 +.set SYS_fchmodat, 53 +.set SYS_fchownat, 54 +.set SYS_fchown, 55 +.set SYS_openat, 56 +.set SYS_close, 57 +.set SYS_vhangup, 58 +.set SYS_pipe2, 59 +.set SYS_quotactl, 60 +.set SYS_getdents64, 61 +.set SYS_lseek, 62 +.set SYS_read, 63 +.set SYS_write, 64 +.set SYS_readv, 65 +.set SYS_writev, 66 +.set SYS_pread, 67 +.set SYS_pwrite, 68 +.set SYS_preadv, 69 +.set SYS_pwritev, 70 +.set SYS_pwritev, 71 +.set SYS_pselect6, 72 +.set SYS_ppoll, 73 +.set SYS_signalfd4, 74 +.set SYS_vmsplice, 75 +.set SYS_splice, 76 +.set SYS_tee, 77 +.set SYS_readlinkat, 78 +.set SYS_fstatat, 79 +.set SYS_fstat, 80 +.set SYS_sync, 81 +.set SYS_fsync, 82 +.set SYS_fdatasync, 83 +.set SYS_sync_file_range, 84 +.set SYS_timerfd_create, 85 +.set SYS_timerfd_settime, 86 +.set SYS_timerfd_gettime, 87 +.set SYS_utimensat, 88 +.set SYS_acct, 89 +.set SYS_capget, 90 +.set SYS_capset, 91 +.set SYS_personality, 92 +.set SYS_exit, 93 +.set SYS_exit_group, 94 +.set SYS_waitid, 95 +.set SYS_set_tid_address, 96 +.set SYS_unshare, 97 +.set SYS_futex, 98 +.set SYS_set_robust_limit, 99 +.set SYS_get_robust_limit, 100 +.set SYS_nanosleep, 101 +.set SYS_gettimer, 102 +.set SYS_settimer, 103 +.set SYS_kexec_load, 104 +.set SYS_kexec_init_module, 105 +.set SYS_kexec_delete_module, 106 +.set SYS_timer_create, 107 +.set SYS_timer_gettime, 108 +.set SYS_timer_getoverrun, 109 +.set SYS_timer_settime, 110 +.set SYS_timer_delete, 111 +.set SYS_clock_settime, 112 +.set SYS_clock_gettime, 113 +.set SYS_clock_getres, 114 +.set SYS_clock_nanosleep, 115 +.set SYS_syslog, 116 +.set SYS_ptrace, 117 +.set SYS_sched_setparam, 118 +.set SYS_sched_setscheduler, 119 +.set SYS_sched_getscheduler, 120 +.set SYS_sched_getparam, 121 +.set SYS_sched_setaffinity, 122 +.set SYS_sched_getaffinity, 123 +.set SYS_sched_yield, 124 +.set SYS_sched_get_priority_max, 125 +.set SYS_sched_get_priority_min, 126 +.set SYS_sched_rr_get_interval, 127 +.set SYS_restart_syscall, 128 +.set SYS_kill, 129 +.set SYS_tkill, 130 +.set SYS_tgkill, 131 +.set SYS_signalstack, 132 +.set SYS_sigaction, 133 +.set SYS_sigaction, 134 +.set SYS_rt_sigprocmask, 135 +.set SYS_sigpending, 136 +.set SYS_sigtimedwait, 137 +.set SYS_sigqueueinfo, 138 +.set SYS_sigreturn, 139 +.set SYS_setpriority, 140 +.set SYS_getpriority, 141 +.set SYS_reboot, 142 +.set SYS_setregid, 143 +.set SYS_setgid, 144 +.set SYS_setreuid, 145 +.set SYS_setuid, 146 +.set SYS_setresuid, 147 +.set SYS_getresuid, 148 +.set SYS_setresgid, 149 +.set SYS_getresgid, 150 +.set SYS_setfsuid, 151 +.set SYS_setfsgid, 152 +.set SYS_times, 153 +.set SYS_setpgid, 154 +.set SYS_getpgid, 155 +.set SYS_getsid, 156 +.set SYS_setsid, 158 +.set SYS_setgroups, 159 +.set SYS_uname, 160 +.set SYS_sethostname, 161 +.set SYS_setdomainname, 162 +.set SYS_getrlimit, 163 +.set SYS_setrlimit, 164 +.set SYS_getrusage, 165 +.set SYS_umask, 166 +.set SYS_prctl, 167 +.set SYS_getcpu, 168 +.set SYS_gettimeofday, 169 +.set SYS_settimeofday, 170 +.set SYS_adjtimex, 171 +.set SYS_getpid, 172 +.set SYS_getuid, 174 +.set SYS_geteuid, 175 +.set SYS_getgid, 176 +.set SYS_getegid, 177 +.set SYS_gettid, 178 +.set SYS_sysinfo, 179 +.set SYS_msgget, 186 +.set SYS_msgctl, 187 +.set SYS_msgrcv, 188 +.set SYS_msgsnd, 189 +.set SYS_semget, 190 +.set SYS_semctl, 191 +.set SYS_semtimedop, 192 +.set SYS_semop, 193 +.set SYS_readahead, 213 +.set SYS_brk, 214 +.set SYS_munmap, 215 +.set SYS_mremap, 216 +.set SYS_add_key, 217 +.set SYS_request_key, 218 +.set SYS_keyctl, 219 +.set SYS_clone, 220 +.set SYS_execve, 221 +.set SYS_mmap, 222 +.set SYS_fadvise64, 223 +.set SYS_swapon, 224 +.set SYS_swapoff, 225 +.set SYS_mprotect, 226 +.set SYS_msync, 227 +.set SYS_mlock, 228 +.set SYS_munlock, 229 +.set SYS_mlockall, 230 +.set SYS_munlockall, 231 +.set SYS_mincore, 232 +.set SYS_madvise, 233 +.set SYS_remap_file_pages, 234 +.set SYS_mbind, 235 +.set SYS_get_mempolicy, 236 +.set SYS_set_mempolicy, 237 +.set SYS_migrate_pages, 238 +.set SYS_move_pages, 239 +.set SYS_rt_tgsigqueueinfo, 240 +.set SYS_perf_event_open, 241 +.set SYS_accept4, 242 +.set SYS_recvmsg, 243 +.set SYS_prlimit64, 261 +.set SYS_fanotify_init, 262 +.set SYS_fanotify_mark, 263 +.set SYS_name_to_handle_at, 264 +.set SYS_open_by_handle_at, 265 +.set SYS_clock_adjtime, 266 +.set SYS_syncfs, 267 +.set SYS_setns, 268 +.set SYS_sendmsg, 269 +.set SYS_process_vm_readv, 270 +.set SYS_process_vm_writev, 271 +.set SYS_kcmp, 272 +.set SYS_finit_module, 273 +.set SYS_sched_setattr, 274 +.set SYS_sched_getattr, 275 +.set SYS_renameat2, 276 +.set SYS_seccomp, 277 +.set SYS_getrandom, 278 +.set SYS_memfd_create, 279 +.set SYS_bpf, 280 +.set SYS_execveat, 281 +.set SYS_userfaultfd, 282 +.set SYS_membarrier, 283 +.set SYS_mlock2, 284 +.set SYS_copy_file_range, 285 +.set SYS_preadv2, 286 +.set SYS_pwritev2, 287 +.set SYS_pkey_mprotect, 288 +.set SYS_pkey_alloc, 289 +.set SYS_pkey_free, 290 +.set SYS_statx, 291 +.set SYS_io_pgetevents, 292 +.set SYS_rseq, 293 +.set SYS_kexec_file_load, 294 +.set SYS_open, 1024 +.set SYS_link, 1025 +.set SYS_unlink, 1026 +.set SYS_mkdir, 1030 +.set SYS_access, 1033 +.set SYS_stat, 1038 +.set SYS_lstat, 1039 +.set SYS_time, 1062 +.set SYS_getmainvars, 2011 blob - 609715196ddc1730c0e3b716900d66b8a948016e blob + e2cf2fffaab6a3f386b08769438e3f48c8d37b19 --- test.S +++ test.S @@ -1,7 +1,4 @@ -.set SYS_write, 64 -.set SYS_exit, 93 -.set SYS_clone, 220 -.set SYS_execve, 221 +.include "syscalls.inc" .section .data parent: .string "Parent\n"