随笔分类 - linux
linux学习笔记
摘要:LINUX平台收发TCP URG报文客户端:sz = send(sd, "hello", 5, MSG_OOB);发送字节:5, 内容:'hello'服务端:sz = recv(sd, buf, sizeof(buf), MSG_OOB);OOB接收字节:1, 内容:'o'sz = recv(sd,
阅读全文
摘要:LINUX内核PCI扫描过程 内核版本 3.10.1031. ACPI热插拔扫描subsys_initcall(acpi_init)@drivers/acpi/bus.c |-acpi_scan_init@drivers/acpi/scan.c |->acpi_pci_root_init@drive
阅读全文
摘要:2018-6-27 9:12:38https://stackoverflow.com/questions/26385554/error-setting-nr-hugepages-via-sysfs~ # echo 1 > /sys/devices/system/node/node0/hugepage
阅读全文
摘要:e1000e 网卡如遇到大包(>1280)未线速,把'DEFAULT_ITR'改为0, 不设中断频率上限试试see@intel/e1000e/param.c/* Interrupt Throttle Rate (interrupts/sec) * * Valid Range: 100-100000
阅读全文
摘要:2017-8-29 16:33:40内核开启VF小结:1. eth2上创建4个VFecho 4 > /sys/class/net/eth2/device/sriov_numvfs2. 关闭eth2 VF~ # echo 0 > /sys/class/net/eth2/device/sriov_num
阅读全文
摘要:看了大师的文章,理解了这些代码。 所以可以明白:Linux的系统负载指运行队列的平均长度,也就是等待CPU的平均进程数。 Linux的系统负载指运行队列的平均长度,也就是等待CPU的平均进程数。因为Linux内禁止浮点运算,因此系统的负载只能通过计算变化的次数这一修 正值来计算。Linux内核定义一
阅读全文
摘要:进程拥有以下几种状态:就绪/运行状态、等待状态(可以被中断打断)、等待状态(不可以被中断打断)、停止状态和僵死状态. TASK_RUNNING: 正在运行或处于就绪状态:就绪状态是指进程申请到了CPU以外的其他所有资源,正所谓:万事俱备,只欠东风.提醒:一般的操作系统教科书将正在CPU上执 行的进程
阅读全文
摘要:017-12-6 16:27:35时钟中断TIMER_BH(bottom_half)实现分析1.3.1001. 时钟0号中断安装 setup_x86_irq(0, &irq0);@arch/i386/kernel/time.c |- set_intr_gate(0x20+irq,interrupt[
阅读全文
摘要:打补丁patch -d linux-3.10.103 -Np1<../src/patches/linux-3.10.103.diff从打过的补丁还原patch -R -d linux-3.10.103 -Np1<../src/patches/linux-3.10.103.diff
阅读全文
摘要:gdb 不同位置,函数调用参数显示差异,如: copy_strings (argc=1, argv=0xffcf08, page=0xffce6c, p=131068, from_kmem=2) at exec.c:230230 {(gdb) n235 if (!p)(gdb) n328 __asm
阅读全文
摘要:1.3.100 find_first_zero_bit在使用gcc 4.2.4 编译时,需要保护%eax find_first_zero_bit 修订后: /* * Find-bit routines.. */extern __inline__ int find_first_zero_bit(voi
阅读全文
摘要:a gcc 4.2.4 bug(被stos指令累加后%edi作为参数的)* * Ok, now we can initialize the rest of the tty devices and can count * on memory allocations, interrupts etc..
阅读全文
摘要:2017-12-13 10:44:19gcc -02引起内存溢出'unsigned i'应修订为'volatile unsigned i'1.3.100 driver/char/random.cstatic inline void add_entropy_word(struct random_buc
阅读全文
摘要:2017-12-12 18:53:04gcc优化引起get_free_page比__get_free_page返回值多4096内核版本:1.3.100extern inline unsigned long get_free_page(int priority){ unsigned long page
阅读全文
摘要:gdb跟踪剖发现free_area_init中一段优化错了,如下: memset(mem_map, 0, start_mem - (unsigned long) mem_map); do { __asm__ __volatile__("":::"memory"); //gcc请不要优化 --p; p
阅读全文
摘要:int change_bit(int nr, void * addr){ int oldbit; //1.第nr位取反, 原nr位入CF //2. sbbl带借位减(把源操作数和标志位CF的值从目的操作数中一起减去) // 即oldbit保留了结果为nr位上原值:0 or -1 __asm__ __
阅读全文
摘要:/* * IBM messed up *AGAIN* in their thinkpad: 0xA0000 -> 0x9F000. * They seem to have done something stupid with the floppy * controller as well.. */
阅读全文
摘要:1.3.100static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags){ long retval; __asm__ __volatile__( "movl %%esp,%%esi\n\t
阅读全文
摘要:时钟中断TIMER_BH(bottom_half)实现分析1.3.1001. 时钟0号中断安装 setup_x86_irq(0, &irq0);@arch/i386/kernel/time.c |- set_intr_gate(0x20+irq,interrupt[irq]);//interrupt
阅读全文
摘要:2017-12-6 10:26:504.9.51int __get_order(unsigned long size){ int order; size--; size >>= PAGE_SHIFT;#if BITS_PER_LONG == 32 order = fls(size);#else or
阅读全文
浙公网安备 33010602011771号