4 votes
Accepted

Can the operating system "break up" a memory allocation (Linux)?

If the process asks for 100MB, there has to be a contiguous 100MB free in the address space of the process (virtual memory), but those addresses can be mapped to non-contiguous pages of physical ...
amon's user avatar
  • 134k
4 votes

Feasibility of adding drivers to linux kernel

This is not a "philosophy of Linux", it's a fact of life: over time, new hardware is invented, and needs new software to interface with it. This is true of every OS, in proportion to the ...
IMSoP's user avatar
  • 5,857
4 votes
Accepted

Feasibility of adding drivers to linux kernel

I have question regarding Linux kernel, as far as I understand, to make Linux compatible with different machines and hardware, different device driver is added to the Linux That is correct, but the ...
Bart van Ingen Schenau's user avatar
4 votes

Is it cleaner to decrement a sleeping process counter in the waking process or the woken process?

I'm not a parallelism expert, but here's what concerns me.  If there are multiple producers, then there is a race condition by the > 0 test and the wake/decrement. Let's say there is only one ...
Erik Eidt's user avatar
  • 33.8k
4 votes

What does the inode point to in case of a device file other than the disk?

Of course this depends on the file system, but in traditional UNIX filesystems a device node contains a type indicator (block or character device) and a major and minor number. In the kernel, the ...
Hans-Martin Mosner's user avatar
3 votes

What security practices do I employ when building a library that requires low level root access to certain devices and files?

The first thing you'll have to understand about the risks introduced by this design you have to consider what root can do that normal users can't. A user in the root group can do a great number of ...
Berin Loritsch's user avatar
3 votes

Is it cleaner to decrement a sleeping process counter in the waking process or the woken process?

I don't know what language/library you're using here, but for most, you're working at least two levels of abstraction too low. For keeping a count and blocking when the count is too low, you would ...
Karl Bielefeldt's user avatar
2 votes

Can the operating system "break up" a memory allocation (Linux)?

Asking about RAM is wrong, what counts is address space. If your OS is using virtual memory (which is most likely the case), then the mapping of address space to RAM is arbitrary and can change at any ...
gnasher729's user avatar
  • 45.2k
2 votes
Accepted

Is it cleaner to decrement a sleeping process counter in the waking process or the woken process?

Is it cleaner to decrement the reader counter in the producer, after it does the waking, or the reader, after it wakes? The cleanest code is code where you can read it and tell confidently if it is ...
Bart van Ingen Schenau's user avatar
2 votes

Managing Linux Kernel Config Files in Revision control

You can use make savedefconfg this will generate a defconfig file that should be close to the defconfig provided by nvidia. At least, the diff will be smaller.
Alexandre Belloni's user avatar
2 votes
Accepted

Design improvement - C

You are trying to implement a virtual table. See how it's done in https://stackoverflow.com/q/3113583/125562 Basic idea is to store all methods required to interact with a structure as its fields. ...
Basilevs's user avatar
  • 1,776
2 votes

Can the Linux kernel be described as a Server?

While your explanation of your logic makes sense to me, I think it will be confusing to people because the term server is generally associated with a remote host. I think you should just refer to the ...
JimmyJames's user avatar
  • 27.3k
1 vote
Accepted

What does the inode point to in case of a device file other than the disk?

One thing you should understand is that the on-disk inode structure is rarely identical to the in-memory inode structure. What data is stored in an on-disk inode depends on the filesystem. But yes, it ...
Alex D's user avatar
  • 1,308
1 vote

Implications of using Kbuild infrastructure in proprietary software

The license of Kbuild can only affect the license of your own product if parts of Kbuild end up in the product you are distributing. The main function of a build system like Kbuild is to make sure ...
Bart van Ingen Schenau's user avatar
1 vote

Finding register parameters for system calls

The relevant documentation is called the Application Binary Interface (ABI) and the calling conventions. Both are processor and operating system specific. Read the x86_64 Linux ABI. See also syscalls(...
Basile Starynkevitch's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible