kernel

5-D Kernel density estimation in R using “kde” function

穿精又带淫゛_ 提交于 2020-01-03 17:45:10
问题 I want to perform Kernel density estimate for a 5-dimensional data (x,y,z,time,size) by using "kde" function in "ks" library of R. In it's manual it says it can do Kernel density estimate for 1- to 6-dimensional data (Page 24 of manual: http://cran.r-project.org/web/packages/ks/ks.pdf). My problem is that it says for more than 3 dimensions I need to specify eval.points. I don't know how can I specify the evaluation points because there is no example for more than 3 dimensions. For example if

Is there a way to get battery info (status, plugged in, etc) without reading a proc/sys file on linux?

核能气质少年 提交于 2020-01-03 15:21:28
问题 I want to get information about the battery in C on linux. I don't want to read or parse any file! Is there any low-level interface to acpi/the kernel or any other module to get the information I want to have? I already searched the web, but every question results in the answer "parse /proc/foo/bar". I really don't want to do this because I think, low-level interfaces won't change as fast as Files do. best regards. 回答1: You might be looking for UPower: http://upower.freedesktop.org/ This is a

Access graphic card clock programmatically

白昼怎懂夜的黑 提交于 2020-01-03 06:46:08
问题 Is it possible to use graphic card clock from a windows application? More specifically - is it possible to somehow make graphic card to send interrupts on clock events (tick?) and hook to it from a software? What I am trying to say is that PC clocks arent good. precision clocks cost a lot of money plus they are difficult when it comes to colo (GPS signal is not available and atomic clocks cost an arm and a leg and more). I read that new graphic cards have precision clocks on them. So my

Jupyter Notebook dead Kernel after Anaconda update

我怕爱的太早我们不能终老 提交于 2020-01-03 05:47:28
问题 I got the following problem. After update Anaconda because I got an error to import skimage.io to a project in Jupyter Notebook an even a greater error appear - Dead Kernel. Right now I could not ever start a project because the Jupyter gives the following error is: Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/? token=aaf85a5e18489792c87cce65d7a53a0263cd5c08cc7248b 6 [I 00:55:13.451 NotebookApp] Accepting one-time

How to copy_to_user a string and use offp in a Linux Kernel read function

醉酒当歌 提交于 2020-01-03 03:05:34
问题 Declared: static char status[128] = "off\0"; and implemented a read function: static ssize_t read_proc(struct file *filep, char __user *buf, size_t len, loff_t *offp) { ssize_t cnt = strlen(status), ret; ret = copy_to_user(buf, status, cnt); *offp += cnt; return cnt; } How do I take into account the offp ? currently it prints endless the status to screen 回答1: Thanks the guys comments here I came up with the following implementation, which I believe is the right way to use offp : static ssize

Initializing a member of a struct to a function pointer without knowing the returned type

≯℡__Kan透↙ 提交于 2020-01-03 02:55:53
问题 I have this struct: typedef struct xyz_data { void *myfa; <------- correct void *myfb; <------- incorrect } and this function definition: asmlinkage ssize_t (*real_sys_read)(unsigned int fd, char __user *buf, size_t count); asmlinkage ssize_t hooked_sys_read(unsigned int fd, char __user *buf, size_t count); (as you might be guessing, this will point to the kernel's __NR_read ). Saving hooked_sys_read to *myfa; is as simple as xyz_data_something->myfa = hooked_sys_read , but what about myfb ?

Race: callbacks and removing callbacks during unload of kext in OSX

一曲冷凌霜 提交于 2020-01-02 23:14:09
问题 There doesn't appear to be synchronization between establishing/removing callbacks (e.g. kauth_unlisten_scope) and the callbacks themselves (in the xnu codebase, yes, I know, it's dated). This puts the burden of tracking/draining callbacks and synchronizing with calls on the extension itself. But this is problematic as well in that there is a window in noting that a thread has exited the callback AND actually returning out of the extension code. Is there any pattern that gives a correct

BSP裁剪(1)kernel裁剪--调试工具和调试信息的裁剪

徘徊边缘 提交于 2020-01-02 19:10:24
概述 1. BSP包裁剪主要包括两个部分 kernel裁剪 rootfs裁剪 2. kernel裁剪涉及的部分主要分为: 调试工具和调试信息的裁剪 File systems 的裁剪 driver的裁剪 杂项优化 在内核目录运行make ARCH=平台 menuconfig,通过配置内核进行裁剪。 调试工具和调试信息的裁剪 kernel 支持了非常多的调试工具,同时也能支持向proc等导出调试信息,这对于开发调试有很多用处,但也大大加大了内核的尺寸,如果一个产品准备量产,为了优化BSP的大小,可以去掉内核的调试工具和调试信息,其中主要涉及到的有General setup 和 kernel hacking 两个配置选项。 1. General setup (1)General setup介绍 General setup是代码成熟度配置选项,主要配置编译的工具,编译的优化选项,软件子系统的支持等,对于General setup中各个选项的含义,可以参考如下: 详细说明 裁剪选项:General setup 作用 优化大小:537784 <>kernel .config support 把内核的配置信息编译进内核中,以后可以通过scripts/extract-ikconfig脚本从内核镜像中提取这些信息 <>Contorl Group support相关子选项 -->Example

DNS学习

时间秒杀一切 提交于 2020-01-02 16:15:30
一、DNS简介 DNS是域名系统(Domain Name System)的英文缩写。域名解析是把域名指向网站空间IP,让人们可以通过访问域名来访问网站的一种服务。IP地址是网络上标识站点的数字地址,为了方便记忆,采用域名来代替IP地址标识站点地址。 域名解析就是从域名到IP地址的转换过程。 正向解析:域名----------》IP地址 反向解析:IP地址-----------》域名 二、域名的组成和分类 2.1、格式 格式常见格式:www.baidu.com 完整格式:www.baidu.com. . :根域,可省略不写 2.2、域名各组成部分解释 com:顶级域,由ICANN组织指定和管理 分类: 国家区域域名:cn(中国)、hk(香港)、sg(新加坡) 通用顶级域名:com(商业机构)、org(非营利组织)edu(教育机构)等 新通用顶级域名:red(红色、热情)、top(顶级,高端)等 baidu:二级域,可由个人或组织申请注册 www:三级域(子域),服务器网站名代表 2.3、客户端访问站点过程 例如:客户端访问www.kernel.org (1)客户端首先查看本地hosts文件,如果有则返回,否则进行下一步 (2)客户端查看本地缓存、是否存在本条目的缓存,如果有则直接返回。没有则进行下一步 (3)将请求转发给DNS服务器 (4)查看域名是否为本地解析,是则本地解析返回

how to make kernel module binary blob

萝らか妹 提交于 2020-01-02 15:04:52
问题 I want to distribute proprietary Linux module for various distros without pre-building the module for all of them. For example I have the following files: wrapp.c mod.c fops.c All wrapp.c is wrapper for all kernel functions I'm using: unsigned int wrap_ioread8(void *addr) { return ioread8(addr); } What I want to do is to give the customer mod.o and fops.o + the wrapp.c. So I build the mod/fops.o on kernel 3.2 then tried to use them on kernel 2.6.32. The module builds without a problem but