Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jun 2022 15:38:48 -0500
From:      Jake Freeland <jake@technologyfriends.net>
To:        freebsd-hackers@freebsd.org, Mark Johnston <markj@freebsd.org>
Subject:   LinuxKPI debugfs Port
Message-ID:  <CAOgZAGaQOhxS0oeM-797fHy3Zs1D4A=hnS3uVYqKnzw4HWn8CA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--000000000000b34a5105e2880661
Content-Type: text/plain; charset="UTF-8"

Hi there,

I am working on porting Intel's igt-gpu-tools drm graphics driver testing
suite to FreeBSD and I ran into some issues regarding debugfs. I spoke
to manu@ who told me that CONFIG_DEBUG_FS is required for the
testing to work properly. I started working on a debugfs port and quickly
got confused about what manu@ meant by implementing "CONFIG_DEBUG_FS".

Some quick internet searching says that CONFIG_DEBUG_FS is a
Linux kernel configuration flag. I am curious how I would go about
implementing this into FreeBSD. I copied the Linux debugfs source
code into a new repository and attempted to compile it on FreeBSD
as a kernel module:

https://github.com/jakesfreeland/debugfs-freebsd

Of course I was met with many, many incompatibility errors. I proceeded
to copy the required `sys/compat/linuxkpi/common/include/linux` headers
into my repository and I was met with two options:

1. continue modifying the LinuxKPI headers and commit my modifications
to src.

2. re-engineer the debugfs source code to comply with the preexisting
LinuxKPI headers.

Many problems come with both approaches. First, if I modify the LinuxKPI
headers, I'd be "copying" over some code from Linux's GPLv2 headers.
I do not know how much I can "copy" before legal issues arise. Second,
if I re-engineer the debugfs source code, I am revolting against what
LinuxKPI
stands for: running Linux code with little-to-no modification. I don't know
what the correct approach is here.

I also discovered that lindebugfs, a curtailed version of Linux's debugfs,
already exists in FreeBSD's src. I am led to believe that this is
exclusively
used under the Linuxulator so it wouldn't help me. Is this correct?

Thank you so much,
Jake Freeland

--000000000000b34a5105e2880661
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi there,<br><div><br></div><div>I am working on porting I=
ntel&#39;s igt-gpu-tools drm graphics driver testing</div><div>suite to Fre=
eBSD and I ran into some issues regarding debugfs. I spoke</div><div>to man=
u@ who told me that CONFIG_DEBUG_FS is required for the</div><div>testing t=
o work properly. I started working on a debugfs port and quickly</div><div>=
got confused about what manu@ meant by implementing=C2=A0&quot;CONFIG_DEBUG=
_FS&quot;.</div><div><br></div><div>Some quick internet searching says that=
 CONFIG_DEBUG_FS is a</div><div>Linux kernel configuration flag. I am curio=
us how I would go about</div><div>implementing=C2=A0this into FreeBSD. I co=
pied the Linux debugfs source</div><div>code into a new repository and atte=
mpted to compile it on FreeBSD</div><div>as a kernel module:</div><div><br>=
</div><div><a href=3D"https://github.com/jakesfreeland/debugfs-freebsd">htt=
ps://github.com/jakesfreeland/debugfs-freebsd</a><br></div><div><br></div><=
div>Of course I was met with many, many incompatibility=C2=A0errors. I proc=
eeded</div><div>to copy the required `sys/compat/linuxkpi/common/include/li=
nux` headers</div><div>into my repository and I was met with two options:</=
div><div><br></div><div>1. continue modifying the LinuxKPI headers and comm=
it my modifications</div><div>to src.</div><div><br></div><div>2. re-engine=
er the debugfs source code to comply with the preexisting</div><div>LinuxKP=
I headers.</div><div><br></div><div>Many problems come with both approaches=
. First, if I modify the LinuxKPI</div><div>headers, I&#39;d be &quot;copyi=
ng&quot; over some code from Linux&#39;s GPLv2 headers.</div><div>I do not =
know how much I can &quot;copy&quot; before legal issues arise. Second,</di=
v><div>if I re-engineer the debugfs source code, I am revolting against wha=
t LinuxKPI</div><div>stands for: running Linux code with little-to-no modif=
ication. I don&#39;t know</div><div>what the correct approach is here.</div=
><div><br></div><div>I also discovered that lindebugfs, a curtailed version=
 of Linux&#39;s debugfs,</div><div>already exists in FreeBSD&#39;s src. I a=
m led to believe=C2=A0that this is exclusively</div><div>used under the Lin=
uxulator so it wouldn&#39;t help me. Is this correct?</div><div><br></div><=
div>Thank you so much,</div><div>Jake Freeland</div></div>

--000000000000b34a5105e2880661--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOgZAGaQOhxS0oeM-797fHy3Zs1D4A=hnS3uVYqKnzw4HWn8CA>