Questions tagged [kernel]

Code that is intended to run in an operating system kernel or kernel module

Filter by
Sorted by
Tagged with
5
votes
1answer
60 views

Creating procfs entry on linux in Kernel Module

My Linux kernel version is Linux version 5.0.0-29-generic I'm currently learning how to write kernel modules for Linux and implemented this simple module which ...
2
votes
0answers
37 views

Getting an element from RCU-protected list in kernel

I wrote a function, read_fox_rcu() for getting an element from RCU-protected list in a linux device driver. read_fox_rcu() reads ...
2
votes
0answers
68 views

CUDA kernel to compare matrix entries, weighted with a pattern

I wonder if it's possible to optimize this code in CUDA. Could I get any hints how to? Equivalent algorithm runs faster in Matlab for me, but there I'm doing matrix operations. Compution I'm not ...
4
votes
0answers
424 views

Linux GPIO rotary encoder as volume control

I've written a kernel module (tested on Raspberry Pi) to use a rotary encoder as a volume control. The Linux source tree already contains a driver for rotary encoders so I've just piggybacked off of ...
3
votes
1answer
72 views

ReadWriteSerializer

I am developing a C++ kernel, and I've got the need for manipulating huge data structures before the task-scheduler runs - it means in a non-preemptive environment. For this, I have developed a read-...
7
votes
2answers
431 views

Generating bounded & unique random numbers in the Linux kernel

I recently needed to generate a series of unique random numbers (non-repeated) within a bounded range inside of the Linux kernel. The code I came up with is below. I'd appreciate any feedback -- again,...
6
votes
1answer
99 views

X86 Legacy boot loader error trapping

The boot loader that I'm designing is just simply going to setup (A) Stack, (B) Segment registers (C) Load remainder of track for specified device. Conventionally, this could have been up to 4 floppy ...
4
votes
0answers
143 views

VBE BDF font rendering

I'm working on a hobby kernel, with graphics and rendering fonts. The font format is BDF. Some of them (like for Ubuntu Mono) I used was ttf2bdf. Then I use a program called bdf2c which converts it to ...
11
votes
1answer
209 views

Makefile for a custom operating system kernel

I'm now posting the second semi-complete part of my operating system makefile. The kernel itself is currently incomplete, so don't be surprised by the small size of the makefile. When the kernel ...
4
votes
1answer
520 views

Re-implementing memcpy

I have written an implementation of memcpy function and I want to know how good is it and if it gets the most out of the processor capabilities or not. The reason ...
11
votes
1answer
1k views

Callback in Linux kernel driver in order to hide device's low-level protocol

I'm am writing a Linux kernel driver for HD44780 LCDs connected via I2C bus. In my last change I tried to decouple low-level code (which talks to the device via I2C) from device's logic (printing ...
2
votes
0answers
214 views

Windows AppLocker extension - Owner rule

I am trying to extend Windows AppLocker behavior to add custom rule which checks owner of executables in Program Files and Windows folders. This would help us patch folders that are writable by ...
4
votes
1answer
135 views

Kernel development

I'm trying to learn more about kernels, so naturally I started to program one. I'm using tutorials from here. Right now I have modified the printf() that was ...
7
votes
1answer
170 views

Homebrew std::string for use with kernel

I've ported some standard library facilities like vector, algorithm, etc. to my kernel so I can code in C++ instead of C. This is one of them. I'm looking for concerns regarding: Performance Safety ...
14
votes
2answers
2k views

Free a binary tree without using recursion or allocating memory

As the title says, the objective is to free a binary tree without using the stack or allocating memory. This was required for a kernel module where resources were limited. Result has a complexity of \...
3
votes
2answers
3k views

Simple Linux char driver

Since the resources I found to learn are generally out-of-date, I'm having to read a lot of documentation, which makes the learning process somewhat haphazard. The module makes a simple character ...