Skip to content

Linux system calls implementation tasks. #57

@yomaytk

Description

@yomaytk

We should emulate the Linux system calls on both the WASI and the browser. Many system calls can easily implemented by using the function defined in wasi-libc or emscripten as follows (below example is the implementation of read). Some system calls (e.g. fork, exec) not supported by WASI or Wasm need to be implemented from scratch.

case AARCH64_SYS_READ: /* read (unsigned int fd, char *buf, size_t count) */
      state_gpr.x0.qword = read(state_gpr.x0.dword, (char *) TranslateVMA(state_gpr.x1.qword),
                                static_cast<size_t>(state_gpr.x2.qword));
      break;

The current status can be watched by watching RuntimeManager::UnImplementedBrowserSyscall implementation (e.g. runtime/syscalls/SyscallBrowser.cpp/RuntimeManager::UnImplementedBrowserSyscall).

The status is a little different depending on the target architecture (Browser or WASI or native). All system calls are based on Linux 6.8.0 aarch64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions