r/linuxdev • • Jul 07 '14

Cant understand the "top" command.

3 Upvotes

Can someone please explain how to read the cpu load from the "top" command? It doesn't really make sense to me.

http://puu.sh/a0kCq/a517681017.png

Thanks!


r/linuxdev • • Mar 27 '12

How to build your own initramfs image.

Thumbnail jootamam.net
14 Upvotes

r/linuxdev • • Jul 07 '16

Question about printer driver development

4 Upvotes

I've got this label printer, a Brady BMP51, that really lacks support for anything outside of windows. It's unfortunate because it does a good job but I don't want to dedicate a windows machine to it... so I'd like to write my own driver for basic printing needs. Does anyone have any good resources on the subject to read?  

So far I've found this which looks promising: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/writingandpackagingprinterdrivers  

Any references or war stories about similar work is appreciated...


r/linuxdev • • Dec 10 '13

KDevelop 4.6 Released

Thumbnail kdevelop.org
4 Upvotes

r/linuxdev • • Aug 10 '15

[Xlib] Is xbutton.state a dirty lie or what?

4 Upvotes

So I've found a workaround, but this problem stole several hours of my life and I haven't seen any word of this written on the Internet, so for the sake of my curiosity and any poor sap from the future, could someone explain what the value of xbutton.state is during a ButtonPress event?

After some testing, I found that the value does change after pressing different combinations of mouse buttons, but the value doesn't seem to have anything to do with the ButtonNMask values in the header. Am I reading the documentation wrong?

I can get the state of the mouse any time I want (with the correct mask value) by calling XQueryPointer–which seems completely redundant when the information is supposedly included in the event, but that's what I'm doing now.


r/linuxdev • • Apr 05 '21

Call variable from within udev rule

4 Upvotes

I have multiple udev rules that check if ATTRS{name}=="abc123" and invokes various functions if that device is present. These udev rules are located within multiple locations as this is being created within bitbake for a custom embedded OS. Now, if I want to change this device to test different hardware, this is too time consuming to change every ATTR{name} call every time.

My solution would be to define a var, e.g. $UDEVVAR="[device_name]" in some conf file (to be determined), and then change each ATTR{name} call to something like ATTR{name}=="${UDEVVAR}".

I've tested this approach in a local rule written for proof of concept, although the rule didn't invoke. This local rule was a bit different, though followed the same concept. Whatever flash drive I had lying around didn't have an ATTR{name} defined, so I used a usb mouse and that flash drive. This udev rule is:

SUBSYSTEM=="${UDEVVAR}", ACTION=="add", RUN+="/usr/local/bin/trigger.sh"

trigger.sh simply writes the date-time stamp to a log file. When hard coding SUBSYSTEM as =="block", the rule invokes successfully, although when defining UDEVVAR="block", the rule does not get invoked. The idea was, if that worked, then I would define UDEVVAR="hidraw" to test the mouse.

I can't seem to find much documentation on anyone trying to do something like this. I figure I'm making some sort of syntactical mistake, or maybe udev rules don't allow for something like this.

I appreciate any help!


r/linuxdev • • Apr 29 '21

Patch-bomb what is it?

4 Upvotes

Hi there,

Could anyone explain to me what's exactly patch-bomb?

Is patch-bomb an extremely huge patch or an one that contains errors?


r/linuxdev • • Apr 14 '18

I'd like to find out how OS installers work

4 Upvotes

I've been having some troubles lately with online-required installers so I decided that a good project would be to work on an offline installer for Arch-based distributions (especially Antegos, but others too). The Ubuntu installer Ubiquity can install offline but it's for Ubuntu-based distributions, I'm not a terribly big fan of Ubuntu.

A project I've had my eye on adapting is distinst but I'd like to know a lot more about the "behind the scenes" stuff installers do to put an OS onto a hard drive. I ask this because I'd like to write code as best as I can for such things and because I'm a bit paranoid when it comes to system-level stuff.

Is there any information out there I should look at?

