ChinaUnix.net
相关文章推荐:

kmem

想做一个获取系统监控信息的小程序,网上经常说从/dev/kmem中读取,看top的源码也是这样,可是/dev/kmem中数据的格式是什么啊?有没有这方面介绍的书籍?我都不知道里面的格式怎么取啊?网上也没查到,请大家指点!

by sunnyqboy - AIX - 2009-03-25 23:22:46 阅读(1662) 回复(0)

相关讨论

想做一个获取系统监控信息的小程序,网上经常说从/dev/kmem中读取,看top的源码也是这样,可是/dev/kmem中数据的格式是什么啊?有没有这方面介绍的书籍?我都不知道里面的格式怎么取啊?网上也没查到,请大家指点!

by sunnyqboy - 其他UNIX - 2009-04-03 21:32:10 阅读(2167) 回复(5)

RHEL3,内核与gcc全部是系统自带。 程序中相关代码: [code] fd_kmem = open("/dev/kmem", O_RDWR); ptr_idt = get_addr_idt(); descriptor = (struct descriptor_idt *) malloc(sizeof(struct descriptor_idt)); ...... readkmem(descriptor, ptr_idt + 8 * x, sizeof(struct descriptor_idt)); ...... void readkmem(void *m, unsigned off, int size) { int i; ...

by sailer_sh - 内核/嵌入技术 - 2006-03-22 10:49:03 阅读(2518) 回复(19)

今天看了Linuxon-the-flykernelpatchingwithoutLKM里面有段代码是从/dev/kmem中找sys_call_talbe的地址,但在我的机器上编译,提示read kmem:bad address,我的内核是2.4.20-8,请指教,谢谢 [CODE/] /* sys_call_table in /usr/include/syscall.h system_call int /usr/include/asm/unistd.h */ #include #include #include #include /* 定义IDTR寄存器结构 */ stru...

by W.Z.T - 内核/嵌入技术 - 2006-06-04 18:49:55 阅读(742) 回复(1)

[code] #include ; #include ; #include ; #include ; #include ; #include ; int main(void) { int fd,n; char buf[MAXLINE] ; if((fd=open("/dev/kmem",O_RDONLY))<0) { perror("open /dev/kmem error"); return(1); } for( ; ; ) { while((n=read(fd,buf,MAXLINE))>;0) { if(write(STDOUT_FILENO,buf,n...

by connect - C/C++ - 2004-05-22 07:13:44 阅读(876) 回复(1)

内核版本:2.6.12.9; 利用0x80终端访问/dev/kmem文件,open该文件正常返回,lseek文件正常返回,read文件时返回值为-1,请高人指点: 主要代码如下: ..... kmem=open(filename,O_RDONLY,0640); ..... off_r=lseek(kmem,off,0); printk("off_r is : %x\n",off_r); if(off_r!=off){ printk("kmem lseek error in read\n"); return; } // printk("mem is %x\n",(unsigned)*m); sz_r=read(kmem,m,sz); // printk("mem is %x...

by leo_yang - 内核/嵌入技术 - 2006-09-05 16:25:15 阅读(565) 回复(1)

想知道如何在AIX中读取/dev/kmem的信息,是否有大虾帮忙指导一下呀,谢谢了。能不能给一段代码示范一下,谢谢了!

by lwholly - AIX - 2006-06-23 21:12:45 阅读(1677) 回复(6)

I have a problem on RHEL4. I can not find the file /dev/kmem. I can find this file on Linux WS 3.0 and AS 3.0. So I want to know if the RedHat move this file to the other? :em14:

by lanyao - 系统管理 - 2006-03-08 14:41:09 阅读(814) 回复(8)

/mm/slab.c [code]283 struct kmem_cache_s { 284 /* 1) per-cpu data, touched during every alloc/free */ 285 struct array_cache *array[NR_CPUS]; 286 unsigned int batchcount; 287 unsigned int limit;[/code] 上面是slab高速缓存结构的前几个成员. 请教 一个高速缓存怎样与各CPU之间建立联系,?? 有没有相关资料? 谢谢!

by yjh777 - 内核/嵌入技术 - 2006-01-13 09:55:29 阅读(1199) 回复(4)

1、谁能介绍一下/unix文件中的内容啊?我用tail /unix发现里面内容太多,而且显示的非常乱。 我看top源码中用到过 #define VMUNIX "/unix" static struct nlist nlst[] = { { "v" }, /* 0 */ { "proc" }, /* 1 */ { "freemem" }, /* 2 */ { "availrmem" }, /* 3 */ { "availsmem" }, /* 4 */ { "maxmem" }, /* 5 */ { "physmem" }, /* 6 */ { "nswap" }, /* 7 */ { "Hz" }, /* 8 */ { "mpid" },...

by sunnyqboy - 其他UNIX - 2009-03-25 19:25:40 阅读(1738) 回复(0)

帖子发在linux分论坛,内核源代码学习版了,但是那里人太少,同样的也不好发两遍,还是做个广告链接吧! :em17: :em17: http://linux.chinaunix.net/bbs/thread-913690-1-1.html 斑竹多包涵,纯粹为了交流! :em17: :em17:

by Jobs.AE@ - C/C++ - 2007-11-09 17:42:23 阅读(1507) 回复(2)