From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Glendix? From: "Russ Cox" Date: Tue, 13 Nov 2007 11:26:48 -0500 In-Reply-To: <47396E4D.6020005@kix.in> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20071113162642.1E4CA1E8C1F@holo.morphisms.net> Topicbox-Message-UUID: f7973286-ead2-11e9-9d60-3106f5b1d025 > 1) Modify the Linux kernel to present a 9P interface to itself (too > hard, almost like re-writing several important parts of the kernel) > 2) Modify the Plan 9 userspace to work with POSIX (Yuck, and Plan9Port > already does this) > 3) Create a custom INIT process which will be responsible for providing > all the "plan 9 kernelish" features that userspace programs expect (for > eg. providing the /net directory), so that all of them can run unmodified. As Forsyth says, this may not be such a great final-year project, especially if you have only two months in which to do the work. That said again, I don't think any of the three strategies above would really make Linux feel like Plan 9. For example, I should be able to "9fs sources" and then run the Unix ls or the Gnome file browser or whatever on /n/sources and have it work. To really make it feel like Plan 9, you'd first want to write a binary format driver (in Linux) for Plan 9's a.out binaries. Then you can load Plan 9 binaries directly. That much is pretty simple. Next, you'd want to implement the Plan 9 system calls as an "alternate personality" for the Linux kernel, to be used when running the Plan 9 binaries. Some of the system calls are fairly easy -- open, read, write, close, stat, wstat -- but bind / mount will require: - per-process name spaces accessible to normal users (CLONE_NEWNS is only available to root, but you can probably reuse some or all of the code) - letting normal users do 9p mounts anywhere in their own name space (can probably use v9fs here) Also rfork, notes, etc. will require a little bit of work, but they're straightforward. Once you've got that, then the icing on the cake would be doing things like writing a /net for Linux and then rewriting the socket calls to do user space file operations on /net. Then you could do things like import othermachine /net firefox Also the missing /proc files and so on. Russ