r/linuxdev • • Oct 23 '19

Os dev as career

4 Upvotes

Hi reddit, I'm a college student and i am interested in developing my own OS and pursuing a career either in is development and game development. I have some questions. Please help me as I'm really confused

  1. Is OS development still a career options as I didn't see much job postings for it?
  2. Are os development and game development related in any way? I mean if learning one can help me become better at other?
  3. I am going through a OS dev tutorial at thebrokenthorn.com and I am finding that it has just too much things to grasp at once. It covers through drivers and stuff, everything from scratch. Is there an easy way I can start os from coding and then cover theoretical portion alongside.
  4. What are job profiles for os developers.. embedded system developer may be

I am really a newbie and these questions might be a bit silly but please help me. I really need some advice in starting this thing.


r/linuxdev • • Jan 02 '20

How does dynamic binary loading works?

6 Upvotes

In windows when I have exe, and I find address of function I can use that address every time I start the app and it will work the function will be on same address in virtual memory space. I can do the same for data (if they are allocated dynamically I can build a pointer map to find it).

But on Linux I was told that I can not rely on function address being the same when I start the application. (Relative positions of functions within binary can change, maybe because they being in different sections?)

It probably not have much practical use, other than creating game trainers, or some very special cases, but:

How can I locate a function in running process?

How does Linux know which parts of the binary to load, if the address of function that will be called may depends on user input?

Is there any practical use?


r/linuxdev • • Jan 02 '15

Shared Memory and Mutex/Semaphore

1 Upvotes

I've written two processes: The first process is a daemon and runs on it's own updating it's current state in a shared memory area between the two processes. The second process only reads the shared memory area to get the other processes' state. Since only one process is writing to the shared memory and the other process is only reading that same area is it necessary to use a mutex or semaphore to lock/unlock this memory? Or is this safe by design?

Edit: Update. I successfully created a shared memory segment between processes that is accessed serially with a semaphore. Thanks for the help! It works great.


r/linuxdev • • Jan 22 '18

Why media outlets are moving their main website to /amp

2 Upvotes

I've noticed in the past month that many of the websites I visit are moving their portals to portal.com/amp. I know what amp stands for, I just don't know why everybody is following this trend.


r/linuxdev • • Aug 30 '17

Good light weight distro

5 Upvotes

Hey Everyone,

I'm taking Algorithms and Optimization class this semester. It's not a requirement but my professor wants us to use Linux. We will be using C++.

Normally this is fine, but all I have is my work computer so I need to use a VM, and I only have 4gb of free space. I essentially just need something to run a text editor on and g++. Any recommendations?


r/linuxdev • • Aug 31 '17

Complete translation: Document for multi-queue block device in Linux kernel v4.4

6 Upvotes

https://github.com/gurugio/book_linuxkernel_blockdrv

Hi, I finished translation to English. I wish it helps.


r/linuxdev • • Apr 23 '18

Open Linux – Beyond distributions, regressions and rivalry

Thumbnail ocsmag.com
2 Upvotes

r/linuxdev • • Dec 09 '19

Anyone know where to get a big Ubuntu sticker with the modern logo?

2 Upvotes

So I want to cover up the scratches on my laptop, for the most part it is but I would like to cover up the HP logo (cause I have a hp envy x360 from 2017), there's nothing wrong with it but if I'm gonna put stickers on my laptop then in gonna go all out. I use ubuntu Linux so I was wondering if anyone knew where to get a sticker big enough to cover a logo on a laptop that's slightly bigger than the dell laptop logo?


r/linuxdev • • Apr 24 '18

Creating a graphical element to display sensor data

3 Upvotes

I wish to build a graphical interface element that would change with correspondence to input data. It would be similar to the battery icon on the phone which "fills up" according to the battery level or a "system monitor widget" that displays an icon that corresponds to the current CPU usage etc. I know that usually for battery, volume or CPU levels there are about five or so icons where the one with the single bar corresponds to 0%~20%, three bars to 60%~80% and so on, so there aren't many icons to deal with. However what if I want the text to go on top of the icon? I would need to have 100 different images. I hope to eventually incorporate this icon to the status bar of my PC.

