Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing a 9p server

I am looking to develop a C implementation of a 9p file server on a Linux machine. There isn't enough documentation in the internet about 9p and I am not very experienced with implementing servers. My general design is as follows:

  1. Use UNIX sockets to listen to incoming 9p messages.
  2. Decode the 9p message and spawn a new thread to perform the required task.
  3. Reply to the client with the appropriate 9p reply message.

The server would just live in the user space and it will translate the 9p messages into a UNIX call.

Do you see any problems or have any recommendations regarding the proposed design? Are there any documentations that you can refer me to that will help me? How do you think I should debug my server and make sure it is working correctly.

like image 796
Keeto Avatar asked Jul 14 '15 22:07

Keeto


1 Answers

Consider libixp (MIT license).

I've played around with wmii and use it in everyday work. libixp was part of wmii (in the earliest releases) and now it is an independent project. Check wmii's early versions to get a good starting point or dive directly into libixp.

To debug your server just mount it with 9PFUSE(4) with parameter −D to print each FUSE and 9P message.

like image 182
egor7 Avatar answered Sep 22 '22 12:09

egor7