r/LinuxProgramming • u/Logical-Ad1417 • Dec 27 '24
How to create tthis prog_firehose_sdx6x.elf?
Hi!
I am new and wanted to read prog_firehose_sdx6x.elf from a Netgear MR6450 how to do this and whats the best Linux for such things?
Thanks
Klaus
r/LinuxProgramming • u/Logical-Ad1417 • Dec 27 '24
Hi!
I am new and wanted to read prog_firehose_sdx6x.elf from a Netgear MR6450 how to do this and whats the best Linux for such things?
Thanks
Klaus
r/LinuxProgramming • u/hwc • Nov 24 '24
I'm thinking of buying an inexpensive Chromebook that is currently on sale to use for basic Linux programming. I normally use vim as an IDE, so I really don't need much in the way of power. I just need to compile Go, C, and C++ projects and use git and ssh. Would I find any serious limitations compared to a "real" Linux distribution?
Also, has anyone had success installing Steam games on a Chromebook?
r/LinuxProgramming • u/OurRoadLessTraveled • Nov 05 '24
Here is a script I have uploaded to the Cerbo-GX running version 3.51. It does not seem to work. I am trying to pull GPS data from a peplink router via WIFI, that has the ability to forward GPS data to an IP address. When I run the script on the Cerbo via Putty I get an error saying:
Last login: Tue Nov 5 22:02:59 2024 from 192.168.20.114
root@einstein:~# /data/etc/gps.sh
2024/11/05 22:27:30 socat[7514] E connect(5, AF=2 192.168.20.1:10000, 16): Connection refused
000.000 ERR.serial: could not open com-port
can you tell me if it is possible to do what I am trying? Local dealers are no help at all.
***********************************************************************************************************************************************************************************************************************************
nano /data/etc/gps.sh
#!/bin/bash
# IP address and port of the external GPS source
GPS_IP="192.168.20.1"
GPS_PORT="10000"
# Virtual serial port linked to the GPS data
VIRTUAL_PORT="/dev/ttyGPS"
# Start socat to connect to the GPS source and link it to the virtual serial port
/usr/bin/socat tcp-connect:${GPS_IP}:${GPS_PORT} pty,link=${VIRTUAL_PORT},raw,nonblock,b115200 &
# Check if gps_dbus is running; if not, start it and point it to the virtual port
while [ `ps | grep gps_dbus | grep -v grep | wc -l` -eq 0 ]
do
sleep 1
/opt/victronenergy/gps-dbus/gps_dbus -s ${VIRTUAL_PORT} -b 115200 -t 0 &
done
echo "GPS information is being pulled from ${GPS_IP}:${GPS_PORT} and forwarded to ${VIRTUAL_PORT}"
chmod +x /data/etc/gps.sh
nano /data/rc.local
sh /data/etc/gps.sh
chmod +x /data/rc.local
r/LinuxProgramming • u/MajorMalfunction44 • Sep 10 '24
I'm trying to get device names like "default" and "pulse", but I get the manufacturer's device name instead. snd_card_next() enumerates sound cards, but I'm not sure how to get device strings I can feed to snd_pcm_open().
r/LinuxProgramming • u/bore530 • Jun 09 '24
This is what I have so far:
#define NPAW_BUILD
#include <paw/libexec.h>
#ifdef CAUGHT_OS_WAS_api_msw
# include <windows.h>
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
switch ( fdwReason ) {
case DLL_PROCESS_ATTACH: return (pawlib_pid_attach() == 0) ? TRUE : FALSE;
case DLL_PROCESS_DETACH: pawlib_pid_detach(); break;
case DLL_THREAD_ATTACH: return (pawlib_tid_attach() == 0) ? TRUE : FALSE;
case DLL_THREAD_DETACH: pawlib_tid_detach(); break;
default: return FALSE;
}
return TRUE;
}
#else
/* I'll check later if this is right */
static void libdetach(void) __attribute__((destructor))
{
if ( getpid() == gettid() )
pawlib_pid_detach();
else
pawlib_tid_detach();
}
#if 0
/* Not sure if this would work out */
static void libsig( int sig )
{
switch ( sig )
{
case SIGABRT: pawlib_tid_detach(); break;
}
}
#endif
static void libattach(void) __attribute__((constructor))
{
//signal(SIGABRT,libsig);
if ( getpid() == gettid() )
{
if ( pawlib_pid_attach() < 0 )
exit(EXIT_FAILURE);
}
else
{
if ( pawlib_tid_attach() < 0 )
exit(EXIT_FAILURE);
}
}
#endifr/LinuxProgramming • u/bore530 • Feb 24 '24
I'm considering resolving a problem with semget, semop & semctl but I need to know which systems don't/didn't support it in general. I figure if I'm going to check that then I might as look for a website the lists the support of linux/unix/etc function groups so that I don't end up coming back here every time I find something useful to wrap an need to check if I need to provide an #else case to it
Edit: For an example of what kind of table I mean, here's one for CSS:
r/LinuxProgramming • u/bore530 • Feb 23 '24
Here's a rough sample of what I want to do:
#ifdef _WIN32
typedef HANDLE sem;
#define INVALID_SEM NULL
inline int initsem( sem *s ) { *s = CreateSemaphore(...); return *s ? 0 : -1; }
...
#else
typedef sem_t sem;
#define INVALID_SEM ...
inline int initsem( sem *s ) { return sem_init(s); }
...
#endif
sem global_sem = INVALID_SEM;
int main(...) { ... initsem(&sem); }How would I go about defining INVALID_SEM so that it can be used like in the example? I would rather use a define given by semaphore.h than assume it's an object, integer, etc.
r/LinuxProgramming • u/AccurateDemand3230 • Feb 17 '24
I'm looking for examples of real-world machine code that could be used as bechmarks for some research work. This could be, for instance, snippets of C code where the programmer inlines some assembly to gain greater control of the system, eg when working with peripherals. Extra points if it's critical code that's prone to being buggy OR hard to show to be correct with just model checkers or any automatic proof tools.
Does anyone know of any samples in the public domain, perhaps bug-reporting websites or anywhere else where I might find this?
Thanks
r/LinuxProgramming • u/Zdrobot • Mar 15 '23
I'm wondering if the signal handler function you register with
signal (SIGINT, termination_handler);called from another thread, which is created silently for the process when a signal is received? Is it something else?
You see, my main thread spends most of its runtime in a call to a blocking function, amqp_consume_message(), which means the signal handler can't be called in the context of the main thread. Is the context in which the handler is called described anywhere?
Any pointers are welcome.
r/LinuxProgramming • u/robert9804 • Jan 15 '23
For some reason I keep getting this error when I try to run my "make" file
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0
You are using: gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0
what I tried is changing the kernal version but that didn't make a difference.
r/LinuxProgramming • u/89veqd • Oct 15 '22
Trying to run "make" to compile wifi driver:
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.0.0-060000-generic/build M=/media/user/Lubuntu_22.04.1_LTS_amd64/rtl8723du modules
make[1]: Entering directory '/usr/src/linux-headers-6.0.0-060000-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0
You are using: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
I upgraded kernel to 6.0, hoping maybe it will support the Wifi chip, but it doesn't.
So now I am trying to compile it myself. I was able to compile before I made the upgrade to kernel 6.0.
How do I tell "make" to use the new gcc v12.2 instead of the default v11.2?
r/LinuxProgramming • u/alsecc • Aug 30 '22
Hi,
I want to load a shared object to certain processes, there are certain conditions that are required
loading to only specific processes and not all of them
it has to be done before the process code starts executing
the processes are not mine
What are the available ways to support this functionality on Linux?
Can it be accomplished with "/etc/ld.so.preload" or "LD_PRELOAD=/my/lib.so"? Is a kernel module needed for this?
Any help would be appreciated
Thanks!
r/LinuxProgramming • u/JanGadsden • Jun 24 '22
I work on a project which a hardware product that runs a Linux OS with custom server side software. Currently, we have a lot of legacy C code base that is glued together either with linker shenanigans or loosely coupled bash scripts. There are several cons of this solution/current architecture:
* There are many small programs written in C that do not reuse each other's code
* Its old C code base which requires a tremendous effort to maintain and God forbid develop a new feature for an existing program
* Because the programs are written in C they can span thousands of lines of code just to do something that would take a maximum of a few hundred in a more high-level programming language. The actions that most of those programs perform are operations on files, system components like drives/partitions, etc, and typical systems programming
I plan to introduce a higher-level language to take care of such programs. Im considering things like Python, Perl, Lua, Go, etc. But I do not have extensive experience with all of them. My team has quite a lot of experience with Python but given that the project itself has to be easily maintainable for a long term (even up to 10 years) we really want to use a language that will not change much in this period which basically already excludes Python as even fairly new language releases are not being supported.
Thus there are several things we would like our perfect language to be able to do:
* Be able to work with/alongside C/C++
* Be testable. Have some built-in or easily added testing framework just like Pythons Pytest, and maybe additionally be able to test C code if that's even a thing
* Be long-term stable and maintainable
* Have good ongoing and future support
* Be easy to learn and pretty generic
* Capable of performing systems programing
* Be as light-weight as possible, we cannot allow ourselves to have a 500meg runtime
* Have a good ecosystem that supplies the developer with tooling during the development e.g. linters, formatters, packaging etc
I would really like to know your advice on which language we should choose
r/LinuxProgramming • u/[deleted] • Jun 02 '22
nutty abounding violet weather screw stupendous plant sand bedroom squeal
This post was mass deleted and anonymized with Redact
r/LinuxProgramming • u/maxatron1883 • Mar 24 '22
I’m needing some help on what language I should start learning since I’m gonna be making stuff that runs on Linux. Or even if you can point me in the direction of any useful sdk I should look into downloading.
r/LinuxProgramming • u/[deleted] • Mar 17 '22
I like Linux file managers (PcManFm, Thunar, Nemo, Caja...) and I would like to use one of these on Windows with fully functional (sftp, etc....). I know there is Dolphin Windows port but it has some bugs.
r/LinuxProgramming • u/[deleted] • Mar 12 '22
r/LinuxProgramming • u/JoeyXANDEM • Feb 01 '22
Hello all, I'm looking for a consultant who could help me on an application I'm working on. Specifically, I need someone who knows the embedded Linux graphics stack fairly well. My project calls for low-latency video capture of an HDMI input, low-latency display of the capture, while adding some simple overlays.
My thought is that I will set up the capture card to directly write to the memory of the output frame buffer, and then add in the overlay in (hopefully) a separate buffer.
If you have experience in this field and can help me for a few hours, I'll gladly pay a solid rate to make it worth your time. I only need a few hours so it won't derail you from your day job. :)
Message me if interested please! Thanks.
r/LinuxProgramming • u/[deleted] • Dec 23 '21
I was wondering how I would deploy a Qt application made on my PC to a Raspberry Pi. Every tutorial I’ve found so far shows me how to install Qt Creator on Raspberry Pi which is not what I’m looking for. Help would be much appreciated.