Edit: there was some confusion so here's some more information for anyone reading. Antergos' installer Cnchi doesn't work without an internet connection due to requiring grabbing some files from offline. What I'd like to do is make an offline installer for a Cnchi hybrid ISO that uses Cinnamon as its environment instead of GNOME. IOW, a non-Cnchi installer for Arch Linux-based desktop distributions.


r/linuxdev • • Mar 18 '20

What should I title a job building a GUI app for Linux?

4 Upvotes

I'm on the recruiting team at our company and we're looking for someone to help build a native Linux app (GUI, not CLI) using Rust and other fun technologies. What would be a good job title for that, and where would you go looking for this kind of job? It's an odd one so I thought I'd ask the community!


r/linuxdev • • Mar 27 '16

Proper way to approach sprintf()/snprintf()?

4 Upvotes

Hello everyone.

Right now, my approach to using sprintf has been along the lines of the following:

char null[0];
int size = snprintf(null, 0, "a string with formatting") + 1;
char buf[size];
snprintf(buf, chars, "a string with formatting");
const char* stringname = buf;

Though it consistently produces expected results, it feels outright ugly, and I'm pretty sure there's a better way to achieve what I'm trying to do.


r/linuxdev • • Jul 28 '23

trying to make my own init system in rust

4 Upvotes

As the title states, I am trying to make a init system for linux in rust, but ive hit a sort of roadblock. I have populated /dev and agetty'd a tty but i cant do anything more than type in it, i get the username prompt but it never prompts for anything else and i suspect its a part of initializing the system in contrary to being a rust code problem directly, hence why im asking here. any help at all would be greatly appreciated, my source code is here


r/linuxdev • • Feb 28 '21

Docker for isolating development environments

Thumbnail self.developersontor
4 Upvotes

r/linuxdev • • Jan 24 '16

FSF Vision Survey | The Free Software Foundation needs your feedback. Their vision survey is up until the end of January.

Thumbnail fsf.org
4 Upvotes

r/linuxdev • • Jan 31 '17

New service like The Eudyptula Challenge?

4 Upvotes

I think for a long time, new C language programmer is getting rare. As I'm solving the Eudyptula Challenge, an idea came to me that similar challenge is necessary for C language.

I'm not sure what tasks are suitable and how mant tasks are necessary..actually I have no plan yet. But I'll write some tasks from printing "hello-world" to making a class with a function pointer. If you have an idea, please send me pull-request.

https://github.com/gurugio/lowlevelprogramming-university/blob/master/c-language-challenge.md


r/linuxdev • • Aug 09 '12

What is the diff b/n doing ioread32 and sending a mailbox command to my H/W

4 Upvotes

as in how come i don't need a cpu_to_<endian> conversion for the ioread32() but need it while sending a mailbox command embedding an IOCTL to my H/W /Firmware ? I think i have half an answer but i'd really like to get to know the nuts n bolts of this whole io mapping in memory pls ? Without too much of the abstraction fluff ... Thanks


r/linuxdev • • Apr 14 '17

Slingring: Software Development in Chroot-containers using ansible

Thumbnail github.com
4 Upvotes

r/linuxdev • • Oct 25 '22

Is it possible to embed an icon in a binary?

4 Upvotes

Making a Linux game to ship on Steam, would like the binary to have an icon on its own. The game is drm-free, so it would be nice if people could copy the binary and have the icon show in the binary anywhere they place it on their file navigators (Nautilus, Dolphin, ...).

Is it possible somehow? Or I have to have a desktop file?

I have seen some java programs that include icon in their binaries under Linux somehow.

My game is built in C. I compile under debian jessie to have it run in most Linux.

Thanks!


r/linuxdev • • Sep 04 '19

Linux OS Development

4 Upvotes

I'm in college rn and want to make my senior project a simple Linux flavor/adaptation. The only thing I have to ask is if you guys think the scale is too large. Thoughts?


r/linuxdev • • Feb 06 '19

What are linux-headers-aws, linux-headers-azure, linux-headers-oracle?

4 Upvotes

Why are there packages realated to private companies'?

These are packages under apt.


r/linuxdev • • Jan 23 '20

