imcplugin

In order to support running dynamically-linked glibc code under NaCl from the web browser, and to better understand the browser-plugin interface, I have created a minimal NaCl NPAPI plugin. Unlike the existing NaCl plugin, it supports calling Javascript asynchronously from the NaCl process.

Background: glibc's dynamic linker expects to be able to use open() to open library .so files. This works with sel_ldr's -d (debug) option, where NaCl's open() syscall accesses the local filesystem. In the NaCl browser plugin, this syscall is of course not available. This is not itself a problem, because open() in glibc can be reimplemented as a remote procedure call across a NaCl IMC socket, using NaCl's imc_sendmsg() and imc_recvmsg() syscalls. The idea is that Javascript code would handle an open() request by firing off an AJAX request for the file, and, on completion of the fetch, by sending the file descriptor to the NaCl process in a reply message. This is similar to how open() is implemented in Plash. Although NaCl's existing browser plugin backends already support sending file descriptors to the NaCl process, they don't support calling Javascript asynchronously from the NaCl process.

Features

However:

The code is part of my NaCl branch, in http://repo.or.cz/w/nativeclient.git.

NativeClient/Plugin (last edited 2009-04-09 19:13:00 by MarkSeaborn)