/srv/irclogs.ubuntu.com/2016/06/28/#ubuntu-kernel.txt

i915well the one i am using is using i915 for it kernel driver00:34
i915so ya my special case it is 00:35
i915also my cases if probably no ware near as general as others have it00:36
i915weird question when compiling a module the make file uses path /lib/modules/$(shell uname -r)/build which points to /usr/src/linux-headers-3.13.0-32/ looking to the Makefile you see lines like this  obj-$(CONFIG_VGA_ARB)  += vgaarb.o05:54
i915obj-$(CONFIG_VGA_SWITCHEROO) += vga_switcheroo.o  05:54
i915I get what those make files are doing just including object files.... but where are these object files cann't find them anywhere so i am thinking they are zipped up in .a file or something05:55
i915The kernel headers are not worth anything without the object files to link against... i do see alot of .ko files under the /lib/module/... but those are for the already built modules that can be insmod 05:57
=== _ruben_ is now known as _ruben
mjg59i915: The .o files aren't shipped, because they're just intermediates between the .c and the .ko files06:02
mjg59The headers give you the information you need to build modules from source06:03
i915so why do the Makefiles have them in there or is that just left behind makefiles for the kernel itselfs code06:03
i915Yes but the headers need to be associated with some type of kernel level library to build the modules that the header file uses?06:04
mjg59Those are the makefiles from the kernel, yes06:07
i915or another words what are these o files for. Because if the modules are just using the .ko files that see and the top level makefiles for target modules searches the .ko file directory then what was the .o files 06:07
mjg59There is no kernel level library06:07
mjg59The .o files are generated from building the .c files. A single .ko may include several .o files.06:08
mjg59They're just an intermediate during the build process06:08
i915yes but for building just modules you could remove all those makefiles with .o and you should still beable to build your LKM06:09
mjg59Sure, but ensuring that you remove those makefiles while not removing any that are required for the build process isn't really worth it06:09
i915LKM from what i am gathering is just using the .ko files in the /lib/modules/3.13.0-32-generic/kernel/ subdirectories06:12
mjg59Yes06:12
i915well then one could archive .ko into one big allmodverion3.6.2.a then take your module header files and integrate it with user land functions i would imagine as well 06:16
mjg59No06:19
i915unless the insertion insmod the output would fail or the structure of the LKM 06:19
mjg59Kernel code can't be executed in useland06:19
mjg59It calls into functions that only exist in the kernel itself06:20
mjg59And which can't be reimplemented in userspace06:20
i915yes so when insmod tries to install the LKM even if it was to compile with user land header/library functions it would fail to install into the kernel level06:20
i915because the user land libraries wouldn't work with kernel LKM06:21
i915i am guessing thats the reason but i see no reason why a LKM cann't load a .so or a kernel level  program call a user land library  is there no load library  that it can uses06:22
i915Maybe it has to do with the way the LKM and its resources are loaded into memory that it cann't access user land libraries but to me it seems the kernel should have a method to call any function ,process, or program in memory... hell it can get a task or runqueue to access any program resources 06:24
i915So i am still left wondering what the real reason is why LKM or any kernel level program cann't get access or uses userland libraries or functions... in my eyes the kernel has complete control of memory and thus all it needs to do is locate the function in it... it also has complete control of the process so there you go you should beable to call upon anything in memory06:26
i915Maybe because the userland users a loader program for the .so and so since its lower then the loader program it would need to go thru the loader first to dynamically load the userland libraries thats my only guess06:28
i915But if the libraries where user libraries where specifically loaded for the LKM start up then you should also thru LKM or kernel functions beable to access the loaded library in memory by passing the loader06:32
i915bypassing06:32
i915and thus being able to call upon userland libraries from kernel mode06:33
i915Of course the only problem would be the mapping of the .so file functions to proper address maybe this part would actually take a page allocated , many other things that essentially would be just creating a loader at the kernel level for user land libraries06:34
i915Also the .got .plt ,...etc parts of the .elf for userland would have to be workable so you would need to somehow port a ld.so or some mechanism for that...06:36
i915this is probably the issue to06:36
i915maybe like the __jump_table section cann't be easilly converted to the got plt06:44
=== cpaelzer is now known as cpaelzer_away
=== alvesadrian is now known as adrian
=== cpaelzer_away is now known as cpaelzer
=== cpaelzer is now known as cpaelzer_away
=== cpaelzer_away is now known as cpaelzer
i915curious i was think again about LKM and if one statically compiled in user library function to it why would this not work the user land functions would be self contained in the LKM no dependences on .so14:38
apwif the module includes all of the code no reason any not, but most libraries assume they are running on top of the standard C library and expect to link to those kinds of things15:24
apwso most userpsace libraries would never find their deps15:24
apwnot that it is clear why you would want to include all this userspace in a kernel module in the first place15:25
ogra_modprobe gnome 15:38
ogra_;)15:38
JanCwell, there used to be a kernel module that implemented a http server because supposedly it was slightly faster than userspace http servers16:34
JanCit was also incredibly bad for security ;)16:35
ogra_who cares about security anyways .. thats so last century ... 16:36
i915curious i see alot of kworker/u8:1 based stuff in ps -A are these workqueues created by the kernel19:52
i915or are they tasklets created by the kernel I would imagine tasklets and softirq won't show up in ps -A on workqueues because workqueues are truely the pthreads version of the kernel i imagine19:58
apwkworker are the kernel contexts for work queuesyes20:00
i915 kthreadd , ksoftirqd, kworker ,khelper kind wondering what the difference in purpose of these and where these all created by workqueues20:06
argeshttps://github.com/0xAX/linux-insides/blob/master/interrupts/interrupts-9.md has some good info about these topics20:07
i915ksoftirqd looks like it is a queue of interrupts when the interrupts come in to fast to process . But is there a way other then workerqueues to create a kernel process or is workqueues / tasks they way kernel threads are made in general20:09
i915No forget it apparently i am wrong kthread functions with task_struct is the equivalent of pthreads .When would one uses workqueues over kthreads then ?20:13
i915ok well i get a way to filter out kernel threads and user threads ps -fHuroot | awk '$3!=2' or ps -fHuroot | awk '$3==2' so i can distinguish between user and kernel threads provided the pid didn't change for your linux you can to or do it by the symlink -->exe in proc dev. Of course now my question is determining what the purpose of these different kernel process are . Next step is /proc/pid for them but not sure yet if it wil20:23
i915l give me a way to figure out what they are meant for20:23
i915Hum i am wondering if LKM are part of the kthreads process it looks like some are there but the names are different maybe they are contained with in the kernel threads trying to link the distinction of kthreads with LKM's20:30
i915so its like kthreadd spawns all kernel threads i.e kworker threads but there is additional ones i still have to look into later tonight to get them all down would be nice to know where the LKM's leave in which on of these kernel threads/process if any.20:36
i915because the insmod insertion into the kernel so i thought it would be a process/thread but maybe its just a fixed static code block that is hooked with irq hander routines to call the module functions. Or maybe the modules are normally just to set up irq for a callback handler that does the device driving not fully sure of all this yet20:38

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!