Andreas Fredriksson
2007-Apr-27 22:43 UTC
[Samba] Guide to porting to non-unix like systems?
Hi, I'd like to get a rough idea on how much work it would be to port Samba to a non-unix platform. My plan was to use a slimmed-down samba to read and write files on a particularly unfriendly piece of proprietary hardware we use at work. I'm fine with a minimalistic samba as this port would be for internal, single-developer use and not intended for file serving in general. Here are some things I'm wondering about, given the background: 1) Is fork() required, or could it be emulated via threads? 2) Could nmdb and smbd share a single process w.r.t 1) or is even possible to drop nmdb and just serve stuff slowly with a single smbd process? 3) Is Samba very tightly tied to the POSIX file/directory APIs? My intended target system has a rich I/O API (including async capabilities and various bells and whistles) but the APIs are fairly exotic and don't map well to e.g. DIR and file descriptors. 4) Is there a checklist somewhere of stuff a target system for smbd/nmbd would have to support to make a port feasible? Thanks, Andreas
On Sat, 2007-04-28 at 00:43 +0200, Andreas Fredriksson wrote:> Hi, > I'd like to get a rough idea on how much work it would be to port > Samba to a non-unix platform. My plan was to use a slimmed-down samba > to read and write files on a particularly unfriendly piece of > proprietary hardware we use at work. I'm fine with a minimalistic > samba as this port would be for internal, single-developer use and not > intended for file serving in general.Andreas, this kind of question would be served better if posted on samba-technical@samba.org as it is about technical matters.> Here are some things I'm wondering about, given the background: > > 1) Is fork() required, or could it be emulated via threads? > > 2) Could nmdb and smbd share a single process w.r.t 1) or is even > possible to drop nmdb and just serve stuff slowly with a single smbd > process? > > 3) Is Samba very tightly tied to the POSIX file/directory APIs? My > intended target system has a rich I/O API (including async > capabilities and various bells and whistles) but the APIs are fairly > exotic and don't map well to e.g. DIR and file descriptors. > > 4) Is there a checklist somewhere of stuff a target system for > smbd/nmbd would have to support to make a port feasible?If you don't have fork, and have a btter I/O API I'd direct you at looking at samba4. Samba4 can run in a single process. Samba4 integrates the NBT functionality without requiring a second daemon. In Samba4 you can write NTVFS modules without necessarily using posix semantics (like samba3 vfs layer require instead). While samba4 is still not released it should be ok for the kind of use you have in mind. Samba4 can have a better memory footprint as well. Simo. -- Simo Sorce Samba Team GPL Compliance Officer email: idra@samba.org http://samba.org
Andreas, This book might be completely useless to you, or it might be just what you need: Implementing CIFS: The Common Internet File System by Christopher R. Hertel (a member of the Samba team) Prentice Hall ISBN: 0-13-047116-X>From the introduction, "This book is aimed at developers who want to add CIFS compatibility to their products.... This is a technical book, and knowledge of programming and TCP/IP networking is assumed. The protocol descriptions, however, start with the basics and build up, so very little previous knowledge of CIFS is expected. For the programmer, there are several code examples. They have all been tested under Debian GNU/Linux, but you may need to do a little work to get them to run elsewhere. The code is intended to be illustrative rather than functional. It works, but it is not production-quality. That's okay, since part of the purpose of this book is to help you write your own code -- if that's where your interests lie."The book is available in print and it also has a web site where you can read it online at: http://www.ubiqx.org/cifs/ It can also be downloaded as PDF from: http://www.phptr.com/content/images/013047116X/downloads/013047116X_pdf.zip I think it's linked to from the Samba.org web site too. ________________________________ From: samba-bounces+thomas.mcneely=wwu.edu@lists.samba.org on behalf of Andreas Fredriksson Sent: Fri 4/27/2007 3:43 PM To: samba@lists.samba.org Subject: [Samba] Guide to porting to non-unix like systems? Hi, I'd like to get a rough idea on how much work it would be to port Samba to a non-unix platform. My plan was to use a slimmed-down samba to read and write files on a particularly unfriendly piece of proprietary hardware we use at work. I'm fine with a minimalistic samba as this port would be for internal, single-developer use and not intended for file serving in general. Here are some things I'm wondering about, given the background: 1) Is fork() required, or could it be emulated via threads? 2) Could nmdb and smbd share a single process w.r.t 1) or is even possible to drop nmdb and just serve stuff slowly with a single smbd process? 3) Is Samba very tightly tied to the POSIX file/directory APIs? My intended target system has a rich I/O API (including async capabilities and various bells and whistles) but the APIs are fairly exotic and don't map well to e.g. DIR and file descriptors. 4) Is there a checklist somewhere of stuff a target system for smbd/nmbd would have to support to make a port feasible? Thanks, Andreas -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
On Sat, 2007-04-28 at 00:43 +0200, Andreas Fredriksson wrote:> Hi, > I'd like to get a rough idea on how much work it would be to port > Samba to a non-unix platform. My plan was to use a slimmed-down samba > to read and write files on a particularly unfriendly piece of > proprietary hardware we use at work. I'm fine with a minimalistic > samba as this port would be for internal, single-developer use and not > intended for file serving in general. > > Here are some things I'm wondering about, given the background: > > 1) Is fork() required, or could it be emulated via threads?Threads are not an option (we expect that variables will not be shared after the fork), but in Samba4 we can execute as a single process (as a state machine)> 2) Could nmdb and smbd share a single process w.r.t 1) or is even > possible to drop nmdb and just serve stuff slowly with a single smbd > process?nmbd is required for browsing and name registration. In Samba4, it is just part of the smbd state machine.> 3) Is Samba very tightly tied to the POSIX file/directory APIs? My > intended target system has a rich I/O API (including async > capabilities and various bells and whistles) but the APIs are fairly > exotic and don't map well to e.g. DIR and file descriptors.Samba4 is less tied to this than Samba3, but doing without anything like POSIX will be hard.> 4) Is there a checklist somewhere of stuff a target system for > smbd/nmbd would have to support to make a port feasible?The experience (particularly with Samba3) has been that it is easier to add a POSIX layer to the OS than to keep 'fixing' samba. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Red Hat Inc. http://redhat.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.samba.org/archive/samba/attachments/20070428/d99dffc7/attachment.bin
Andreas Fredriksson
2007-Apr-29 10:00 UTC
[Samba] Guide to porting to non-unix like systems?
On 4/28/07, Andrew Bartlett <abartlet@samba.org> wrote:> Samba4 is less tied to this than Samba3, but doing without anything like > POSIX will be hard.I think my best shot then is to make an experimental hack on top of Samba4 and go from there with perhaps adding a small POSIX emulation layer on top of the native APIs. Thanks for the info! // Andreas