cppgp的专栏

私信 关注
cppgp
码龄14年
  • 80,223
    被访问量
  • 46
    原创文章
  • 81,143
    作者排名
  • 43
    粉丝数量
  • 于 2007-02-27 加入CSDN
获得成就
  • 获得6次点赞
  • 内容获得18次评论
  • 获得7次收藏
荣誉勋章
TA的专栏
  • Bootloader
    6篇
  • Linux Drivers
    1篇
  • Algorithms
    4篇
  • books-review
    1篇
  • 最近
  • 文章
  • 资源
  • 问答
  • 课程
  • 帖子
  • 收藏
  • 关注/订阅

程序员的自我修养 -- 链接、装载与库

首先声明,这是一本好书。:)-- 但是存在一些问题,也有可能是我理解的不够。。 ?2012.11.221.6.2 线程安全互斥量(Mutex)描述说,哪个线程获取了互斥量,哪个线程就要负责释放,其他线程越俎代庖去释放互斥量是无效的。---------------------------------这里说法是错误的,最起码针对Linux实现的pthread
原创
1224阅读
2评论
1点赞
发布博客于 9 年前

GNU Autotools (autoconf, automake, libtool, etc.) 自动化编译 (2) 多目录和动态链接库

0. 基础    先阅读GNU Autotools (autoconf, automake, libtool, etc.) 自动化编译 (1) 简单示例并成功执行、理解所说内容。1. 先提供一个脚本。拷贝所有内容保存为文件atdir.sh并添加可执行权限,然后执行。注意,最好不要以根用户身份执行它。#!/bin/shecho "Autotools for autotools
原创
2279阅读
2评论
4点赞
发布博客于 9 年前

GNU Autotools (autoconf, automake, libtool, etc.) 自动化编译 (1) 简单示例

0. 操作平台: Linux1. 软件包安装(Debian)yes | sudo apt-get install gcc make autoconf automake libtool2. 从一个例子谈起。    2.0 完整拷贝如下代码直接在终端执行或者保存为auto-example.sh,添加执行权限执行。或者参考2.1~2.5逐步执行。echo "creat
原创
3328阅读
1评论
3点赞
发布博客于 9 年前

Introduction to Algorithms 算法导论 第4章 递归式 学习笔记及习题解答

第4章 递归式主方法:         n=1:                T(n) = Θ(1)        n>1:                T(n) = aT(n/b) + Θ(n)   (a≥1, b>1)4.1 代换法1). 猜测解的形式2). 用数学归纳法找出使解真正有效的常数改变变量:T(n) = 2T(⌊n^(1/2)⌋)
原创
2441阅读
2评论
0点赞
发布博客于 9 年前

Introduction to Algorithms 算法导论 第3章 函数的增长 学习笔记及习题解答

