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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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.
...
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 ...
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 ...
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 ...
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(...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
linux-kernel × 23linux × 6
c × 4
operating-systems × 4
kernel × 3
git × 2
version-control × 2
concurrency × 2
linux-development × 2
design × 1
design-patterns × 1
algorithms × 1
programming-practices × 1
licensing × 1
security × 1
refactoring × 1
multithreading × 1
android × 1
coding-standards × 1
gpl × 1
compiler × 1
clean-code × 1
learning × 1
frameworks × 1
memory × 1