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:
- Use UNIX sockets to listen to incoming 9p messages.
- Decode the 9p message and spawn a new thread to perform the required task.
- 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.
Consider
libixp(MIT license).I've played around with
wmiiand use it in everyday work.libixpwas part ofwmii(in the earliest releases) and now it is an independent project. Checkwmii's early versions to get a good starting point or dive directly intolibixp.To debug your server just mount it with
9PFUSE(4)with parameter−Dto print each FUSE and 9P message.