From: James Carlson <carlsonj@workingcode.com>
To: linux-ppp@vger.kernel.org
Subject: Re: Porting source to OSX
Date: Fri, 14 Feb 2020 18:25:43 +0000 [thread overview]
Message-ID: <21ea0c4d-c895-65a8-7d00-ef19ec1c824e@workingcode.com> (raw)
In-Reply-To: <808CF219-67B9-45A0-B1FA-A53E682B0B06@gmail.com>
On 2/14/20 11:58 AM, igal avraham wrote:
> Thanks for the fast reply.
>
> Are there any guidelines for porting if I want to do it by myself ?
If Apple shipped their driver header files, you *might* be able to get
away with compiling just the user-space code alone, substituting in
those headers. A quick check of a Mac system I have shows that the
header files for PPP are missing. I don't know how you'd go about
getting them. Maybe you'd get lucky and their kernel modules don't
differ significantly from those used on other OSes. It's perhaps worth
a try. It'll take some hacking of the 'configure' script to make it happen.
Assuming that fails ...
The starting point for a complete port is the kernel module, which must
be able to attach to a serial driver (so that we can send/receive frames
using AHDLC or HDLC) and to the network stack (so that we can behave as
a data link layer protocol in the system).
How this is done varies dramatically based on system design, kernel
facilities, and resource management issues. Feel free to look through
the 'modules' subdirectory in the pppd distribution for an example of
how it's done on a STREAMS-based system, and the Linux sources for an
example of that kernel:
https://github.com/torvalds/linux/blob/master/drivers/net/ppp/ppp_generic.c
Perhaps closer to what you want is the FreeBSD port, given that I think
Darwin is a derivative of the original BSD4.4, but that one is even
further afield of the original pppd sources. They've forked the sources
and maintain them as part of the FreeBSD tree. (I think similar things
are true for the other *BSD variants.)
https://github.com/freebsd/freebsd/tree/master/usr.sbin/ppp
I don't know how much of Darwin's kernel is publicly documented. I know
they released some stuff openly for a while and then gave up on the
whole "open source" thing. You might be able to get some pointers
through one of the projects that derived from that:
http://www.puredarwin.org/
And, if successful, you'd also need to figure out how to put a
cryptographic signature on your module so you can load it in the kernel.
Much luck with that part; all I know is that it's non-trivial.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
prev parent reply other threads:[~2020-02-14 18:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 14:51 Porting source to OSX igal avraham
2020-02-14 16:40 ` James Carlson
2020-02-14 16:58 ` igal avraham
2020-02-14 18:25 ` James Carlson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21ea0c4d-c895-65a8-7d00-ef19ec1c824e@workingcode.com \
--to=carlsonj@workingcode.com \
--cc=linux-ppp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.