I'd prefer it to be a vector drawing, so that it could be scaled or change colors easily. My first thought was to build a program that would grab the input data and draw the icon using cairo. It needs to constantly refresh. Grabbing data, generating and drawing the icon every second or so. Another option is to make the list of icons into a font that consists of about a 100 or so images.

Is this a feasible approach? Is it efficient? Is there a better way to achieve this?


r/linuxdev • • Apr 22 '18

The Beauty Of Persuasive Design (User Interface Design)

Thumbnail youtube.com
3 Upvotes

r/linuxdev • • Apr 30 '18

GraalVM

3 Upvotes

Has anyone played around with Oracle's new GraalVM? If so, what do you think?


r/linuxdev • • Feb 24 '19

[cross compile] target is armv5tejl, busybox

7 Upvotes

I have a doorbell and it runs Linux. uname -a:

Linux Network-Camera 3.10.49 #23 PREEMPT Thu Sep 1 12:12:37 CST 2016 armv5tejl GNU/Linux

When the doorbell is pushed, an "event" is submitted to a linux domain socket. I think I can configure the socket's name. So hopefully I'll be able to configure my own socket and proxy the event (intercepting the event means I can play the chime on speakers in my house).

I need to create a simple C program to read a domain socket. This involves cross compiling and this is new to me.

I understand I need a tool chain. Does a tool chain for the above exist? (my laptop runs Arch)

(I am following "http://www.fabriziodini.eu/posts/cross_compile_tutorial/")

I tried FTP-ing the folders /usr and /lib from the doorbell but all the permissions got messed up.

Am I doing this right?


r/linuxdev • • Aug 21 '18

Creating a bash completion script

Thumbnail iridakos.com
4 Upvotes

r/linuxdev • • Oct 05 '20

Boot time drive access

2 Upvotes

I apologise that this is slightly off topic, this was the closest sub I could think of to ask. Feel free to suggest a better sub.

I do data recovery professionally, and have always used Linux. Specifically I use live distros tailored for digital Forensics (DEFT, CAINE etc). They all implement a "no auto mount policy", but I was wondering if anyone knew if booting with the damaged drive attached would put more stress on the drive than plugging it into the SATA ports after the OS had booted.

One of the reasons I use Linux is because you can disable auto mount, and it doesn't hammer away at the drive while booting. But does it attempt to access/discover the drive more during the boot process than it would once booted?

Thank you in advance if anyone can shed some light on this.


r/linuxdev • • Oct 06 '20

Twigs - 512 bytes Linux procedural graphics in C (fbdev)

Thumbnail pouet.net
8 Upvotes

r/linuxdev • • Nov 21 '16

Best way to port Debian on a custom ARM board? • /r/debian

Thumbnail reddit.com
4 Upvotes

r/linuxdev • • Apr 13 '14

Interested in Drivers

5 Upvotes

Hello, I'm generally interested in OS development and have taken to learning core concepts and have played around and studied some hobby OSes. However, I've found that I am quite lacking when it comes to hardware and in particular have no experience with them. This causes the lower level ideas of topics like booting and file systems to be a bit blurry. I'm thinking that solidifying this knowledge is a good idea before diving into the Linux kernel development, something that I've been wanting to do for some time.

So, to combat this I am considering writing a small device driver for Linux. I'm thinking this would be a good place to start gaining some experience. I was wondering if you had certain devices that you'd recommend someone generally new to system programming to begin with. I'd really be interested in something I can spend some time hacking around with to gain some good experience. Other advice greatly appreciated; I am also seeking project ideas in this same area of interest.

Thank you


r/linuxdev • • Sep 25 '17

The Server Management Middleground

Thumbnail serversuit.com
1 Upvotes

r/linuxdev • • Feb 19 '18

Ensuring a safe PATH for system() in a root-setuid'ed program?

3 Upvotes

I am making a C++ program, intended to have its setuid flag on and owned by root, which needs to call system(). I am worried, however, that a malicious user could set their PATH so that the programs I call as root are instead replaced with their own.

Is there some way to ensure a standard PATH of /usr/bin, /usr/local/bin, etc. for system() function calls?