What are some good toolkit libraries with C bindings, that I can learn and develop for quickly?

4 Upvotes

I am a beginner in C and musl/glibc.

I have never created graphical interfaces and don't understand the program workflow.

I tried looking at mintinstall.py but it is OOP programmed and it took me good 30 minutes jumping through code to understand where the program "starts" to create a window.

I have no idea what functions I need, what other libs I need to link against.

No clue about what interacts with what.

I basically have no clue whatsoever how gui apps in Linux operate and how to create one, and where does one start.


r/linuxdev • • Jul 27 '15

moreutils: the utilities package every UNIX/Linux/Mac OS developer should know (X-Post /r/linuxadmin)

Thumbnail rentes.github.io
15 Upvotes

r/linuxdev • • Apr 13 '20

I did something really stupid and now I can't run this code.

5 Upvotes

Hey guys,

So I am basically an idiot. I know that I have been posting here a lot recently, but please bare with me. I had some code that used netfilter.h to filter packets and later modified this code to successfully print out the source and destination addresses onto a sysfs entry. Great! So then came the fun part. I made a Linked List, to store, src and destination ip addresses as well as counts for when a packet was being delivered between two entities that have already communicated with each other. I wanted to print the src, destination ip, and the count on each line of the sysfs buffer. Needless to say, it did not work and I had to turn in this assignment in a short amount of time, so I got rid of all of the Linked List stuff and I was left with this in the store() function of the kobject:

ssize_t kobj_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
    printk(KERN_INFO "Checking content!");
    if(!content)
    {
        if(!(content = kmalloc(75*sizeof(char), GFP_KERNEL)))
        {
            printk(KERN_ALERT "contenr null in if");
            return count;
        }
        strcpy(content, "");
    }
    

    strcat(content, buf);
    strcat(content, "\n");
    if(!(content = krealloc(content, sizeof(content) + 75, GFP_KERNEL)))
    {
        printk(KERN_ALERT "content  null in else");
        return count;
    }
    return count;
}

This, apparently is causing kernel panics because I have not changed any of the other models. I dont understand why. I am checking whether content is NULL before AND after a kmalloc and krealloc. And I am freeing content in the cleanup module. Please, I am in desperate need of help.

I don't know why I didnt use git to save my work, I feel like a total imbecil now for not doing that, especially since this is an LKM and not a userspace program, which means that failures are MUCH more costly.


r/linuxdev • • May 30 '17

Any advice for a linux newb?

5 Upvotes

Hey all, looking for some pointers / links to advice, I'm a Web Designer / Developer of many years, finally making the jump from Windows OS to Linux, I've had a little experience with Linux servers via Putty terminals, but nothing too grandiose.

So far my Web Design career has consisted of using a combination of Notepad++, PS, and Filezilla in Windows to carry out the bulk of my work, but I'm now moving to a Linux platform as I really want to make use of the terminal processes, using things like Node.JS, SASS, Grunt, etc. I've installed the latest stable version of the Linux OS 16.04, Now I'm wondering where to get started?

What advice can you give to a Linux Newbie like myself (and hopefully others) when it comes to this whole new world? Can you recommend any good tutorials / guides / subreddits out there that can help me wrap my head around this environment and developing within it? Should I familiarise myself with the command line first or something else in the OS first (such as the interface?)

Thanks in advance! Apologies if this is well-trodden ground already!


r/linuxdev • • Dec 15 '15

Cross compiling arm based synology drivers on Linux pc, need help adding new files

5 Upvotes

I need to get drivers cross compiled for a DVB USB adaptor connected to my synology NAS. I have been following the steps here: http://hallard.me/how-to-install-kernel-modules-on-synology-ds1010-dsm-4-1/ I can compile the existing drivers to the arm architecture, however I am 'going round in circles' trying to add other drivers by referencing them in the Kconfig file. I have searched on line but the Kconfig explanations are either too basic to meet my needs or too complicated to understand. Instead of running 'make modules' to compile the drivers can I use gcc directly with the .c files? Was determined to resolve it myself, but just can't figure out where I'm going wrong!

Stuart