Ask HN: A kernel module that adds a syscall

https://news.ycombinator.com/item?id=37720120
by matt3210 • 3 years ago
1 1 3 years ago

How awesome would it be if I could write a kernel module that could enable a syscall like functionality. Example: I want to make something like pipe() or fork() but with highly customized behavior that runs with the kernel and produces an FD to be used by userspace software.

eg:

int fd = my_custom_syscall_like_functionality_related_to_my_hardware(FLAG_X | FLAG_Y);

int rc = read(fd, ...);

rc = write(fd, ...);

close(fd)

Does this or something similar already exists? I can write kernel modules that add devices and stuff for connected hardware but I only recently learned how to do that so I dont know what I dont know.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com