diff options
| author | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-11-25 21:05:19 +0000 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-11-26 10:01:00 +0000 |
| commit | 710a7406c91a273a937e1450a0f2bcb0c09aacf1 (patch) | |
| tree | c504be145141bd71debaa812911bf72cda2b271e /src | |
| parent | d2883b2c2fe4c60b82b98c0adef0c3a0311cc455 (diff) | |
| download | focaccia-710a7406c91a273a937e1450a0f2bcb0c09aacf1.tar.gz focaccia-710a7406c91a273a937e1450a0f2bcb0c09aacf1.zip | |
Add more emulated syscalls for interacting with the file system
Diffstat (limited to 'src')
| -rw-r--r-- | src/focaccia/qemu/x86.py | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/focaccia/qemu/x86.py b/src/focaccia/qemu/x86.py index ef071c1..d8641fc 100644 --- a/src/focaccia/qemu/x86.py +++ b/src/focaccia/qemu/x86.py @@ -4,12 +4,46 @@ from focaccia.qemu.syscall import SyscallInfo emulated_system_calls = { 0: SyscallInfo('read', patchup_address_registers=['rsi']), 1: SyscallInfo('write'), + 2: SyscallInfo('open'), + 3: SyscallInfo('close'), + 4: SyscallInfo('stat', patchup_address_registers=['rsi']), + 5: SyscallInfo('fstat', patchup_address_registers=['rsi']), + 6: SyscallInfo('lstat', patchup_address_registers=['rsi']), + 8: SyscallInfo('lseek'), + 16: SyscallInfo('ioctl', patchup_address_registers=['rdx']), + 17: SyscallInfo('pread64', patchup_address_registers=['rsi']), + 18: SyscallInfo('pwrite64'), 19: SyscallInfo('readv', patchup_address_registers=['rsi']), 20: SyscallInfo('writev'), 21: SyscallInfo('access'), - 34: SyscallInfo('pause', []), - 39: SyscallInfo('getpid', []), - 102: SyscallInfo('getuid', []), + 24: SyscallInfo('sched_yield'), + 34: SyscallInfo('pause'), + 39: SyscallInfo('getpid'), + 72: SyscallInfo('fcntl', patchup_address_registers=['rdx']), + 73: SyscallInfo('flock'), + 74: SyscallInfo('fsync'), + 75: SyscallInfo('fdatasync'), + 76: SyscallInfo('truncate'), + 77: SyscallInfo('ftruncate'), + 78: SyscallInfo('getdents', patchup_address_registers=['rsi']), + 79: SyscallInfo('getcwd', patchup_address_registers=['rdi']), + 80: SyscallInfo('chdir'), + 81: SyscallInfo('fchdir'), + 82: SyscallInfo('rename'), + 83: SyscallInfo('mkdir'), + 84: SyscallInfo('rmdir'), + 85: SyscallInfo('creat'), + 86: SyscallInfo('link'), + 87: SyscallInfo('unlink'), + 88: SyscallInfo('symlink'), + 89: SyscallInfo('readlink', patchup_address_registers=['rsi']), + 90: SyscallInfo('chmod'), + 91: SyscallInfo('fchmod'), + 92: SyscallInfo('chown'), + 93: SyscallInfo('fchown'), + 94: SyscallInfo('lchown'), + 95: SyscallInfo('umask'), + 102: SyscallInfo('getuid'), 318: SyscallInfo('getrandom', patchup_address_registers=['rdi']) } |