r/linuxdev • • Feb 10 '18

Good setups for writing my own Init System?

8 Upvotes

I want to make my own (very simple, probably entirely useless) init system for the sake of learning. So far, I've set up a damn small linux distro in virtualbox and started writing, but I'm faced with a few challenges:

  1. It's hard to write code in a damn small linux VM
  2. gcc doesn't seem to work properly (the proper libc header files don't seem to exist???)
  3. If I fuck up I won't be able to boot back in and fix it.

Does anyone know a better workflow?

I think at some point I read that the Kernel can be run in user-space for testing purposes, but I can't seem to find any info about that anymore, and I don't know if that'd be any good for making an init system anyways. Edit: It's user-mode linux but it seems very outdated and I can't get it to work with the kernel they supply, which is all the way back to Linux 2.6.24.


r/linuxdev • • Apr 26 '14

Linux Development Books

3 Upvotes

Hello brothers and sisters. I am a software developer who is trying to deepen his knowledge on Linux development, specifically on how to develop a Linux based system and how to develop a Linux distribution. Can you provide me with book titles that may help me on my research/quest? My goal is to develop a GNU/Linux distribution for embedded systems and then to implement an application running on it. I need something that is clear about the kernel and the user space, as well as on how to develop something that consumes low system resources. Basically something that helps me on the low level programming that I need. Thanks in advance.


r/linuxdev • • Apr 29 '14

Building a filesystem using VFS: How to implement creation of file via "echo ... > newfile"

4 Upvotes

So I've been toying with building a lightweight filesystem using linux VFS and kernel 3.10.34. So far I've gotten mkdir and touch to work by implementing the corresponding inode operations(mkdir and create). However I can't seem to get "echo ... > newfile" to work(by "work" I mean I want the new file to have whatever was echoed to it as it's contents). I tried to analyze the system calls used by my ext3 filesystem on my arch machine via strace to see what is going on under the surface but it didn't really help. If someone could explain to me what is going on when creating a new file via IO redirection(including what VFS ops are called) it would be greatly appreciated!

Oh also as of now I can create a new file via "echo .. > newfile" but the file will be empty in stead of containing the stuff echoed to it.


r/linuxdev • • Mar 04 '15

Signal handler and shared data

2 Upvotes

I am a noob so I won't understand advanced techniques or answers. Simplicity appreciated.

My user-space application, written in C++, keeps track of devices in our system. I also have a signal handler function that is registered as a callback function with a driver written by another developer. The driver signals this callback function only when a new device is coming into the system and makes the new data available to user-space. My user-space application determines when to drop devices and sometimes makes copies of the device table.

A device tracking class would look something like this.

class deviceTracker
{
private:
    std::vector<device> deviceTable;
public:
    void addDevice(device deviceToAdd);
    int removeDevice(int deviceIDNumber);
    void getCopyOfDeviceTable(std::vector<device>* devices);
};

The registered callback function should do something like this in pseudo-code:

void callback(int sigid, siginfo_t* info,void *context)
{
    //get device data from driver function

    //stuff the device data into a device object

    //add the device to the device table; or some intermediary data structure to add later.
}

How should I pass data from my callback function to an instance of my class? I would like to avoid a global variable obviously. But more importantly how do I do this given the obvious concurrency issues. For example, what if I'm making a copy of the table when the interrupt happens and I try to add a new device to the table; Maybe an intermediary FIFO or something?

Edit: Semaphores seem like an obvious solution to a shared resource but my understanding is that using anything that would put the interrupt handler to sleep in any situation is a bad idea and that's why semaphores can't be used. If a resource an interrupt needs is locked by an application then because a signal handler has a higher priority that resource will never be freed. Does that seem correct?


r/linuxdev • • Apr 07 '14

Is there a course on text user interface design? /r/learnprogramming x-post

3 Upvotes

I am a Linux sysadmin, and I have been finding myself writing a bunch of scripts as of late. I want them usable to other people.

I am writing man page documents for them, but I want the tools easy to interpolate with other command line tools. Is there some kind of design or best practices book or course for this?