Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Oct 2017 10:11:35 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD Kernel Question
Message-ID:  <02ca2e5c-c604-2182-3e05-dcda3cdfb4db@FreeBSD.org>
In-Reply-To: <CAJFY08yVZv7b7TqXp9qELCjmqfBJO-jf_KZ-cqgOEVnJLTbROg@mail.gmail.com>
References:  <CAJFY08yVZv7b7TqXp9qELCjmqfBJO-jf_KZ-cqgOEVnJLTbROg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--1uSg05g7XguwjxLRjfmxFAd4g3M0j55bF
Content-Type: multipart/mixed; boundary="QHHL2GAV7n6AmopF4lPKItO7WUWK260ta";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-questions@freebsd.org
Message-ID: <02ca2e5c-c604-2182-3e05-dcda3cdfb4db@FreeBSD.org>
Subject: Re: FreeBSD Kernel Question
References: <CAJFY08yVZv7b7TqXp9qELCjmqfBJO-jf_KZ-cqgOEVnJLTbROg@mail.gmail.com>
In-Reply-To: <CAJFY08yVZv7b7TqXp9qELCjmqfBJO-jf_KZ-cqgOEVnJLTbROg@mail.gmail.com>

--QHHL2GAV7n6AmopF4lPKItO7WUWK260ta
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: quoted-printable

On 29/10/2017 09:03, =E9=A2=9C=E5=9F=BA=E5=B1=B9 wrote:
>  Hello! I would like to know how to provide an API in the kernel space =
to
> user space.Such As 'printf'.

How to do this depends very much on the specifics of what you want to do.=


If what you want is to expose some kernel memory structure or data so
that it can be queried from userland, then a common mechanism is
sysctl(3). There are also mechanisms commonly used for debugging and
performance monitoring, such as dtrace(1) and pmcstat(8).  You can also
log events via syslog or by writing to the kernel message buffer -- see
dmesg(8).

Otherwise, look at devd(8) and devctl(4) for a mechanism to trigger
actions in userland when certain kernel events happen, such as plugging
in a new device.

The best place to get answers for these sort of questions about kernel
development is the freebsd-hackers@freebsd.org mailing list, as that
will come to the attention of many of the kernel developers.

	Cheers,

	Matthew






--QHHL2GAV7n6AmopF4lPKItO7WUWK260ta--

--1uSg05g7XguwjxLRjfmxFAd4g3M0j55bF
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJ8BAEBCgBmBQJZ9alfXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATxfcQAKR1+C3UzqYJKoKOsntDqgX2
FNxD5opNCI5v6RoBfe+nH9Q6G84brBkBZSx7mWbyB8PtzZOW7oNFQpwWzpJVycTk
NKYIwVLFxBn1Wo2zEBgtVYzEW+UwqWq80xq+2l/KTNs9TV5xPXk1+9R62MenyDbq
jTXknpAWSFCnhlgd9bBN5E6N5mkSeGLZ1dclDGGtASzFh0o8LFYbATCtzqdl2Fyo
UCM9m0I7G+sUYMxFa7mTMDFbDlVTyZcjQyZKvNj9mpyybq5uYZaSjlRRJY8AsR0a
H3VdRxhOZu7e/6nGQfI85T0ex9Yt68Y7AhrrCLxcrBu1j6L3KhFw5QPPzj5/Jk5f
sc3eqVZ9xudHblfzmc6QVVwtdlHNj1LUHbmeWMRWVzRJahK+Q7y1CF/gGPBreEUZ
xIcM5rKDcJjoewsoiyV/l2SXFhXL5RZ7AoeUUN8sYdZu+srhl2iQFh902TdloFFt
NXzRT3JUyWhYmCyoxp+YAbJ5umL+9mmFIHgakZYyDOj19TA52xpIHyxkeOdRE3aX
obi8E/RSDSOwpIeqpDhpXiqAgc+GD3iVphqlrc9WSaGCS2PXU4Aa4ge+pCI64sWy
gB4TzZne79hchn9nlpKxLffIgvnSuYZ3klKURdaJHX82LRE+kk2jjcc+h153mGvb
f/Wytj2WVRYTX6EhJ7Ja
=oZMA
-----END PGP SIGNATURE-----

--1uSg05g7XguwjxLRjfmxFAd4g3M0j55bF--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?02ca2e5c-c604-2182-3e05-dcda3cdfb4db>