
Linux学习笔记
文章平均质量分 74
cassper
这个作者很懒,什么都没留下…
展开
-
6.1. Using /proc For Input
So far we have two ways to generate output from kernel modules: we can register a device driver and mknod a device file, or we can create a /proc file. This allows the kernel module to tell us anyth转载 2007-05-29 20:57:00 · 436 阅读 · 0 评论 -
Linux 启动过程
首先让我们看看传统的启动流程:加载并运行Master Boot Record(MBR)主引导区内容(如lilo等)。然后扫描分区表,定位活动分区,并将活动分区上的引导扇区内容加载到内存中执行。系统引导过程主要由以下几个步骤组成(以硬盘启动为例)1、 开机;2、 BIOS加电自检(POST——Power On Self Test),内存地址为0fff:0000;3、 将硬盘第一个扇区转载 2008-07-09 19:19:00 · 578 阅读 · 0 评论 -
Understanding the linux kernel-ch6-Timing Measurements
6.1 Clock and Timer CircuitsReal Time Clock (RTC)Motorola 146818IRQ 82 Hz and 8,19原创 2008-07-19 11:05:00 · 533 阅读 · 0 评论 -
Understanding the linux kernel-ch6-Timing Measurements
6.3 Updating the Time and Date//kernel/timer.c/* * Called by the timer interrupt. xtime_lock must already be ta原创 2008-07-19 11:21:00 · 533 阅读 · 0 评论 -
Understanding the linux kernel-ch7-Process Scheduling
7.3 Data Structures Used by the Scheduler· The runqueue Data Structure//kernel/sched.c/* * This is t原创 2008-07-22 20:13:00 · 495 阅读 · 0 评论 -
Linux内核2.6.19源代码目录树结构
要深入的学习Linux的工作机制,就必须阅读其源代码。现已最新的2.6.19内核(可以在http://www.kernel.org下载)为例,简单的介绍下Linux内核源代码目录树结构。 arch:包含和硬件体系结构相关的代码,每种平台占一个相应的目录。和32位PC相关的代码存放在i386目录下,其中比较重要的包括kernel(内核核心部分)、mm(内存管理)、math-emu(浮点单元仿真)、l转载 2008-05-28 20:49:00 · 664 阅读 · 0 评论 -
硬盘安装fedora
先把下载的iso文件放到一个fat32 的盘里,我放到E盘了!先把下载的第一张盘中的isolinux中的vmlinuz与initrd.img解压出来,和你下到的安装盘放到一个根目录中!然后下载grub for dos 到一个盘中,然后把grub for dos解压到C盘中,必须把文件解压到根目录下,然后打开C盘下的boot.ini文件(在文件夹下设置显示系统文件就可以看到它)我们需要加一个选项,让转载 2008-06-01 10:17:00 · 499 阅读 · 0 评论 -
最简单的makefile
#######################SRCDIR=.OBJDIR=.CC=gccautocrechg.o:autocrechg.c $(CC) -c autocrechg.clnk:autocrechg.o $(CC) autocrechg.o -o autocrechg .PHONY clean: /usr/bin/rm -rf *.obj /usr/bin/rm -rf *.o原创 2008-06-01 22:28:00 · 688 阅读 · 0 评论 -
Linux内存:内存管理的实质
转自:http://linux.chinaunix.net/bbs/thread-1003872-1-1.html1. 内核初始化: * 内核建立好内核页目录页表数据库,假设物理内存大小为len,则建立了[3G--3G+len]::[0--len]这样的虚地址vaddr和物理地址paddr的线性对应关系; * 内核建立一个page数组,page数组和物理页面转载 2008-06-14 14:00:00 · 570 阅读 · 0 评论 -
Understanding the linux kernel-ch1-overview
Chapter 1. Introduction原创 2008-06-19 21:03:00 · 570 阅读 · 0 评论 -
linux 2.6.11 bootsect.s解读
/* * bootsect.S Copyright (C) 1991, 1992 Linus Torvalds * * modified by Drew Eckhardt * modified by Bruce Evans (bde) * modified by Chris Noe (May 1999) (as86 -> gas) * gutted原创 2008-07-07 19:50:00 · 1282 阅读 · 0 评论 -
Understanding the linux kernel-ch4-Interrupt Handling
Interrupt handling depends on the type of interrupt. three main classes of interrupts:I/O interruptsAn I/O device requires attention; the corresponding i原创 2008-07-03 20:27:00 · 622 阅读 · 0 评论 -
3.3 GNOME桌面
3.3 GNOME桌面GNOME(发音是guh-nome)提供了在安装Fedora Core和其他Red Hat Linux系统后的默认桌面环境。该桌面环境提供的软件位于X Window System框架和窗口管理器提供的外观之间。GNOME是一种稳定可靠的桌面环境,并且具有非常不错的功能。最新的Fedora Core版本随附提供新的GNOME 2.10桌面。GNOME 2.10的增强功转载 2007-09-24 22:59:00 · 3951 阅读 · 0 评论 -
8.1. System Calls
So far, the only thing weve done was to use well defined kernel mechanisms to register /proc files and device handlers. This is fine if you want to do something the kernel programmers thought youd转载 2007-05-29 20:59:00 · 662 阅读 · 0 评论 -
13.1. Symmetrical Multi-Processing
ne of the easiest and cheapest ways to improve hardware performance is to put more than one CPU on the board. This can be done either making the different CPUs take on different jobs (asymmetrical转载 2007-05-29 21:08:00 · 835 阅读 · 0 评论 -
14.1. Common Pitfalls
efore I send you on your way to go out into the world and write kernel modules, there are a few things I need to warn you about. If I fail to warn you and something bad happens, please report the pro转载 2007-05-29 21:10:00 · 515 阅读 · 0 评论 -
A.1. Changes between 2.0 and 2.2
A.1.1. Changes between 2.0 and 2.2I dont know the entire kernel well enough do document all of the changes. In the course of converting the examples (or actually, adapting Emmanuel Papirakiss转载 2007-05-29 21:11:00 · 449 阅读 · 0 评论 -
B.1. Where From Here?
I could easily have squeezed a few more chapters into this book. I could have added a chapter about creating new file systems, or about adding new protocol stacks (as if theres a need for that -- y转载 2007-05-29 21:12:00 · 455 阅读 · 0 评论 -
2.7 使用vi文本编辑器
2.7 使用vi文本编辑器只要使用Linux,那么不使用文本编辑器几乎是不可能的。这是因为多数Linux配置文件是纯文本文件,所以有时肯定需要进行手动修改。如果正在使用GUI,那么可以运行gedit,编辑文本时使用它相当直观。还有一个简单的文本编辑器nano,可从shell运行它。但是多数Linux shell用户会使用vi或emacs命令来编辑文本文件。与图形编辑器相比,vi或emac转载 2007-09-24 22:51:00 · 1355 阅读 · 0 评论 -
2.6 使用Linux文件系统
2.6 使用Linux文件系统Linux文件系统是计算机上所有信息的储存结构。它使用目录层次结构来组织各个文件。每个目录都可以包含文件和其他目录。<img height="198" alt="文本框:图2-1 以目录层次结构方式组织的Linux文件系统" hspace="12" src="http://book.youkuaiyun.com/BookFiles/330/img/image0转载 2007-09-24 22:55:00 · 971 阅读 · 0 评论 -
如何使Linux系统上的程序开机后自动运行
http://soft.zdnet.com.cn/software_zone/2007/0909/497347.shtml Linux有自己一套完整的启动体系,抓住了Linux启动的脉络,Linux的启动过程将不再神秘。 阅读之前建议先看一下附图。 本文中假设inittab中设置的init tree为: /etc/rc.d/rc0.d /etc/rc.d/rc1.d转载 2007-09-24 22:22:00 · 661 阅读 · 0 评论 -
2.5 创建shell环境
2.5 创建shell环境调优shell有助于更高效地工作。每次按Enter键时,提示符能够提供有关的信息。也可以通过设置别名来减少击键操作,并永久设置符合所需的环境变量。要使每项更改在启动shell时生效,可在shell配置文件中添加该信息。2.5.1 配置shell很多配置文件支持shell的工作方式。其中可以为所有用户和所有shell执行某些文件,而其他文件则只用于创建该配置转载 2007-09-24 22:48:00 · 1077 阅读 · 0 评论 -
Understanding the linux kernel-ch2-Memory addressing
Chapter 2. Memory Addressing原创 2008-06-19 21:06:00 · 753 阅读 · 0 评论 -
Understand the linux kernel-ch3-Process descriptor
Chapter 3. Processes原创 2008-06-19 21:39:00 · 760 阅读 · 0 评论 -
Understanding the linux kernel-ch3-Process descriptor
The process list原创 2008-06-20 21:14:00 · 533 阅读 · 0 评论 -
rootkit
hook系统调用函数 /*hideps.c*/#include #include #include #include #include #include #include #include #include #include #include #include //#include //#include #define C转载 2009-09-18 12:41:00 · 529 阅读 · 0 评论 -
sock_mmap
//==============================================================//socket_mmap.cpp//此程序演示了如何采用内存映射的方式采集数据包//这是应用层数据库采集性能最高的方法//g++ -o socket_mmap socket_mmap.cpp -Wall -lpcap#include #i转载 2009-09-18 12:51:00 · 1820 阅读 · 0 评论 -
LAMP配置
Ubuntu下配置LAMP(Linux+Apache+Mysql+PHP)环境PHP服务器的架设一、安装Ubuntu8.04虽然说是配置LAMP环境,但在文章里并不会讲述如何安装Ubuntu8.04,因为关于如何Ubuntu8.04在网上已经有很多的教程了,就算是硬盘安装也是一件很简单的事了。这里我就给出一个链接好了,Ubuntu8.04硬盘安装指南,当然,上面这篇文章只是给出了安转载 2009-09-18 12:58:00 · 475 阅读 · 0 评论 -
git使用说明
Q:You are in the middle of a conflicted mergeA:git fetch origin git reset --hard originQ:How to get linux2.6 mian tree using gitA:git clone git://git.kernel.org/pub/scm/linux/kernel/git/tor转载 2009-09-18 12:59:00 · 1762 阅读 · 0 评论 -
linux硬盘安装
1,修改boot.ini,追加一行:C:/grldr="GRUB"2,下载grub4dos,解压缩 grldr 和 grub.exe 到C盘根目录3,建立menu.lst文件,内容如下:title Install Ubunturoot (hd0,0)kernel (hd0,0)/vmlinuz boot=casper iso-scan/filename=/ubuntu-原创 2009-09-18 13:06:00 · 646 阅读 · 0 评论 -
linux sock_raw原始套接字编程
from:http://blog.chinaunix.net/u2/62281/showart_1096746.html sock_raw原始套接字编程可以接收到本机网卡上的数据帧或者数据包,对与监听网络的流量和分析是很有作用的.一共可以有3种方式创建这种socket 1.socket(AF_INET, SOCK_RAW, IPPROTO_TCP|IPPROTO_UDP|IPPRO转载 2009-09-24 17:23:00 · 1650 阅读 · 0 评论 -
Makefile编写
## Makefile for src directory#PROJDIR := ../..include $(PROJDIR)/Make.properties# ---------------------------------------------------------------------------# Module原创 2009-10-15 11:10:00 · 491 阅读 · 0 评论 -
daemon程序
#include #include #include #include #include void init_daemon(void){ int pid; int i; if(pid=fork()) exit(0);//是父进程,结束父进程 else if(pid< 0) exit(1);//fork失败,退出 //是转载 2009-10-21 11:16:00 · 600 阅读 · 0 评论 -
kprobe
kprobe是内核提供的探测内核代码的一种机制,有助于开发人员跟踪内核代码运行状态。1,three types--Kprobes, Jprobes, Return Probes2, arch support--- i386---arm---... 3,configs--CONFIG_KPROBES --CONFIG_MODULES--CONFIG_M原创 2009-11-22 22:42:00 · 1450 阅读 · 0 评论 -
arp攻击
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #i转载 2009-09-18 12:54:00 · 735 阅读 · 0 评论 -
我理解i386的系统调用过程
linux系统调用函数少,陷入内核效率高,过程大概是这样的:1,初始化阶段,登录门描述符的处理:./arch/i386/kernel/traps.cvoid __init trap_init(void){...set_system_gate(SYSCALL_VECTOR,&system_call);...}2,程序中使用 int 0x80指令陷入内核,CPU切换原创 2008-12-26 09:42:00 · 830 阅读 · 0 评论 -
从内核调度想到的
最近重新读了《linux内核设计于实现》的进程调度章节,对于时间片的重新计算和多cpu的负载平衡,很受启发:1,分而治之。对复杂问题,把其分散到各个细小的环节去实现,降低了复杂度,性能上有所提升,也不容易出错。2,步步为营。这是从load_balance想到的,一步一步的脚踏实地的去完成一个功能。linux的2.6及其后续的内核,实现了O(1)的调度算法,这种调度算法选取可执行进程的时原创 2008-12-25 15:31:00 · 582 阅读 · 0 评论 -
Understanding the linux kernel-ch3-Process Switch
task switch原创 2008-07-01 20:56:00 · 562 阅读 · 0 评论 -
Understanding the linux kernel-ch3-Creating Processes
Traditional Unix systems copying the entire address space of the parent process原创 2008-07-01 20:59:00 · 562 阅读 · 0 评论 -
Understanding the linux kernel-ch4-Interrupts and Exceptions
An interrupt is usually defined as an event that alters the sequence of instructions executed by a processor原创 2008-07-01 21:19:00 · 565 阅读 · 0 评论