this is assuming it is correct infos there (about the gpl license, and it being intree). that this is not been honestly mistaken. and it assumes rigol respects the terms of the linux kernel, and the terms of the gpl license?
Correct. And I would say they will send you the code.
They sent all the GPL code for the MSO5000 to @Olliver. And he has it on his Github page...
As long as you have experience in Linux driver development, find a .ko driver template and implement the following functions:
gpio_hdcode_drv_open
gpio_hdcode_drv_ioctl
gpio_hdcode_drv_read
gpio_hdcode_init
gpio_hdcode_exit
And refactor and modify the gpio_hdcode_drv_read function, the following is the important location source code of hdcode_gpio.ko:
ssize_t __fastcall gpio_hdcode_drv_read(file *file, unsigned __int8 *buf, size_t len, loff_t *f_pos)
{
size_t v5; // x19
__int64 v6; // x0
int v7; // w20
__int64 v8; // x0
int v9; // w20
__int64 v10; // x0
__int64 v11; // x0
unsigned __int64 v12; // x1
bool v13; // cc
__int64 v15; // x0
_BYTE v17[4]; // [xsp+33h] [xbp+33h] BYREF
v5 = len;
v6 = ((__int64 (__fastcall *)(__int64, unsigned __int8 *, size_t, loff_t *))gpio_to_desc)(4LL, buf, len, f_pos);
v7 = ((__int64 (__fastcall *)(__int64))gpiod_get_raw_value)(v6) & 1;
v8 = ((__int64 (__fastcall *)(__int64))gpio_to_desc)(8LL);
v9 = v7 & 0xFFFFFFFD | (2 * (((__int64 (__fastcall *)(__int64))gpiod_get_raw_value)(v8) & 1));
v10 = ((__int64 (__fastcall *)(__int64))gpio_to_desc)(11LL);
LOBYTE(v9) = v9 & 0xFB | (4 * (((__int64 (__fastcall *)(__int64))gpiod_get_raw_value)(v10) & 1));
v11 = ((__int64 (__fastcall *)(__int64))gpio_to_desc)(12LL);
v17[0] = v9 & 0xF7 | (8 * (((__int64 (__fastcall *)(__int64))gpiod_get_raw_value)(v11) & 1));
v12 = *(_QWORD *)(_ReadStatusReg(ARM64_SYSREG(3, 0, 4, 1, 0)) + 8);
if ( __CFADD__(buf, v5) )
v13 = 1;
else
v13 = (unsigned __int64)&buf[v5] > v12;
if ( !v13 )
{
((void (__fastcall *)(_BYTE *, size_t, __int64))_check_object_size)(v17, v5, 1LL);
v15 = ((__int64 (__fastcall *)(unsigned __int8 *, _BYTE *, size_t))_arch_copy_to_user)(buf, v17, v5);
}
else
{
v15 = v5;
}
if ( v15 )
{
v5 = -14LL;
((void (__fastcall *)(const char *))printk)("copy failed\n");
}
return v5;
}