* [9front] Debugging driver/kernel space
@ 2025-04-05 16:38 Sebastian Gsänger
2025-04-05 17:05 ` adventures in9
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gsänger @ 2025-04-05 16:38 UTC (permalink / raw)
To: 9front
Hi,
I'm trying to control a ws2812 led Hat via RPi GPIO pins using dma/pwm
(as done here: https://github.com/jgarff/rpi_ws281x).
This requires accessing RPi peripherals, i.e. writing to physical addresses.
My current plan is to write a driver similar to bcm/gpio.c and
bcm/devgpio.c.
Is there a way to have better debug cycle than recompile->reboot->hope
it works?
Any way to attach a debugger to kernel code, or even run code with
access to the registers from within a running system?
Thanks
Sebastian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9front] Debugging driver/kernel space
2025-04-05 16:38 [9front] Debugging driver/kernel space Sebastian Gsänger
@ 2025-04-05 17:05 ` adventures in9
2025-04-05 18:32 ` Sebastian Gsänger
0 siblings, 1 reply; 3+ messages in thread
From: adventures in9 @ 2025-04-05 17:05 UTC (permalink / raw)
To: 9front
There is an option to setup an "arch" filesystem. It shows up kernel
device '#P'.
It is used on amd64 to do things like read the cpu temperature or
check irq settings. You can make a synthetic file that does pretty
much anything though, like read or write to some particular memory
address for IO on peripherals.
https://github.com/driusan/9front-A64/blob/main/devarch.c
This has some examples of setting up files to do debugging stuff on a
Pinephone, like read the cpu temp, set the cpu clock speed, check all
the interrupts, read from various gpio like pins.
On Sat, Apr 5, 2025 at 9:44 AM Sebastian Gsänger
<sebastian_gsaenger@web.de> wrote:
>
> Hi,
>
> I'm trying to control a ws2812 led Hat via RPi GPIO pins using dma/pwm
> (as done here: https://github.com/jgarff/rpi_ws281x).
> This requires accessing RPi peripherals, i.e. writing to physical addresses.
>
> My current plan is to write a driver similar to bcm/gpio.c and
> bcm/devgpio.c.
> Is there a way to have better debug cycle than recompile->reboot->hope
> it works?
> Any way to attach a debugger to kernel code, or even run code with
> access to the registers from within a running system?
>
> Thanks
> Sebastian
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9front] Debugging driver/kernel space
2025-04-05 17:05 ` adventures in9
@ 2025-04-05 18:32 ` Sebastian Gsänger
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Gsänger @ 2025-04-05 18:32 UTC (permalink / raw)
To: 9front
Thanks, looks like an interesting entry point for my first steps!
On 4/5/25 7:05 PM, adventures in9 wrote:
> There is an option to setup an "arch" filesystem. It shows up kernel
> device '#P'.
>
> It is used on amd64 to do things like read the cpu temperature or
> check irq settings. You can make a synthetic file that does pretty
> much anything though, like read or write to some particular memory
> address for IO on peripherals.
>
> https://github.com/driusan/9front-A64/blob/main/devarch.c
>
> This has some examples of setting up files to do debugging stuff on a
> Pinephone, like read the cpu temp, set the cpu clock speed, check all
> the interrupts, read from various gpio like pins.
>
> On Sat, Apr 5, 2025 at 9:44 AM Sebastian Gsänger
> <sebastian_gsaenger@web.de> wrote:
>> Hi,
>>
>> I'm trying to control a ws2812 led Hat via RPi GPIO pins using dma/pwm
>> (as done here: https://github.com/jgarff/rpi_ws281x).
>> This requires accessing RPi peripherals, i.e. writing to physical addresses.
>>
>> My current plan is to write a driver similar to bcm/gpio.c and
>> bcm/devgpio.c.
>> Is there a way to have better debug cycle than recompile->reboot->hope
>> it works?
>> Any way to attach a debugger to kernel code, or even run code with
>> access to the registers from within a running system?
>>
>> Thanks
>> Sebastian
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-05 18:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-05 16:38 [9front] Debugging driver/kernel space Sebastian Gsänger
2025-04-05 17:05 ` adventures in9
2025-04-05 18:32 ` Sebastian Gsänger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).