[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1776131766918618.png (1.05 MB, 1200x900)
1.05 MB PNG
previous: >>108677721

#define __NR_create_module            174
#define __NR_init_module 175
#define __NR_delete_module 176
#define __NR_query_module 178
#define __NR_finit_module 313

https://man7.org/linux/man-pages/man2/init_module.2.html
https://man7.org/linux/man-pages/man2/create_module.2.html
https://man7.org/linux/man-pages/man2/delete_module.2.html
https://man7.org/linux/man-pages/man2/query_module.2.html

tl;dr:
kernel modules!

these are pretty neat. we will more or less ignore the create and query syscalls, since they are ancient and no longer supported
but the rest of it is a basic API for interfacing with kernel modules. and proc and sys tell you lots of information about your loaded modules, effectively replacing the query call

have any anons here ever compiled a kernel module before? it's surprisingly easy. if you haven't, maybe look into doing a hello world. it's pretty cool to see your text in dmesg

relevant resources:
man man

man syscalls

https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/
>>
making this into a syscall thread is autistic when the only thing the syscall does is load a driver
>>
>>108687573
i'm doing all of them, no matter how useless they are
>>
Maybe a retard question but what is the __NR_ prefix there for?
>>
>>108687790
i always assumed it meant number
usually they're also redefined as SYS_whatever
>>
>>108687506
Why isn't installing a kernel module just ln -s path-to-model /sys/modules/active/my-module?
>>
>>108688176
What's stopping you from writing a systemd services that starts an inotify filesystem watcher for changes in that directory and then calls the kernel to load that module? Be the change that you want to see.
>>
>>108688200
This is about kernel design, not creating userspace nonsense.
If the query syscall is obsolete because you can just read the virtual filesystem, then installing a module might just as well be a filesystem operation. Unless the init module syscall returns an incredible detailed error or something and it doesn't look like it does, I don't see why they wouldn't do this.
Where's "everything is a file" when it makes sense?
>>
File: 1770714578099682.gif (376 KB, 740x859)
376 KB GIF
>>108688156
Why is there a number in the first place
>>
>>108688398
how else would select syscalls? using a fucking string? lol
>>
>>108687775
glorified ioctl thread
>>
>>108690579
There are interesting ioctls like TIOCSTI that could be covered, but yeah ioctl(2) by itself is pretty boring. https://www.man7.org/linux/man-pages//man2/TIOCSTI.2const.html
>>
>>108688507
Strings are number.
>>
kita marriage
>>
>>108688256
retard
>>
>>108687790
smartest syscall troon.
>>
>>108688200
autist
>>
>>108690768
based
>>
File: 1776579959452803.png (1.19 MB, 1600x950)
1.19 MB PNG
>>108687506
>hello world. it's pretty cool to see your text in dmesg
thanks op. this seems like a pretty cool quick weekend project
>>
>>108687506
who's that in the backrooms?
>>
>>108688398
because somewhere in memory the kernel stores a list of syscall function addresses, and the number is an offset into that table
>>
>>108693858
she is LITERALLY me
>>108693838
let me know how it goes!



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.