3.1 渐近记号表示算法的渐近运行时间的记号是用定义域为自然数集N = {0, 1, 2, ...}的函数来定义的。这些记号用来表示最坏情况运行时间T(n)。Θ记号    Θ(g(n)) = {f(n): 存在正常数c1,c2和n0,使对所有的n≥n0,有0 ≤ c1*g(n) ≤ f(n) ≤ c2*g(n)}O记号    O(g(n)) = {f(n): 存在正常数c和
原创
2396阅读
0评论
0点赞
发布博客于 9 年前

Introduction to Algorithms 算法导论 第2章 算法入门 学习笔记及习题解答

2.1 插入排序插入排序解决的问题:    输入:n个数构成的序列    输出:排序输入序列为,满足a1' ≤ a2' ≤ ... ≤ an'伪码: INSERTION-SORT(A) for j <- 2 to length[A] do key <- A[j] i <- j - 1 whi
原创
5770阅读
3评论
5点赞
发布博客于 10 年前

Introduction to Algorithms 算法导论 第1章 基础知识 学习笔记及习题解答

什么是算法    定义良好的计算过程,取一个或者一组值作为输入,产生一个或一组输出值。1.1-1 给出一个真实世界的例子,其中包括着下列的某种计算问题:排序,确定多矩阵相乘的最佳顺序,或者找出凸壳。    排序:        这个是最常见的。比如:        某公司市场部季度销售额排名。        Alexa网站排名。(什么是Alexa?http:
原创
1664阅读
0评论
0点赞
发布博客于 10 年前

Introduction to Algorithms (算法导论) 学习笔记 -- Chapter 9

Chapter 9 Medians and Order Statistics (中位数和顺序统计)n个元素中查找最小或最大元素,需要进行n-1次比对。同时查找最小和最大的元素,最坏情况下需要进行⌈3n/2 - 2⌉次比较(⌈⌉为上取整)证明:对于n为奇数,初始设置min和max均为第一个元素,剩下n-1个元素为偶数,对于n为偶数,比对前两个元素,设置较小的为
原创
1313阅读
0评论
0点赞
发布博客于 10 年前

形形色色的计算机语言

PostScript(PS)        PostScript(PS)是主要用于电子产业和桌面出版领域的一种页面描述语言和编程语言。            http://en.wikipedia.org/wiki/PostScript            http://zh.wikipedia.org/zh-cn/PostScript
原创
766阅读
0评论
0点赞
发布博客于 10 年前

深入理解 GNU GRUB - 03 diskboot.S 3.3 diskboot.S详细注释

转载注明出处(cppgp: http://blog.csdn.net/cppgp)diskboot.S位于grub-1.98/boot/i386/pc/目录,采用AT&T汇编语法编写。详细注释如下:/* * GRUB -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2006,2007,2009,2010 Free Software Foundation, Inc. * * GRUB is fre
原创
2204阅读
1评论
0点赞
发布博客于 10 年前

深入理解 GNU GRUB - 03 diskboot.S 3.1 diskboot.S执行时的环境 & 3.2 diskboot.S代码结构

转载注明出处(cppgp: http://blog.csdn.net/cppgp)diskboot.S位于目录boot/i386/pc/,最终生成diskboot.img。这部分指令被加载到0x8000~0x81FF。diskboot.img加载GRUB内核到0x8200开始的内存位置,并将系统控制权交给GRUB内核。用到的BIOS例程和boot.S中相同。因此本章只描述如下内容:  1)    diskboot.S执行时的环境  2)    diskboot.S代码结构  3)    di
原创
1585阅读
0评论
0点赞
发布博客于 10 年前

深入理解 GNU GRUB - 02 boot.S 2.5 MBR过程模拟实现

2.5 MBR过程模拟实现现在,我们对系统引导的第一步已经有了一个详细的认识。为了更深一步的理解MBR和这些BIOS调用,提供一些测试题目:  1)    开机后在屏幕上输出”Hello cppgp”,并在一定时间后重复输出。  2)    开机后紧跟着读取第二个扇区,并且显示整个扇区512字节到屏幕上。实现上述功能,编译生成512字节的IMG文件,设置虚拟机通过软盘引导,选择使用软盘镜像文件,设置镜像文件为我们编译生成的IMG文件,就可进行测试。下文首先简单介绍虚拟机配置,然后实现上述
原创
1492阅读
0评论
0点赞
发布博客于 10 年前

深入理解 GNU GRUB - 02 boot.S 2.4 boot.S详细注释

grub 1.98 深入理解 boot.S 详细 注释
原创
2809阅读
0评论
1点赞
发布博客于 10 年前

深入理解 GNU GRUB - 02 boot.S 2.2 MBR结构 2.3 boot.S代码结构


转载注明出处(cppgp: http://blog.csdn.net/cppgp)
 
2.2 MBR结构
历史悠久的MBR结构自从IBM兼容PC出现以来一直就没变过(但是为支持2TiB以上硬盘而出现的GUID/EFI结构将更改MBR结构)。MBR结构分为三部分,分别是引导指令、分区表DPT (Disk Partition Table)、幻数Magic (Magic=0x55AA)。其中引导指令占用446字节(0~0x1BD),DPT占用64字节(0x1BE
原创
1784阅读
0评论
0点赞
发布博客于 10 年前

深入理解 GNU GRUB - 02 boot.S 2.1 相关BIOS例程

转载注明出处(cppgp: http://blog.csdn.net/cppgp)。2. boot.S: GRUB引导第一步boot.S位于目录boot/i386/pc/。这部分指令被加载到0x7C00~0x7DFF。主要工作包括:配置寄存器;设置堆栈;检测引导盘;检测引导盘读取模式;读取另一扇区指令。这个过程用到几个BIOS例程,并且对主引导记录(MBR, Master Boot Record)结构有很大的依赖。因此boot.S我们分作四步进行详细描述:1)    相关BIOS例程2)   
原创
2298阅读
0评论
0点赞
发布博客于 10 年前

深入理解 GNU GRUB - 01

1. 概述1.1 GRUB是什么GNU GRUB是一款多重引导程序。简单来讲,引导程序是计算机开机运行的第一个软件,它的使命是装载操作系统并运行。实际上,由于平台、存储介质、操作系统、文件系统等的多样性,引导程序都很复杂,同时,引导程序要求有更高安全性、健壮性。GNU GRUB支持多平台(例如X86、PowerPC等)、多存储介质(例如硬盘、软盘、光盘、U盘)、多操作系统(例如Linux、Gnu Hurd等)、多重引导(例如Windows等)、多文件系统(例如Ext2、Ext3、Ext4、FAT32
原创
3418阅读
0评论
1点赞
发布博客于 10 年前

Linux总线驱动-02: struct bus_type 结构体

本文测试系统为:Ubuntu 10.10 x86_64 2.6.35-24-generic上节中,除了简单的框架,我们还看到了一个和总线驱动相关的结构体bus_type。这个结构体的定义在include/linux/device.h中。本节先简单介绍结构体中的成员,再对每个成员作详细描述。struct bus_type { const char *name; struct bus_attribute *bus_attrs; struct device_attribute *dev_attrs;
原创
6589阅读
0评论
2点赞
发布博客于 10 年前

Linux总线驱动-01: 一个简单的示例

本文测试系统为:Ubuntu 10.10 x86_64 2.6.35-24-generic在新的驱动核心支持下,实现一个什么都不做的总线驱动是很简单的。如下,拷贝代码并保存为ycbus.c:/* * ycbus: a software bus driver (virtual bus driver) * * a trivial ycbus driver */#include #include struct bus_type ycbus_type = { .name
原创
6516阅读
1评论
0点赞
发布博客于 10 年前

C Reference Manual Reading Notes: 010 Definition and Replacement

1. synopsis     The #definepreprocessor command causes a name (identifier) to become defined as amacro to the preprocessor.  A sequences of tokens, called the body ofthe macro, is associat
原创
1226阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 009 Preprocessor Lexical Conventions

    The preprocessor does not parse the source text, but it doesbreak it up into tokens for the purpose of locating macro calls. Thelexical conventions of the preprocessor are somewhat different f
原创
591阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 008 The C Preprocessor and Preprocessor Commands

1. The C preprocessor    The C preprocessor is a simple macroprocessor that conceptually processes the source text of a C program before the compiler proper reads the source program. In some impleme
原创
474阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 007 C++ Compatibility

1. Character Sets    The token respelling and trigraphs inStandard C are part of the C++ Standard, but they are not common inpre-Standard C++ implementations. Boths C and C++ allow universalch
原创
451阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 006 Constants

    The lexical class of constants includes four different kinds of constants: integers, floating-point numbers, characters, and strings. Suck tokens are called literals in other languages to distingu
原创
442阅读
0评论
0点赞
发布博客于 12 年前

Reset the password of linux fedora

1. power the computer and into grub-select-face.2. select the OS and input e         Fedora (...)         Ubunto(...)         Windows3. select line which begin with "kernel" and input ch
原创
447阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 005 Tokens ( Without Constants )

    Five classes of tokens: operators, separators, identifiers, keywords, and constants.     (1) operators and separators.             ! % ^ & * - + = ~ | . / ?             += -= *= /= %=  
原创
371阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 004 Comments

    Standard C supported two stylized comments:      (1) Begin with the two characters /* and ends with the first subsequent occurence of the two characters */.      (2) Begin with the characters
原创
411阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 003 Multibyte and Wide Characters

    To accommodate non-english alphabets that may contain a large number of characters, Standard C introduces wide characters and wide strings.  To present wide characters and wide strings in the exte
原创
400阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 002 Whitespace, Line Termination, and Lines Length Limits

   The blank(space), end-of-line, VT, FF, HT, and comments are known collectively as whitespace character (WSC). These characters are ignored except insofar as they are used to separate adjacent token
原创
349阅读
0评论
0点赞
发布博客于 12 年前

C Reference Manual Reading Notes: 001 Character set

1. CHARACTER SET    A C source file is a sequence ofcharacters selected from a character. C programs are written using thefollowing characters:   1). the 52 Latin capital and small letters: A~
原创
711阅读
0评论
0点赞
发布博客于 12 年前

TCP/IP Illustrated Volume 1.chm

TCP/IP 详解卷一英文版。CHM格式。TCP/IP网络编程必备书籍。国际知名的Unix和网络专家 W.Richard Stevens 作品。
application/octet-stream
发布资源于 12 年前

CSS Study Notes 1: CSS Import Method

 1. The link tag     example:      rel="stylesheet" type="text/css" href="import.css" />
原创
1055阅读
0评论
0点赞
发布博客于 12 年前

emacs 基本操作指令整理(1)

-x -f              -x find-file                             查找文件并在新缓冲区打开-x -v             -x find-alternate-file            查找另外一个文件替换掉当前已读入的文件-x i                                  -x insert-file 
原创
446阅读
0评论
0点赞
发布博客于 12 年前

starDict 在 window 下的安装

1. 到 http://stardict.sourceforge.net/download.php 下下载 exe 文件。我下载的 stardict-3.0.2.exe 2. 到 http://stardict.sourceforge.net/Dictionaries_zh_CN.php 下面下载词典。下载 tarbal 的即可。词典很多,选择自己喜欢的下载。 3. 用 win
原创
638阅读
0评论
0点赞
发布博客于 12 年前

动态库查找路径设置

一直在用 LD_LIBRARY_PATH 设置动态苦查找路径在开发时使用。今天设置后不起作用,想了半天才想起来需要 export。记此一笔: [sh]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`
原创
518阅读
0评论
0点赞
发布博客于 12 年前

fedora10 启用 Win+D 显示桌面

在 windows 下习惯了 win+D 键实现显示桌面。因此在 fedora10 下也设置下: fedora10 显示桌面默认快捷方式是 ++D。现更改为 +D 。如下: 1. 如果没安装 gconf-editor,则先安装: yum install gconf-editor 2. shell 下运行 gconf-editor 命令或者 执行 “Applications
原创
611阅读
0评论
0点赞
发布博客于 12 年前

fedora10 yum install 错误:Package *.rpm is not signed

不知道是否是因为关闭了 selinux 的原因,突然间在使用 yum 安装时出现如下错误: Package *.rpm is not signed*.rpm 为应用程序包 解决方案是:更改 /etc/yum.conf 下的 gpgcheck=1 为 gpgcheck=0 关于 yum.conf 的详细可参考 man yum.conf。其中对 gpgcheck 的描述是:
原创
3350阅读
0评论
0点赞
发布博客于 12 年前

fedora10 amsn 出现 tls 模块无法工作的错

安装 amsn 后运行,出现 tls 无法通过 selinux 的错误。我通过 chcon 添加了属性(通过 ls -Z 可查看相关属性):[root@localhost]# ls -Z /lib/* | less-rwxr-xr-x  root root system_u:object_r:lib_t:s0       /lib/libcap.so.2.10// ...[root
原创
463阅读
0评论
0点赞
发布博客于 12 年前

fedora 下的词典:stardict

习惯了 windows 下使用 xdict。不过觉得 stardict 也挺好用的: [root@localhost]# yum install stardict 然后到 http://stardict.sourceforge.net/Dictionaries_zh_CN.php 下载词典 rpm。我下载了去全不能下载的然后用 yum install staridct-* 进行了安
原创
1714阅读
1评论
0点赞
发布博客于 12 年前

fedora 下给 firefox 安装 adobe flash player 插件

使用 yum、rpm 等尝试安装了一遍。全部失败(firefox查找不到)其实最简单的方式就是下载 .tar.gz 包,然后解压缩,移动文件 libflashplayer.so  到 ~/.mozilla/plugins/ 即可
原创
1399阅读
0评论
0点赞
发布博客于 12 年前

fedora pdf 和 chm 软件安装

pdf:evinvechm: gnochm直接用 yum install application_name 安装即可。
原创
656阅读
0评论
0点赞
发布博客于 12 年前

fedora 中文输入问题

新安装的 fedora10 无法输入中文。解决方案如下: 1. 选择 “System --> Preferences --> Personal --> Input Method” 2. 选中 Enable input method feature 3. 点击 Input Method Preferences 进入 SCIM 配置界面 4. FrontEnd 项 Gl
原创
486阅读
0评论
0点赞
发布博客于 12 年前

locate 错误

 新安装完 fedora 后,locate 命令出现如下错误:    locate: can not open `/var/lib/mlocate/mlocate.db: No such file or directory 此错误和 locate 的工作方式相关。man locate 可获取详细信息。解决方法是执行 updatedb 命令。需要超级用户权限。   [root@lo
原创
482阅读
0评论
0点赞
发布博客于 12 年前

fedora 安装

最近重新安装了一遍 windows Xp / fedora10,整理下安装过程: 1. 安装 windows XP。设置了三个盘,分别是C、D、E。C、D是NTFS格式,E盘是FAT32格式。 2. 下载最新 fedora  的 ISO文件到E盘。可以到 http://fedoraproject.org/ 获得最新(以及各种版本)的 fedora。采用 Daemon tools 虚
原创
608阅读
0评论
0点赞
发布博客于 12 年前

GCC编译 --- 起步

    本文适用于Linux下开发初学者。本文初步讲解在Linux下如何使用GCC编译程序、简单生成静态库及动态库。一、关于安装。一般系统默认是安装好编译器的,并且网络上有大量资料介绍不同发行版本下的安装问题,本文不再描述。二、C编程中的文件后缀名介绍    .a 静态库(打包文件)    .c 未经过预处理的C源码    .h C头文件      .i 经过预处理的C源码   
原创
904阅读
0评论
0点赞
发布博客于 13 年前

grub2 1.95 源码分析之一 —— boot.S 分析及注释

/* -*-Asm-*- *//* *  GRUB  --  GRand Unified Bootloader *  Copyright (C) 1999,2000,2001,2002,2005,2006  Free Software Foundation, Inc. * *  This program is free software; you can redistribute it and/o
原创
6055阅读
5评论
0点赞
发布博客于 13 年前

STL源码分析之一 : 迭代器详解

Author : cppgpTime : 2007-09-26本系列文章将会尽可能的剖析STL实现细节。本文假定读者对象是热爱GP编程、希望探究STL实现的程序员。本系列不适合STL初学者。[本篇分析STL迭代器,在文章最后给出一个拥有迭代器和常用操作的仿STL实现的单链表源码]1.概述 《Design Patterns》中iterator模式的定义如下:提供一种方法,使之能够依序寻访
原创
2144阅读
0评论
0点赞
发布博客于 14 年前

Effective_STL(中文版)

不用多说了,进阶STL的经典教程
application/octet-stream
发布资源于 14 年前

C++ template 的 type traits 代码

//Author : cppgp//Email  : cppgp@163.com//Time   : 2007 03 08//功能 : 测试 C++ template 的 traits 技巧//版权 : 可任意转载、修改、使用,转载注明原作者姓名//vc 6.0 下必须去掉 label_traits 的特化版本才能通过编译链接//gcc  下面 label_traits 特化版本测试通过
原创
1221阅读
0评论
0点赞
发布博客于 14 年前