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>

index | next in thread | raw e-mail

[-- Attachment #1 --]
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

[-- Attachment #2 --]
<div dir="ltr">Hi there,<br><div><br></div><div>I am working on porting Intel&#39;s igt-gpu-tools drm graphics driver testing</div><div>suite to FreeBSD and I ran into some issues regarding debugfs. I spoke</div><div>to manu@ who told me that CONFIG_DEBUG_FS is required for the</div><div>testing to work properly. I started working on a debugfs port and quickly</div><div>got confused about what manu@ meant by implementing &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 curious how I would go about</div><div>implementing this into FreeBSD. I copied the Linux debugfs source</div><div>code into a new repository and attempted to compile it on FreeBSD</div><div>as a kernel module:</div><div><br></div><div><a href="https://github.com/jakesfreeland/debugfs-freebsd">https://github.com/jakesfreeland/debugfs-freebsd</a><br></div><div><br></div><div>Of course I was met with many, many incompatibility errors. I proceeded</div><div>to copy the required `sys/compat/linuxkpi/common/include/linux` 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 commit my modifications</div><div>to src.</div><div><br></div><div>2. re-engineer the debugfs source code to comply with the preexisting</div><div>LinuxKPI 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;copying&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,</div><div>if I re-engineer the debugfs source code, I am revolting against what LinuxKPI</div><div>stands for: running Linux code with little-to-no modification. 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 am led to believe that this is exclusively</div><div>used under the Linuxulator 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>
help

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