调试Linux内核,在vfs_write()中获取当前文件写所属的硬盘盘符,添加以下主要代码。但编译时,报错“error: dereferencing pointer to incomplete type”。仔细检查了代码,也没发现错误。 最后感觉是struct gendisk的定义没找到,在read_write.c文件头添加包含linux/blkdev.h后,编译通过。 #include <linux/blkdev.h> struct gendisk *disk; if(file->f_path.dentry->d_inode && file->f_path.dentry->d_inode->i_bdev) disk = file->f_path.dentry->d_inode->i_bdev->bd_disk; [root@root /zlib/linux-3.10.0-327.x86_64] #make -j64 make[1]: Nothing to be done for `all’. CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CC scripts/mod/devicetable-offsets.s GEN scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o HOSTLD scripts/mod/modpost make[1]: Nothing to be done for `relocs’. make[1]: `arch/x86/purgatory/kexec-purgatory.c’ is up to date. […]
READ MORE »Linux系统中ACPI Table读取与解析
Linux Read ACPI Table Tools. ACPI tools的安装: #yum install acpica-tools 或者到下面链接下载源码: https://www.acpica.org/downloads 下面示例是解析SSDT1表的步骤。 #acpidump -o ACPI_table.out #acpixtract -a ACPI_table.out Intel ACPI Component Architecture ACPI Binary Table Extraction Utility version 20150619-64 Copyright (c) 2000 – 2015 Intel Corporation Acpi table [BDAT] – 48 bytes written to bdat.dat Acpi table [APIC] – 772 bytes written to […]
READ MORE »CPU P-States/T-States/G-States/S-States/C-States含义
P-States: Performance States,能效状态。 T-States:Throttling States。 S-States:Sleeping States,睡眠状态。 G-States:Global States,全局状态。 C-States:CPU States,处理器状态。 P-States指CPU根据当前运算负载,调整运行的频率。如2.6GHz的CPU,在系统空闲时,可以运行在1.8GHz频率。
READ MORE »Compression file systems
https://en.wikipedia.org/wiki/Category:Compression_file_systems From Wikipedia, the free encyclopedia Jump to: navigation, search These are filesystems that support compression of some sort, both read only, changeable data and as an extra feature. Similar categories Category:Disk images Category:Archive formats NewPP limit report Parsed by mw1219 Cached time: 20170303072654 Cache expiry: 2592000 Dynamic content: false CPU time usage: 0.000 seconds […]
READ MORE »Linux内核printk打印格式
来源:https://www.kernel.org/doc/Documentation/printk-formats.txt If variable is of Type, use printk format specifier: ——————————————————— int %d or %x unsigned int %u or %x long %ld or %lx unsigned long %lu or %lx long long %lld or %llx unsigned long long %llu or %llx size_t %zu or %zx ssize_t %zd or %zx s32 %d or %x u32 %u or […]
READ MORE »Macbook/Mac OS中阅读代码软件推荐
在Windows中用习惯了Souce Insight,切换到使用Macbook后,看代码少了利器。Source Insight没有Mac OS版本。 但我们通过在MacBook中安装Crossover或Wine,然后在Crossover或Wine中安装Source Insight。在Macbook中,我们也可以像Windows一样,使用强大的Source Insight来阅读代码。 Crossover软件官网:https://www.codeweavers.com/ 在Mac OS中,推荐一款更为强大的代码阅读软件,scitools的Understand。软件详细介绍,请参考网站。https://scitools.com/
READ MORE »一德二命三风水,四积阴功五读书
一德二命三风水,四积阴功五读书。 六名七相八敬神,九交贵人十养生。 十一择业与择偶,十二趋吉要避凶。
READ MORE »[转]Google Hacking Overview
http://resources.infosecinstitute.com/google-hacking-overview/
READ MORE »[转]System Address Map Initialization in x86/x64 Architecture Part 2: PCI Express-Based Systems
http://resources.infosecinstitute.com/system-address-map-initialization-x86x64-architecture-part-2-pci-express-based-systems/
READ MORE »