2006年04月27日 星期四

司马懿老大在曹操追悼会上跟兄弟们做讲话(zz)

兄弟们:

  这次曹老大的不幸逝世,兄弟们都很难过。记得曹老大当年说过:“曹丕啊,市心街这一带的地盘现在是我的,但最终还是你的。”今天,兄弟们想起这番话,觉得曹老大的音容笑貌好像还在眼前。

  兄弟们,你们要知道,我们市心街这一带地盘来得不容易,是曹老大带着许楮、典韦等十几个马仔脑袋别在裤裆里砍出来的。大家一定要珍惜。

  老大生平最后悔的一件事就是当年没看出刘备这小子的狼子野心——当初他只是个街头小混混,现在居然在城西划地盘也当起老大来了;还有孙权……当局已经形同虚设不在话下了——现在整个城都是曹、刘、孙三大黑社会势力的。曹老大亲口说:你们什么时候想废了当局就废了他好了,关键是要小心城东和城西的两个黑社会。尤其是城西的刘备。刘备手下一帮马仔个个都是不要命的。他手下这几个人你一定要认识:

  头一个就是赵云,绰号白皮。过去是北郊老头公孙瓒的人,早年跳槽给刘备卖命,是刘备的老四。曾经在长坂坡一个人用一把马刀杀出一条街,暴强!那次来回砍了七趟,根本不把我们的弟兄放在眼里。我们的弟兄高览、夏侯兰就都死在他的手里。

  第二个叫张飞,绰号黑三。出道前因为卖注水猪肉、拒捕和袭警被判过两年牢。刘备将他保释出狱后就死心塌地跟着刘备干。嗜好是喝二锅头,自称从来没醉过。前几年在当阳桥主题公园的万人喊叫大赛中获第一名,此后自称暴强。此人心狠手辣,一般不出手,出手必不留活口。

  第三个叫关羽,绰号胡子。本姓冯,在大陆杀人后潜逃到此,隐名埋姓。被刘备发现后收为老二。据说早年和拜月夜总会的小姐貂禅有一腿。(那貂禅我以前也见过,是立法院长王允的秘书,后来给最早的刑满释放人员董老大拍上了,董老大被自己的马仔砍死在街上以后,才出来坐台的。)此人开一辆红色宝马,枪法极准,绝对一枪一个,全城没有人不知道他的。还好去年在和城东老大孙权争地盘时,被孙权家的吕蒙带着七十几个人砍死了。

  第四个叫诸葛亮。这个人是最难对付的。虽然腿有残疾,常年坐一轮椅,却神出鬼没,诡计多端。早年参加过鬼谷子的恐怖组织,是其骨干。当年震惊全国的博望坡纵火案、新野县纵火案和赤壁纵火案就是他一手策划的。我们老老大差点死在他的手里。城西原来是刘璋的地盘,都被他吃过来送给了刘备。所以刘备格外器重他,把赵云配给他作保镖。最近他和赵云形影不离,碰到他最好躲远点。

  另外,孙权手下的吕蒙、陆逊也都不是吃干饭的角色。新老大要当全城的老大,就一定要先除掉这几个人。要除掉这几个人就一定要靠兄弟们。只要新老大把兄弟们当人看,兄弟们就给新老大卖命!

由 beat 发表于 下午03点59分 | 回复 (0)

DEBUG命令详解(zz)

Debug:A(汇编)


直接将 8086/8087/8088 记忆码合并到内存。

该命令从汇编语言语句创建可执行的机器码。所有数值都是十六进制格式,必须按一到四个字符输入这些数值。在引用的操作代码(操作码)前指定前缀记忆码。


a [address]


参数

address

指定键入汇编语言指令的位置。对 address 使用十六进制值,并键入不以“h”字符结尾的每个值。如果不指定地址,a 将在它上次停止处开始汇编。

有关将数据输入到指定字节中的信息,请单击“相关主题”列表中的 Debug E(键入)。

有关反汇编字节的信息,请单击“相关主题”列表中的 Debug U(反汇编)。


说明

使用记忆码

段的替代记忆码为 cs:、ds:、es: 和 ss:。远程返回的记忆码是 retf。字符串处理的记忆码必须明确声明字符串大小。例如,使用 movsw 可以移动 16 位的字串,使用 movsb 可以移动 8 位字节串。


汇编跳转和调用

汇编程序根据字节替换自动将短、近和远的跳转及调用汇编到目标地址。通过使用 near 或 far 前缀可以替代这样的跳转或调用,如下例所示:

-a0100:0500
0100:0500 jmp 502 ; a 2-byte short jump
0100:0502 jmp near 505 ; a 3-byte near jump
0100:0505 jmp far 50a ; a 5-byte far jump

可以将 near 前缀缩写为 ne。


区分字和字节内存位置

当某个操作数可以引用某个字内存位置或者字节内存位置时,必须用前缀 word ptr 或者前缀 byte ptr 指定数据类型。可接受的缩写分别是 wo 和 by。以下范例显示两种格式:

dec wo [si]
neg byte ptr [128]


指定操作数

Debug 使用包括在中括号 ([ ]) 的操作数引用内存地址的习惯用法。这是因为另一方面 Debug 不能区分立即操作数和内存地址的操作数。以下范例显示两种格式:

mov ax,21 ; load AX with 21h
mov ax,[21] ; load AX with the
; contents of
; memory location 21h


使用伪指令

使用 a 命令提供两个常用的伪指令:db 操作码,将字节值直接汇编到内存,dw 操作码,将字值直接汇编到内存。以下是两个伪指令的范例:

db 1,2,3,4,"THIS IS AN EXAMPLE"
db 'THIS IS A QUOTATION MARK:"'
db "THIS IS A QUOTATION MARK:'"
dw 1000,2000,3000,"BACH"


范例

a 命令支持所有形式的间接注册命令,如下例所示:

add bx,34[bp+2].[si-1]
pop [bp+di]
push [si] )

还支持所有操作码同义词,如下例所示:

loopz 100
loope 100
ja 200
jnbe 200

对于 8087 操作码,必须指定 wait 或 fwait 前缀,如下例所示:

fwait fadd st,st(3) ; this line assembles
; an fwait prefix


Debug:C(比较)


比较内存的两个部分。


c range address


参数

range

指定要比较的内存第一个区域的起始和结束地址,或起始地址和长度。有关有效的 range 值的信息,请单击“相关主题”列表中的“Debug 说明”。

address

指定要比较的第二个内存区域的起始地址。有关有效 address 值的信息,请单击“相关主题”列表中的“Debug 说明”。


说明

如果 range 和 address 内存区域相同,Debug 将不显示任何内容而直接返回到 Debug 提示符。如果有差异,Debug 将按如下格式显示:
address1 byte1 byte2 addess2

范例

以下命令具有相同效果:

c100,10f 300
c100l10 300

每个命令都对 100h 到 10Fh 的内存数据块与 300h 到 30Fh 的内存数据块进行比较。

Debug 响应前面的命令并显示如下信息(假定 DS = 197F):

197F:0100 4D E4 197F:0300
197F:0101 67 99 197F:0301
197F:0102 A3 27 197F:0302
197F:0103 35 F3 197F:0303
197F:0104 97 BD 197F:0304
197F:0105 04 35 197F:0305
197F:0107 76 71 197F:0307
197F:0108 E6 11 197F:0308
197F:0109 19 2C 197F:0309
197F:010A 80 0A 197F:030A
197F:010B 36 7F 197F:030B
197F:010C BE 22 197F:030C
197F:010D 83 93 197F:030D
197F:010E 49 77 197F:030E
197F:010F 4F 8A 197F:030F

注意列表中缺少地址 197F:0106 和 197F:0306。这表明那些地址中的值是相同的。


Debug:D(转储)


显示一定范围内存地址的内容。


d [range]


参数

range

指定要显示其内容的内存区域的起始和结束地址,或起始地址和长度。有关有效的 range 值的信息,请单击“相关主题”列表中的“Debug 说明”。如果不指定 range,Debug 程序将从以前 d 命令中所指定的地址范围的末尾开始显示 128 个字节的内容。

有关显示寄存器内容的信息,请单击“相关主题”列表中的 Debug R(寄存器)。


说明
当使用 d 命令时,Debug 以两个部分显示内存内容:十六进制部分(每个字节的值都用十六进制格式表示)和 ASCII 码部分(每个字节的值都用 ASCII 码字符表示)。每个非打印字符在显示的 ASCII 部分由句号 (.) 表示。每个显示行显示 16 字节的内容,第 8 字节和第 9 字节之间有一个连字符。每个显示行从 16 字节的边界上开始。

范例
假定键入以下命令:
dcs:100 10f
Debug 按以下格式显示范围中的内容:
04BA:0100 54 4F 4D 00 53 41 57 59-45 52 00 00 00 00 00 00 TOM.SAWYER......
如果在没有参数的情况下键入 d 命令,Debug 按以前范例中所描述的内容来编排显示格式。显示的每行以比前一行的地址大 16 个字节(如果是显示 40 列的屏幕,则为 8 个字节)的地址开头。
对于后面键入的每个不带参数的 d 命令,Debug 将紧接在最后显示的命令后立即显示字节内容。
如果键入以下命令,Debug 将从 CS:100 开始显示 20h 个字节的内容:
dcs:100 l 20
如果键入以下命令,Debug 将显示范围从 CS 段的 100h 到 115h 中所有字节的内容:
dcs:100 115

Debug:E(键入)

将数据输入到内存中指定的地址。
可以按十六进制或 ASCII 格式键入数据。以前存储在指定位置的任何数据全部丢失。

e address [list]

参数
address
指定输入数据的第一个内存位置。
list
指定要输入到内存的连续字节中的数据。
有关集成记忆码的信息,请单击“相关主题”列表中的 Debug A(汇编)。
有关显示内存部分内容的信息,请单击“相关主题”列表中的 Debug D (转储)。

说明

使用 address 参数

如果在没有指定可选的 list 参数的值情况下指定 address 的值,Debug 将显示地址和内容,在下一行重复地址,并等待您的输入。此时,您可以执行下列操作之一:

替换字节值。为此,请在当前值后键入新值。如果您键入的值不是有效的十六进制值,或该值包含两个以上的数字,则 Debug 不会回显无效或额外的字符。
进入下一个字节。为此,请按 SPACEBAR(空格键)。要更改该字节中的值,请在当前值后键入新值。如果按 SPACEBAR(空格键)时,移动超过了 8 位界限,Debug 程序将显示新的一行并在行首显示新地址。
返回到前一个字节。为此,请按 HYPHEN 键 (-)。可以反复按 HYPHEN 键 (-) 向后移动超过多个字节。在按 HYPHEN 时,Debug 开始新行并显示当前地址和字节值。
停止执行 e 命令。为此,请按 ENTER 键。在任何字节位置都可以按 ENTER。
使用 list 参数

如果指定 list 参数的值,随后的 e 命令将使用列表中的值替换现有的字节值。如果发生错误,将不更改任何字节值。

List 值可以是十六进制字节或字符串。使用空格、逗号或制表符来分隔值。必须将字符串包括在单或双引号中。

范例

假定键入以下命令:

ecs:100

Debug 按下面的格式显示第一个字节的内容:

04BA:0100 EB.

要将该值更改为 41,请在插入点键入 41,如下所示:

04BA:0100 EB.41_

可以用一个 e 命令键入连续的字节值。在键入新值后按 SPACEBAR(空格键),而不是按 ENTER 键。Debug 显示下一个值。在此范例中,如果按三次 SPACEBAR(空格键),Debug 将显示下面的值:

04BA:0100 EB.41 10. 00. BC._

要将十六进制值 BC 更改为 42,请在插入点键入 42,如下所示:

04BA:0100 EB.41 10. 00. BC.42_

假定决定值 10 应该是 6F。要纠正该值,请按 HYPHEN 键两次以返回到地址 0101(值 10)。Debug 显示以下内容:

04BA:0100 EB.41 10. 00. BC.42-
04BA:0102 00.-
04BA:0101 10._

在插入点键入 6f 更改值,如下所示:

04BA:0101 10.6f_

按 ENTER 停止 e 命令并返回到 Debug 提示符下。

以下是字符串项的范例:

eds:100 "This is the text example"

该字符串将从 DS:100 开始填充 24 个字节

Debug:F(填充)

使用指定的值填充指定内存区域中的地址。

可以指定十六进制或 ASCII 格式表示的数据。任何以前存储在指定位置的数据将会丢失。


f range list


参数

range

指定要填充内存区域的起始和结束地址,或起始地址和长度。关于有效的 range 值的信息,请单击“相关主题”列表中的“Debug 说明”。

list

指定要输入的数据。List 可以由十六进制数或引号包括起来的字符串组成。


说明

使用 range 参数

如果 range 包含的字节数比 list 中的数值大,Debug 将在 list 中反复指派值,直到 range 中的所有字节全部填充。

如果在 range 中的任何内存损坏或不存在,Debug 将显示错误消息并停止 f 命令。


使用 list 参数

如果 list 包含的数值多于 range 中的字节数,Debug 将忽略 list 中额外的值。


范例

假定键入以下命令:

f04ba:100l100 42 45 52 54 41

作为响应,Debug 使用指定的值填充从 04BA:100 到 04BA:1FF 的内存位置。Debug 重复这五个值直到 100h 个字节全部填满为止。


Debug:G(转向)


运行当前在内存中的程序。


g [=address] [breakpoints]


参数

=address

指定当前在内存中要开始执行的程序地址。如果不指定 address,Windows 2000 将从 CS:IP 寄存器中的当前地址开始执行程序。

breakpoints

指定可以设置为 g 命令的部分的 1 到 10 个临时断点。

有关执行循环、重复的字符串指令、软件中断或子程序的信息,请单击“相关主题”列表中的 Debug P(执行)。

有关执行指令的信息,请单击“相关主题”列表中的 Debug T(跟踪)。

Debug:H(十六进制)

对指定的两个参数执行十六进制运算。


h value1 value2


参数

value1

代表从 0 到 FFFFh 范围内的任何十六进制数字。

value2

代表从 0 到 FFFFh 范围内第二个十六进制数字。


说明

Debug 首先将指定的两个参数相加,然后从第一个参数中减去第二个参数。这些计算的结果显示在一行中:先计算和,然后计算差。


范例

假定键入以下命令:

h19f 10a

Debug 执行运算并显示以下结果。
02A9 0095

Debug:I(输入)


从指定的端口读取并显示一个字节值。

i port

参数

port

按地址指定输入端口。地址可以是 16 位的值。

有关将字节值发送到输出端口的信息,请单击“相关主题”列表中的 Debug O(输出)。


范例

假定键入以下命令:

i2f8

同时假定端口的字节值是 42h。Debug 读取该字节,并将其值显示如下:
42


Debug:L(加载)

将某个文件或特定磁盘扇区的内容加载到内存。

要从磁盘文件加载 BX:CX 寄存器中指定的字节数内容,请使用以下语法:

l [address]

要略过 Windows 2000 文件系统并直接加载特定的扇区,请使用以下语法:

l address drive start number


参数

address

指定要在其中加载文件或扇区内容的内存位置。如果不指定 address,Debug 将使用 CS 寄存器中的当前地址。

drive

指定包含读取指定扇区的磁盘的驱动器。该值是数值型:0 = A, 1 = B, 2 = C 等。

start

指定要加载其内容的第一个扇区的十六进制数。

number

指定要加载其内容的连续扇区的十六进制数。只有要加载特定扇区的内容而不是加载 debug 命令行或最近的 Debug n(名称)命令中指定的文件时,才能使用 drive、start 和 number 参数。

有关指定用于 l 命令的文件的信息,请单击“相关主题”列表中的 Debug n(名称)。

有关写入调试到磁盘的文件的信息,请单击“相关主题”列表中的 Debug w(写入)。


注意

使用不带参数的 l 命令

当使用不带参数的 l 命令时,在 debug 命令行上指定的文件将加载到内存中,从地址 CS:100 开始。Debug 同时将 BX 和 CX 寄存器设置为加载的字节数。如果不在 debug 命令行指定文件,所装入的文件将是最近使用 n 命令经常指定的文件。


使用具有 address 参数的 1 命令

如果使用带 address 参数的 l 命令,Debug 将从内存位置 address 开始加载文件或指定扇区的内容。


使用带全部参数的 l 命令

如果使用带所有参数的 l 命令,Debug 将加载指定磁盘扇区的内容而不是加载文件。


加载特定扇区的内容

指定范围内的每个扇区均从 drive 读取。Debug 从 start 开始加载,直到在 number 中指定的扇区数中的内容全部被加载。


加载 .exe 文件

Debug 忽略 .exe 文件的地址 address 参数。如果指定 .exe 文件,Debug 将文件重新定位到 .exe 文件的标题中指定的加载地址。在 .exe 文件被加载到内存前,标题自身从 .exe 文件脱离,因此磁盘上的 .exe 文件大小与内存中的不同。如果要检查整个 .exe 文件,请使用不同的扩展名重命名文件。


打开十六进制文件

Debug 将具有 .hex 扩展名的文件认为十六进制格式文件。键入不带参数的 l 命令,可以加载从十六进制文件中指定的地址处开始的十六进制文件。如果键入的 l 命令包含 address 参数,Debug 将把指定的地址加到在十六进制文件中找到的地址上,以确定起始地址。


范例

假定启动 Debug 并键入以下命令:

nfile.com

现在可以键入 l 命令以加载 File.com。Debug 将加载文件并显示 Debug 提示符。

假定需要从驱动器 C 将起始逻辑扇区为 15 (0Fh) 的 109 (6Dh) 个扇区的内容加载到起始地址为 04BA:0100 的内存中。为此,请键入以下命令:
l04ba:100 2 0f 6d


Debug:M(移动)

将一个内存块中的内容复制到另一个内存块中。

m range address


参数

range

指定要复制内容的内存区域的起始和结束地址,或起始地址和长度。

address

指定要将 range 内容复制到该位置的起始地址。

说明

复制操作对现有数据的影响

如果新数据没有写入正在被复制的数据块中的地址,则源数据将保持不变。但是,如果目标块已经包含数据(就象它在覆盖副本操作中一样),则将改写该数据。(覆盖复制操作是指那些目标数据块部分内容覆盖原数据块部分内容的操作。)


执行覆盖复制操作

m 命令执行目标地址的覆盖复制操作,而不丢失数据。将改写的地址内容首先复制。因此,如果将较高位地址的数据复制到较低位地址,则复制操作从原块的最低位地址开始并向最高位地址进行。反之,如果要将数据从低地址复制到高地址,复制操作从原块的最高地址开始,向最低地址进行。


范例

假定键入以下命令:

mcs:100 110 cs:500
Debug 首先将 CS:110 地址中的内容复制到地址 CS:510 中,然后将 CS:10F 地址中的内容复制到 CS:50F 中,如此操作直至将 CS:100 地址中的内容复制到地址 CS:500 中。要查看结果,请使用 Debug d(转储)命令,并使用 m 命令指定目标地址

Debug:N(名称)

指定 Debug l(加载)或 w(写入)命令的可执行文件的名称,或者指定正在调试的可执行文件的参数。


n [drive:][path] filename


要指定测试的可执行文件的参数,请使用以下语法:

n file-parameters


参数

如果在没有参数的情况下使用,则 n 命令清除当前规范。
[drive:][path] filename

指定要测试的可执行文件的位置和名称。

file-parameters

为正在测试的可执行文件指定参数和开关。

有关将文件或指定磁盘扇区的内容加载到内存中的信息,请单击“相关主题”列表中的 Debug L(加载)。

有关写入调试到磁盘的文件的信息,请单击“相关主题”列表中的 Debug W(写入)。


说明

n 命令的两个用途

可以按两种方式使用 n 命令。首先,您可以使用它以指定后面的 l(加载)或 w(写入)命令所使用的文件。如果在没有命名所调试文件的情况下启动 Debug,必须在使用 l 命令加载文件之前使用命令 nfilename。在 CS:5C 为文件控制块 (FCB) 正确编排文件名的格式。其次,可以使用 n 命令指定被调试文件的命令行参数和开关。


内存区域

以下四个内存区域都会受到 n 命令的影响:

内存位置
内容

CS:5C
文件 1 的文件控制数据块 (FCB)

CS:6C
文件 2 的文件控制数据块 (FCB)

CS:80
n 命令行的长度(以字符表示)

CS:81
n 命令行字符的开头


为 n 命令指定的第一个文件名被放在 CS:5C 的 FCB 中。如果指定第二个文件名,此名称将放置到 CS:6C 的 FCB 中。n 命令行上键入的字符数(除第一个字符之外,n)存储在位置 CS:80。n 命令行上的实际字符(再次,除了字母 n 之外)存储在以 CS:81 开头的位置。注意这些字符可以是在 Windows 2000 命令提示符下键入的命令中有效的任何开关和分隔符。

范例

假定已经启动 Debug,并加载了正在调试的程序 Prog.com。接着您决定为 Prog.com 指定两个参数并运行此程序。以下是此范例的命令序列:

debug prog.com
nparam1 param2
g

在这种情况下,Debug g(转向)命令会运行该程序,就好像您已在 Windows 2000 命令提示符后键入了如下命令:

prog param1 param2

所以,测试和调试反映 Prog.com 通常的运行时间环境。

在下面的命令序列中,第一个 n 命令将 File1.exe 指定为后接的 l(加载)命令的文件,该命令将 File1.exe 加载到内存。第二个 n 命令指定 File1.exe 将使用的参数。最后,g 命令将运行 File1.exe 文件,就好像您在 Windows 2000 命令行中键入了 File1 File2.dat File2.dat 一样。

nfile1.exe
l
nfile2.dat file3.dat
g

注意
不要在 n 命令的第二种形式后使用 l 命令。还要注意,如果现在使用 w(写入)命令,Windows 2000 将使用名称 File2.dat 保存正在调试的文件 File1.exe。为避免出现此结果,应该总是在 l 或 w 命令之前立即使用 n 命令的第一种形式。

Debug:O(输出)

将字节值发送到输出端口。


o port byte-value


参数

port

通过地址指定输出端口。端口地址可以是 16 位值。

byte-value

指定要指向 port 的字节值。

有关从输入端口读取字节值的信息,请单击“相关主题”列表中的 Debug I(输入)。

范例

要将字节值 4Fh 发送到地址为 2F8h 的输出端口,请键入以下命令:
o2f8 4f

Debug:P(执行)

执行循环、重复的字符串指令、软件中断或子例程;或通过任何其他指令跟踪。


p [= address] [number]


参数

=address

指定第一个要执行指令的位置。如果不指定地址,则默认地址是在 CS:IP 寄存器中指定的当前地址。

number

指定在将控制返回给 Debug 之前要执行的指令数。默认值为 1。

有关运行当前在内存中程序的信息,请单击“相关主题”列表中的 Debug G(转向)。

有关执行指令的信息,请单击“相关主题”列表中的 Debug T(跟踪)。


说明
控制传送到要测试的程序

当 p 命令将控制从 Debug 传送到要测试的程序时,该程序不间断运行,直到循环、重复字符串指令、软件中断或者完成了指定地址的子例程为止,或者直到执行了指定数量的机器指令为止。控制返回到 Debug。

地址参数的限制

如果 address 参数没有指定段,Debug 将使用被测试程序的 CS 寄存器。如果省略 address,程序将从 CS:IP 寄存器所指定的地址开始执行。必须在 address 参数之前使用等号 (=) 以便将它与 number 参数区分。如果在指定地址处的指令不是循环、重复的字符串指令、软件中断或子例程,则 p 命令与 Debug t(跟踪)命令的作用相同。

使用 p 命令显示的邮件

当 p 执行完一段说明后,Debug 显示出程序的寄存器内容、标志的状态以及下一段将要被执行的指令的解码形式。


警告

不能使用 p 命令跟踪只读内存 (ROM)。

范例

假定正在测试的程序在地址 CS:143F 处包含一个 call 指令。要运行 call 目标位置的子程序然后将控制返回到 Debug,请键入以下命令:

p=143f

Debug 按以下格式显示结果:
AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=2246 ES=2246 SS=2246 CS=2246 IP=1443 NV UP EI PL NZ AC PO NC
2246:1442 7505 JNZ 144A

Debug:Q(退出)

停止 Debug 会话,不保存当前测试的文件。

当您键入 q 以后,控制返回到 Windows 2000 的命令提示符。


q


参数

该命令不带参数。
有关保存文件的信息,请单击“相关主题”列表中的 Debug W(写入)。

Debug:R(寄存器)


显示或改变一个或多个 CPU 寄存器的内容。


r [register-name]


参数

如果在没有参数的情况下使用,则 r 命令显示所有寄存器的内容以及寄存器存储区域中的标志。

register-name

指定要显示其内容的寄存器名。

有关显示内存部分内容的信息,请单击“相关主题”列表中的 Debug D(转储)。

有关反汇编字节的信息,请单击“相关主题”列表中的 Debug U(反汇编)。


说明

使用 r 命令

如果指定了寄存器名称,Windows 2000 将显示以十六进制标记表示的寄存器的 16 位值,并将冒号显示为提示符。如果要更改包含在寄存器中的值,除非键入新值并按 ENTER 键;否则,请按 ENTER 键返回 Debug 提示符。

有效寄存器名

以下是 register-name 的有效值:ax、bx、cx、dx、sp、bp、si、di、ds、es、ss、cs、ip、pc 及 f。ip 和 pc 都引用指令指针。

如果指定寄存器名称,而不是从前面的列表中指定,Windows 2000 将显示以下消息:

br error

使用 f 字符而不是寄存器名

如果键入 f 字符代替寄存器名,Debug 将每个标记的当前设置显示为两字母代码,然后显示 Debug 提示符。要更改标志的设置,请从下表中键入适当的两字母代码:

标志名
设置
清除

溢出
ov
nv

方向
dn(减)
up(增)

中断
ei(启用)
di(禁用)

正负
ng(负)
pl(正)


zr
nz

辅助进位
ac
na

奇偶校验
pe(偶校验)
po(奇校验)

进位
cy
nc


可以按任何顺序键入新的标志值。不需要在这些值之间留出空格。要停止 r 命令,请按 ENTER 键。任何没有指定新值的标志保持不变。

用 r 命令显示的邮件

如果为标记指定了多个值,Debug 将显示以下消息:

df error

如果指定没有在前面的表中列出的标志代码,Debug 将显示以下消息:

bf error

在这两种情况下,Debug 将忽略所有在无效项目之后指定的设置。

Debug 的默认设置

在启动 Debug 时,会将段寄存器设置到空闲内存的低端,指令指针设置为 0100h,清除所有标志,并且将其余寄存器设置为零,除了被设置为 FFEEh 的 sp 之外。

Debug:R


范例

要查看所有寄存器的内容、所有标记的状态和当前位置的指令解码表,请键入以下命令:

r

如果当前位置是 CS:11A,显示外观将类似于以下内容:

AX=0E00 BX=00FF CX=0007 DX=01FF SP=039D BP=0000 SI=005C DI=0000
DS=04BA ES=04BA SS=04BA CS=O4BA IP=011A NV UP DI NG NZ AC PE NC
04BA:011A CD21 INT 21

要只查看标志的状态,请键入以下命令:

rf

Debug 按以下格式显示信息:

NV UP DI NG NZ AC PE NC - _

现在,您可以按任意顺序键入一个或多个有效的标志值,其中可以有或没有空格,如下所示:

nv up di ng nz ac pe nc - pleicy

Debug 结束 r 命令并显示 Debug 提示符。要查看更改,请键入 r 或 rf 命令。Debug 将显示以下内容:

NV UP EI PL NZ AC PE CY - _
按 ENTER 返回到 Debug 提示符。

Debug:S(搜索)

在某个地址范围搜索一个或多个字节值的模式。


s range list


参数

range

指定要搜索范围的开始和结束地址。有关 range 参数有效值的信息,请单击“相关主题”列表中的 Debug。

list

指定一个或多个字节值的模式,或要搜索的字符串。用空格或逗号分隔每个字节值和下一个字节值。将字符串值包括在引号中。


说明

如果 list 参数包含多个字节值,Debug 将只显示出现字节值的第一个地址。如果 list 只包含一个字节值,Debug 将显示指定范围内出现该值的所有地址。


范例

假定需要查找包含值 41 并且范围从 CS:100 到 CS:110 的所有地址。为此,请键入以下命令:

scs:100 110 41

Debug 按以下格式显示结果:

04BA:0104
04BA:010D
-

以下命令在 CS:100 到 CS:1A0 的范围内搜索字符串“Ph”。
scs:100 1a0 "Ph"

Debug:U(反汇编)


反汇编字节并显示相应的原语句,其中包括地址和字节值。反汇编代码看起来象已汇编文件的列表。


u [range]


参数

如果在没有参数的情况下使用,则 u 命令分解 20h 字节(默认值),从前面 u 命令所显示地址后的第一个地址开始。

range

指定要反汇编代码的起始地址和结束地址,或起始地址和长度。有关 range 参数有效值的信息,请单击“相关主题”列表中的 Debug。

有关集成记忆码的信息,请单击“相关主题”列表中的 Debug A(汇编)。

有关显示内存部分内容的信息,请单击“相关主题”列表中的 Debug D(转储)。

范例

要反汇编 16 (10h) 字节,从地址 04BA:0100 开始,请键入以下命令:

u04ba:100l10

Debug 按以下格式显示结果:

04BA:0100 206472 AND [SI+72],AH
04BA:0103 69 DB 69
04BA:0104 7665 JBE 016B
04BA:0106 207370 AND [BP+DI+70],DH
04BA:0109 65 DB 65
04BA:010A 63 DB 63
04BA:010B 69 DB 69
04BA:010C 66 DB 66
04BA:010D 69 DB 69
04BA:010E 63 DB 63
04BA:010F 61 DB 61

如果只显示从 04BA:0100 到 04BA:0108 特定地址的信息,请键入以下命令:

u04ba:0100 0108

Debug 显示以下内容:

04BA:0100 206472 AND [SI+72],AH
04BA:0103 69 DB 69
04BA:0104 7665 JBE 016B
04BA:0106 207370 AND [BP+DI+70],DH

Debug:W(写入)

将文件或特定分区写入磁盘。

要将在 BX:CX 寄存器中指定字节数的内容写入磁盘文件,请使用以下语法:


w [address]


要略过 Windows 2000 文件系统并直接写入特定的扇区,请使用以下语法:

w address drive start number


参数

address

指定要写到磁盘文件的文件或部分文件的起始内存地址。如果不指定 address,Debug 程序将从 CS:100 开始。关于 address 参数有效值的信息,请在“相关主题”列表中单击 Debug。

drive

指定包含目标盘的驱动器。该值是数值型:0 = A, 1 = B, 2 = C,等等。

start

指定要写入第一个扇区的十六进制数。

number

指定要写入的扇区数。

有关指定用于 w 命令的文件的信息,请单击“相关主题”列表中的 Debug N(名称)。

有关将文件或文件扇区内容加载到内存中的信息,请单击“相关主题”列表中的 Debug L(加载)。

说明

必须在启动 Debug 时或者在最近的 Debug n(名称)命令中指定磁盘文件的名字。这两种方法都可以将地址 CS:5C 处文件控制块的文件名正确地编排格式。


在使用不带参数的 w 命令之前重新设置 BX:CX

如果使用了 Debug g(转向)、t(跟踪)、p(执行)或 r(寄存器)命令,必须在使用无参数的 w 命令之前,将 BX:CX 寄存器复位。

将修改后的文件写入磁盘

如果修改文件但不更改文件名、长度或起始地址,Debug 仍然可以正确地将文件写入源磁盘位置。

w 命令的限制

不能用该命令写入 .exe 或 .hex 文件。

警告

因为略过 Windows 2000 文件句柄,所以写入特定的分区非常危险。如果键入错误的值,则磁盘文件结构很容易被损坏。

范例

假定要将起始地址为 CS:100 的内存内容写入到驱动器 B 的磁盘中。需要将数据从磁盘的逻辑扇区号 37h 开始并持续 2Bh 个扇区。为此,键入以下命令:

wcs:100 1 37 2b

当写操作完成时,Debug 再次显示 Debug 提示符。

Debug:XA(分配扩展内存)

分配扩展内存的指定页面数。

要使用扩展内存,必须安装符合 4.0 版的 Lotus/Intel/Microsoft 扩展内存规范 (LIM EMS) 的扩展内存设备驱动程序。


xa [count]


参数

count

指定要分配的扩展内存的 16KB 页数。

有关使用扩展内存的其他 Debug 命令的信息,请单击“相关主题”列表中的 XD(释放扩展内存)、XM(映射扩展内存页)或 XS(显示扩展内存状态)。

说明

如果指定的页面数可用,则 Debug 将显示消息,此消息表明所创建的句柄的十六进制数;否则,Debug 将显示错误消息。

Debug:XA

范例

要分配扩展内存的 8 个页面,请键入以下命令:

xa8

如果命令成功,Debug 将显示类似的以下消息:
Handle created=0003

Debug:XD(释放扩展内存)


释放指向扩展内存的句柄。

要使用扩展内存,必须安装符合 4.0 版的 Lotus/Intel/Microsoft 扩展内存规范 (LIM EMS) 的扩展内存设备驱动程序。


xd [handle]


参数

handle

指定要释放的句柄。

有关使用扩展内存的其他 Debug 命令的信息,请单击“相关主题”列表中 XA(分配扩展内存)、XM(映射扩展内存页) 或 XS(显示扩展内存状态)。

范例

要释放句柄 0003,请键入以下命令:

xd 0003

如果命令成功,Debug 将显示下列消息:
Hdle 0003 deallocated

Debug:XM(映射扩展内存页)


将属于指定句柄的扩展内存逻辑页映射到扩展内存的物理页。

要使用扩展内存,必须安装符合 4.0 版的 Lotus/Intel/Microsoft 扩展内存规范 (LIM EMS) 的扩展内存设备驱动程序。


xm [lpage] [ppage] [handle]


参数

lpage

指定要映射到物理页 ppage 的扩展内存的逻辑页面号。

ppage

指定将 lpage 映射到的物理页面号。

handle

指定句柄。

有关使用扩展内存的其他 Debug 命令的信息,请单击“相关主题”列表中的 XA(分配扩展内存)、XD(释放扩展内存)或 XS(显示扩展内存)。


范例

要将句柄 0003 的逻辑页 5 映射到物理页 2,请键入以下命令:

xm 5 2 0003

如果命令成功,Debug 将显示下列消息:

Logical page 05 mapped to physical page 02

Debug:XS(显示扩展内存状态)


显示有关扩展内存状态的信息。

要使用扩展内存,必须安装符合 4.0 版的 Lotus/Intel/Microsoft 扩展内存规范 (LIM EMS) 的扩展内存设备驱动程序。


xs


参数

该命令不带参数。

有关使用扩展内存的其他 Debug 命令的信息,请单击“相关主题”列表中的 XA(分配扩展内存)、XD(释放扩展内存)或 XM(映射扩展内存页)。


说明

Debug 显示的信息有如下格式:

Handle xx has xx pages allocated
Physical page xx = Frame segment xx
xx of a total xx EMS pages have been allocated
xx of a total xx EMS handles have been allocated


范例

要显示扩展内存信息,请键入以下命令:

xs

Debug 显示与以下类似的信息:

Handle 0000 has 0000 pages allocated
Handle 0001 has 0002 pages allocated
Physical page 00 = Frame segment C000
Physical page 01 = Frame segment C400
Physical page 02 = Frame segment C800
Physical page 03 = Frame segment CC00
2 of a total 80 EMS pages have been allocated
2 of a total FF EMS handles have been allocated
(全文完)

由 beat 发表于 下午01点30分 | 回复 (0)

Debug应用实例秀(zz)

豪华绚丽的Windows让人们把DOS抛到遥远的记忆角落。然而,真正有价值的东西不会轻易退出历史的舞台,Debug就是这样的经典作品之一。从古老的DOS到现今的Windows XP,Debug一直紧紧跟随着微软的操作系统,静静躺在系统文件夹里。也许你平时对它不闻不问,但要想成为人人羡慕的系统高手,我们就得唤醒这个沉睡已久的命令行工具了,通过阅读本文对它的研究,相信你会同笔者一样的感觉到:姜,还是老的辣!

一、寻根溯源:世界第一只计算机BUG和Debug

  霍德华·艾肯在哈佛大学攻读物理学博士学位时,开始梦想制作一台计算机帮他解决数学难题,工作后,他找到IBM公司为其投资100万美元研制计算机,第一台成品艾肯把它取名为:马克Ⅰ号,又叫“自动序列受控计算机”,从这时起IBM公司由生产制表机、肉铺磅秤、咖啡碾磨机等乱七八糟玩意的行业,正式跨进了计算机“领地”。

  1945年9月9日,为马克II号编制计算程序的女数学家格雷斯·霍波在调试程序时出现了故障,拆开继电器后,发现有只飞蛾被夹扁在触点中间,从而“卡”住了机器的运行。于是霍波把这只飞蛾粘在了计算机的工作日志中,并恢谐地把程序故障统称为“臭虫”(bug),自此以后,只要这台计算机一停止运转(那时候是经常的事),同事们就会开玩笑地对霍德华·艾肯说,我们正在“Debug”(除虫)呢!后来“bug”成为计算机领域的专业行话,如DOS系统中的调试程序,程序名称就叫Debug。

  目前那只飞蛾还保存在美国史密森尼博物院的美国历史国家博物馆中呢。

  1981年,第一个PC DOS(即DOS 1.00)面世时就已经带上了Debug.com。不过,到目前为止,Debug一直没有大的变动——当然,这是指Debug提供给用户的功能,Debug本身代码、内部运行机制必然随着操作系统的变化而不断改变。然而,无论是Windows 98、2000还是XP,Debug的操作方式与纯DOS环境下基本一样。

debug.jpg

二、初学乍练:短短几行命令学用Debug

  Debug.exe文件位于Windows\system32目录(Windows XP)或Windows\command目录(Windows 9x)下。基本使用方法如下:

Step 1:点击“开始→运行”,输入“CMD”(Windows 2000/XP)或“Command”(Windows 9x)打开命令提示符窗口。

  Step 2:输入“Debug”并回车,出现提示符“-”,现在你已经开启了神秘的Debug世界了。

  小提示

  执行“?”命令可以参看Debug主要命令及参数。

  Step 3:输入“D FE00:0”,回车后可以看到结果(见图1),这个就是主板BIOS的厂商信息。接着再输入“D FFFF:5 L 8”,回车后,主板的BIOS版本日期也出来了。

debug2.jpg

Step 4:现在再输入“Q”命令,回车后就退出了Debug程序。

三、继续深入:Debug经典实例秀

  在操作以下实例之前,提醒您要注意操作安全,因为Debug命令有一定风险,如果输入错误,有可能对系统造成一定破坏,这点请您一定注意。

  实例1:查看你的显卡信息

  输入“D C000:0090”命令并回车,这时右侧部分可以看到系统中显卡的显存、生产厂商等信息。

实例2:制作BIOS密码破解器

  忘记BIOS密码,一般都采用放电法来清空密码,但这对普通用户有一定难度,并且还得开机箱。其实利用Debug的0命令则简单得多!请在“-”后输入以下命令:

  o 70 19
  o 71 15
  q

  重启电脑,系统提示CMOS校验和出错,并要求重新进入BIOS设置CMOS。

  小提示:70和71是CMOS的两个端口,我们可以在它们的后面随意写入一些错误数据(如19、16、17等),就会清空CMOS里所有设置,如果不见效不妨多用几个数据试试。

  如果觉得每次输入Debug命令太麻烦,可以用下面的方法把命令存成一个COM文件,需要解除密码时只要运行一下就行了。请在Debug中命令提示符“-”后输入以下命令:

  A 100
  MOV DX,70
  MOV AL,10
  OUT DX,AL
  MOV DX,71
  MOV AL,01
  OUT DX,AL(这里要两次回车,接着会出现“-”提示符,然后再输入下面的命令)
  R CX(回车后会出现“CX 0000”,然后再次按回车)
  0C
  N pass.COM
  W
  Q

  这样就会在Debug当前目录下生成pass.com,是一个清除BIOS口令设置的程序,只要在DOS提示符下键入“pass”,然后按回车即可。经我们测试,其实在Windows下面运行也可以成功。知识不太稳定,有时会重新启动计算机。

实例3:检测LCD显示器的坏点

  购买LCD显示器最忌有亮点或暗点,我们可以借助相关的检测软件来辅助查看,但在配电脑时,老板常常不让我们装软件,其实利用Debug中的F命令就可以看得清清楚楚!

  为了检测LCD屏幕是否存在坏点,可以将整个屏幕填充为红、绿、蓝、白等纯色,以便检查。下面给出几个常用的显示屏检测F命令(Debug窗口一般较小,按Alt+Enter将它放大到整个屏幕):


  F B800:00 F9F 20 70 全屏白色
  F B800:00 F9F 20 40 全屏红色
  F B800:00 F9F 20 20 全屏绿色
  F B800:00 F9F 20 10 全屏蓝色
  F B800:00 F9F C5 07 C4 07 全屏白色十字网格
  F B800:00 F9F C5 04 C4 04 全屏红色十字网格
  F B800:00 F9F C5 02 C4 02 全屏绿色十字网格
  F B800:00 F9F C5 01 C4 01 全屏蓝色十字网格

实例4:用Debug恢复Windows 98启动

  在同时装有Windows 98和Windows 2000的电脑上,有时在Windows 98下整理C盘的磁盘碎片后(假设Windows 98装在C盘),下次很有可能启动不了Windows 98。这时必须重新生成BOOTSECT.DOS(此文件是用来引导Windows 98的),Windows 98才可以重新引导。可以用Debug生成BOOTSECT.DOS文件,先用软盘启动到DOS状态:

  C:>Debug
  L 100 2 0 1
  N BOOTSECT(BOOTSECT表示Windows 98引导记录的文件名)
  RCX
  CX 0000
  200
  W
  Q

  现在将C:\BOOTSECT改名为BOOTSECT.DOS,覆盖原来的BOOTSECT.DOS即可。

  做个死循环炸弹玩玩

  所谓死循环,实际上是编程上一种失误,造成的程序反复执行同样指令,造成软件死锁。利用Debug,我们可以做一个小小的死循环。在Debug的命令提示符“-”后输入以下命令:

  a100
  mov dl,1
  mov ah,2
  int 21
  inc dl
  jmp 102(按两次回车)
  nboot.com
  rbx(接着按两次回车,可能会出现出错信息,不要管它,再输入一遍即可)
  rcx
  a
  -w

  好了,现在可以在DOS下面执行生成的boot.com试试效果吧,同时按ctrl+break或ctrl+c可以强制停止。如果是在windows下,强制退出即可,不过PC喇叭的声音可能得过段时间才能停下来。

三、硬盘救命稻草:用Debug玩转磁盘

  特别提醒:由于以下操作非常危险,所以建议你三思而行,并且最好在电脑中只挂接要操作的硬盘,以免误操作了其他硬盘。

  实例1:清除硬盘驱动器的所有信息

  本来清除硬盘信息用Fdisk便可以轻松搞定,可如果当你碰上用FDISK命令无法删除分区信息的情况,甚至是一运行FDISK就死机,那么就不得不求助于Debug了。通过下面的命令,可以清除硬盘上所有分区信息。

  小提示:危险操作!请慎重执行!

C:\ >Debug
  F 200 L1000 0
  A CS:100
  xxxx:0100 MOV AX,301
  xxxx:0103 MOV BX,200
  xxxx:0106 MOV CX,1
  xxxx:0109 MOV DX,80 (注意:80代表主盘,81代表从盘)
  xxxx:010C INT 13
  xxxx:010E INT 20
  xxxx:0110
  g
  Program terminated normally
  q

  以上程序执行完毕后,重启电脑,此时硬盘的分区信息都已经被清除,我们便可以使用Fdisk为硬盘进行重新分区,然后格式化即可正常使用了。

  小提示:删除所有分区

  如果想快速删除所有分区,那么可将以下命令保存到一个文本文件中(比如:Delpart.txt ):

  a 100 int13rax
  0301
  rbx
  0200
  f 200 l 200 0
  rcx
  0001
  rdx
  0080
  p
  q

  然后在纯DOS(比如用启动软盘启动系统)中执行Debug

实例2:拯救软盘数据

  一分钟前还打得开的软盘,一分钟后就说“该软盘没有格式化,要格式化么?”但这里面却偏偏保存着重要数据,其实出现这种情况往往是软盘的0面0道1扇区逻辑损坏的原因,这时可以试试以下方法:

  Step 1:将一张好的软盘插入软驱。

  Step 2:执行Debug,并在提示符“-”后输入以下命令:
  
  -L 100 0 0 1

  Step 3:将好的软盘取出,插入需要恢复的软盘,再输入以下命令:

  -W 100 0 0 1

  不过,如果0面0道1扇是物理损坏,DEBUG会告诉我们不能写盘,这时,你只能再尝试HD-COPY等工具软件了。

实例3:清除硬盘的主引导记录

  如果你遇到了FDISK不能识别硬盘,或在电脑启动时出现没有硬盘的错误提示,比如:“Fixed disk 0 Failure”,那么可以试试下面的方法,但是要注意的是,这样会删除所有硬盘分区(包括非DOS分区),当然数据也会全部丢失。

  Step 1:制作一张启动软盘,其中包括:DEBUG、FDISK、FORMAT等程序。用它启动电脑,输入“Debug”并回车。

  Step 2:在Debug的命令提示符“-”后输入以下命令:

  FCS:200 400 0
  RAX
  0301
  RBX
  0600
  RCX
  0001
  RDX
  0080
  E 100 CD 13
  P
  Q

  Step 3:完成后分别运行FDISK和Format进行分区和格式化即可。

  实例4:低格硬盘

  方法一:完全低格

  -a 100
  mov ax,0703
  mov cx,0001
  mov dx,0080
  int 13
  int 3
  010D
  G 100

  小提示:有些主板的BIOS中已经存放着低格程序,因此可以直接用Debug来调用,命令为“g c800:0005”。

  方法二:快速低格

  -a 100
  mov ax,0500
  mov bx,0180
  mov cx,0001
  mov dx,0080
  int 13
  int 3
  E 0180 0 0 0002
  G 100

  你知道吗?

  Windows 2000/XP的Debug模式

  打开启动分区的“boot.ini”文件,接着在“multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect”语句后面加一个空格,然后再输入“/DEBUG”,在启动Windows 2000/XP时调入系统中的除错程序,它可以在任何时间激活,这个参数可以用来解决有规律发生的错误。

  如果换为“/CRASHDEBUG”,那么在系统核心没有发生错误之前不会生效,如果遇到随机的内核错误,它就会帮你除错了。

由 beat 发表于 下午01点14分 | 回复 (0)

2006年04月26日 星期三

FAT32文件系统简介(zz)

Windows95 OSR2和Windows 98开始支持FAT32 文件系统,它是对早期DOS的FAT16文件系统的增强,由于文件系统的核心--文件分配表FAT由16位扩充为32位,所以称为FAT32文件系统。在一逻辑盘(硬盘的一分区)超过 512 兆字节时使用这种格式,会更高效地存储数据,减少硬盘空间的浪费,一般还会使程序运行加快,使用的计算机系统资源更少,因此是使用大容量硬盘存储文件的极有效的系统。本人对Windows 98下的FAT32 文件系统做了分析实验,总体上与FAT16文件系统变化不大,现将有关变化部分简介如下:

  (一)FAT32 文件系统将逻辑盘的空间划分为三部分,依次是引导区(BOOT区)、文件分配表区(FAT区)、数据区(DATA区)。引导区和文件分配表区又合称为系统区。

  (二)引导区从第一扇区开始,使用了三个扇区,保存了该逻辑盘每扇区字节数,每簇对应的扇区数等等重要参数和引导记录。之后还留有若干保留扇区。而FAT16文件系统的引导区只占用一个扇区,没有保留扇区。

  (三)文件分配表区共保存了两个相同的文件分配表,因为文件所占用的存储空间(簇链)及空闲空间的管理都是通过FAT实现的,FAT如此重要,保存两个以便第一个损坏时,还有第二个可用。文件系统对数据区的存储空间是按簇进行划分和管理的,簇是空间分配和回收的基本单位,即,一个文件总是占用若干个整簇,文件所使用的最后一簇剩余的空间就不再使用,而是浪费掉了。
  从统计学上讲,平均每个文件浪费0.5簇的空间,簇越大,存储文件时空间浪费越多,利用率越低。因此,簇的大小决定了该盘数据区的利用率。FAT16系统簇号用16位二进制数表示,从0002H到FFEFH个可用簇号(FFF0H到FFFFH另有定义,用来表示坏簇,文件结束簇等),允许每一逻辑盘的数据区最多不超过FFEDH(65518)个簇。FAT32系统簇号改用32位二进制数表示,大致从00000002H到FFFFFEFFH个可用簇号。FAT表按顺序依次记录了该盘各簇的使用情况,是一种位示图法。
  每簇的使用情况用32位二进制填写,未被分配的簇相应位置写零;坏簇相应位置填入特定值;已分配的簇相应位置填入非零值,具体为:如果该簇是文件的最后一簇,填入的值为FFFFFF0FH,如果该簇不是文件的最后一簇,填入的值为该文件占用的下一个簇的簇号,这样,正好将文件占用的各簇构成一个簇链,保存在FAT表中。0000000H、00000001H两簇号不使用,其对应的两个DWORD位置(FAT表开头的8个字节)用来存放该盘介质类型编号。FAT表的大小就由该逻辑盘数据区共有多少簇所决定,取整数个扇区。

  (四)FAT32系统一簇对应8个逻辑相邻的扇区,理论上,这种用法所能管理的逻辑盘容量上限为16TB(16384GB),容量大于16TB时,可以用一簇对应16个扇区,依此类推。FAT16系统在逻辑盘容量介于128MB到256MB时,一簇对应8个扇区,容量介于256MB到512MB时,一簇对应16个扇区,容量介于512MB到1GB时,一簇对应32个扇区,容量介于1GB到2GB时,一簇对应32个扇区,超出2GB的部分无法使用。显然,对于容量大于512MB的逻辑盘,采用FAT32的簇比采用FAT16的簇小很多,大大减少了空间的浪费。
  但是,对于容量小于512MB的盘,采用FAT32虽然一簇8个扇区,比使用FAT16一簇16个扇区,簇有所减小,但FAT32的FAT表较大,占用空间较多,总数据区被减少,两者相抵,实际并不能增加有效存储空间,所以微软建议对小于512M的逻辑盘不使用FAT32。
  另外,对于使用FAT16文件系统的用户提一建议,硬盘分区时,不要将分区(逻辑盘)容量正好设为某一区间的下限,例:将一逻辑盘容量设为1100M(稍大于1024M),则使用时其有效存储容量比分区为950M的一般还少,因其簇大一倍,浪费的空间较多。还有,使用FDISK等对分区指定容量时,由于对1MB的定义不一样(标准的二进制的1MB为1048576B,有的系统将1MB理解为1000000B,1000KB等),及每个分区需从新磁道开始等因素,实际分配的容量可能稍大于指定的容量,亦需注意掌握。

  (五)根目录区(ROOT区)不再是固定区域、固定大小,可看作是数据区的一部分。因为根目录已改为根目录文件,采用与子目录文件相同的管理方式,一般情况下从第二簇开始使用,大小视需要增加,因此根目录下的文件数目不再受最多512的限制。FAT16文件系统的根目录区(ROOT区)是固定区域、固定大小的,是从FAT区之后紧接着的32个扇区,最多保存512个目录项,作为系统区的一部分。

  (六)目录区中的目录项变化较多,一个目录项仍占32字节,可以是文件目录项、子目录项、卷标项(仅跟目录有)、已删除目录项、长文件名目录项等。目录项中原来在DOS下保留未用的10个字节都有了新的定义,全部32字节的定义如下:
(1) 0-- 7字节 文件正名。
(2) 8--10字节 文件扩展名。
(3) 11字节 文件属性,按二进制位定义,最高两位保留未用,0至5位分别是只读位、隐藏位、系统位、卷标位、子目录位、归档位。
(4) 11--13字节 仅长文件名目录项用,用来存储其对应的短文件名目录项的文件名字节校验和等。
(5) 13--15字节 24位二进制的文件建立时间,其中的高5位为小时,次6位为分钟。
(6) 16--17字节 16位二进制的文件建立日期,其中的高7位为相对于1980年的年份值,次4位为月份,后5位为月内日期。
(7) 18--19字节 16位二进制的文件最新访问日期,定义同(6)。
(8) 20--21字节 起始簇号的高16位。
(9) 22--23字节 16位二进制的文件最新修改时间,其中的高5位为小时,次6位为分钟,后5位的二倍为秒数。
(10)24--25字节 16位二进制的文件最新修改日期,定义同(6)。
(11)26--27字节 起始簇号的低16位。
(12)28--31字节 32位的文件字节长度。

  其中第(4)至(8)项为以后陆续定义的。 对于子目录项,其(12)为零;已删除目录项的首字节值为E5H。在可以使用长文件名的FAT32系统中,文件目录项保存该文件的短文件名,长文件名用若干个长文件名目录项保存,长文件名目录项倒序排在文件短目录项前面,全部是采用双字节内码保存的,每一项最多保存十三个字符内码,首字节指明是长文件名的第几项,11字节一般为0FH,12字节指明类型,13字节为校验和,26--27字节为零。

  (七)以前版本的 Windows 和DOS与 FAT32 不兼容,不能识别FAT32分区,有些程序也依赖于 FAT16 文件系统,不能和 FAT32 驱动器一道工作。将硬盘转换为 FAT32,就不能再用双引导运行以前版本的 Windows(Windows 95 [Version 4.00.950]、Windows NT 3.x、

由 beat 发表于 下午06点43分 | 回复 (0)

分区表、文件分配表探秘(zz)

1、分区表

硬盘只有经过物理格式化、分区、逻辑格式化后才能使用,在进行分区时,FDISK会在硬盘的0柱面0磁头1扇区建一个64字节的分区表,在分区表的前面是主引导记录(MBR),后面是两个字节的有效标志55h、AAh(h表示16进制)。此扇区被称为主引导扇区,也是病毒最爱侵袭的地方,它由主引导记录+分区表+有效标志组成。

分区表对于系统自举十分重要,它规定着系统有几个分区;每个分区的起始及终止扇区、大小以及是否为活动分区等重要信息。分区表由4个表项组成,每个表项16个字节,各字节含义如表1:

表1

 字节       含  义

第0字节 是否为活动分区,是则为80h,否则为00h

第1字节 该分区起始磁头号

第2字节 该分区起始扇区号(低6位)和起始柱面

号(高2位)

第3字节 该分区起始柱面号的低8位

第4字节 系统标志,00h表该分区未使用,06h表高

版本DOS系统,05h扩展DOS分区、65h表

Netware分区

第5字节 该分区结束磁头号

第6字节 该分区结束扇区号(低6位)和结束柱面号

(高2位)

第7字节 该分区结束柱面号的低8位

第8~11字节 相对扇区号、该分区起始的相对逻辑扇区

号,高位在后低位在前

第12~15字节 该分区所用扇区数,高位在后、低位在前

注意:

1分区表有四个表项,表示硬盘最多只能容纳四个分区。

2磁盘的各个面称为磁头,软盘只有两个磁头,而硬盘往往有多个。各个磁头相同半径的磁道合称为柱面。

3高位在后,低位在前是一种存储数字方式,读出时应对其进行调整,如两字节12h、34h,应调整为3412h。

现在举例说明,有如下一分区表(16进制):

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 01

01 00 06 0B 23 9B 23 00 00 00 CD FF 00 00 00 00

01 9C 05 0B E3 DB F0 FF 00 00 00 55 05 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA

此分区表两个表项已被使用,说明此硬盘上存在两个分区(DOS主引导分区和扩展DOS分区),还有两个表项未用,最后是2个字节的有效标志。现以第一个表项为例说明各字节作用。

第0字节80h表明此分区为活动分区,系统启动时将从此分区读取系统文件,当硬盘上存在一个以上分区时,只能有一个是活动的。

第1字节01h表明此分区起始于第1磁道。

第2个字节01h用二进制表示为00000001,低6位为000001,合十进制为1,表此分区起始扇区为1。

第3字节00h,用二进制表示为00000000,加上第2个字节的高2位00作为高位,表示为0000000000,合十进制0,表此分区起始柱面为0。

第4字节06h表此分区为基本DOS分区。

第5字节0Bh表示该分区结束在第11磁头。

第6字节23h合二进制00100011,低6位100011合十进制35,此分区结束扇区则为35。

第7字节9Bh合二进制10011011,加上第6字节的高2位00作为高位,表示为0010011011,合十进制155,表此分区结束在第155柱面。

第8~11字节为23h,表此分区从相对逻辑35扇区开始。

第12~15字节为FFCDh,表此分区共有65985个扇区。综上所述,此分区为活动的基本DOS分区,分区从0柱面1磁头1扇区开始,即相对逻辑35扇区,终之于155柱面11磁头35扇区。

硬盘自举时,先将主引导扇区的主引导记录读入内存,主引导记录将检查结束标志是否为55AAh,并在分区表中找到唯一的一个活动分区,并根据该分区表项记载的起始扇区地址读入引导文件,完成启动过程。

要注意用PCTOOLS等一般软件无法访问主引导记录,因为它的磁盘编辑功能只能访问到逻辑0扇区,即BOOT扇区。但我们可以通过KV300或Norton的主引记录导出功能,观察自己的磁盘的分区表。也可对它进行修改,实现在不破坏原有数据的情况下增加分区、对某个分区加锁等功能,但用户最好谨慎行事,分区表可是“军事禁区”。

二、文件分配表

当一个磁盘Format后,在其逻辑0扇区(即BOOT扇区)后面的几个扇区中存在着一个重要的数据表——文件分配表(FAT),文件分配表一式两份,占据扇区的多少凭磁盘类型大小而定。顾名思义,文件分配表是用来表示磁盘文件的空间分配信息的。它不对引导区、文件目录表的信息进行表示,也不真正存储文件内容。

我们知道磁盘是由一个一个扇区组成的,若干个扇区合为一个簇,文件存取是以簇为单位的,哪怕这个文件只有1个字节。每个簇在文件分配表中都有对应的表项,簇号即为表项号,每个表项占15个字节(磁盘空间在10MB以下)或2个字节(磁盘空间在10MB以上)。为了方便起见,以后所说的表项都是指2个字节的。

文件分配表结构如表2(h表示16进制)。

注意:

1不要把表项内的数字误认为表示当前簇号,而应是该文件的下一个簇的簇号。

2高字节在后,低字节在前是存储数字的一种方式,读出时应进行调整,如两字节12h,34h,实际应为3412h。

文件分配表与文件目录表(FDT)相配合,可以统一管理整个磁盘的文件。它告诉系统磁盘上哪些簇是坏的或已被使用,哪些簇可以用,并存储每个文件所使用的簇号。它是文件的“总调度师”。

当DOS写文件时,首先在文件目录表中检查是否有相同文件名,若无则使用一个文件目录表项,然后依次检测FAT中的每个表项,找到第一个为0000h的表项后,将文件写入与该表项相对应的簇中,同时将该簇号写入文件目录表项的第26-27字节,如文件长度不止一簇,则继续向后寻找可用簇,找到后将其簇号写入上一次找到的表项中,如此直到文件结束,在最后一簇的表项里填上FFF8h,形成一个单向链表。

DOS删除文件时只是把文件目录表中的该文件的表项第0个字节改为E5h,表此表项已被删除,并在文件分配表中把该文件占用各簇的表项清0,以释放空间。其实文件的内容仍在盘上,并没有被真正删除,这就是undelete.exe、unerase.exe等一类恢复删除工具能起作用的原因。

文件分配表在系统中的地位十分重要,用户最好不要去修改它,以免误操作带来严重的后果。

表2

字 节 含 义

第0字节 表头,表磁盘类型。

FFh 双面软盘 每磁道8扇区

FEh 单面软盘 每磁道8扇区

FDh 双面软盘 每磁道9扇区

FCCh 单面软盘 每磁道9扇区

FC8h 硬盘

第1~2字节(表项号1) 表示第一簇状态,因第一簇已被系统占据,

 故此两字节为FFFFh

第3~4字节(表项号2) 表示第二簇状态,若为FFFTh表此簇为坏

 的,DOS已标记为不能用;0000h表示此簇

 为空,可以用;FFF8h表示该簇为文件的最

 后一簇;其余数字表示文件的下一个簇号,

 注意高字节在后,低字节在前

第5~6字节(表项号3) 表示第三簇状态,同上

由 beat 发表于 下午06点42分 | 回复 (0)

硬盘主引导记录详解(zz)

硬盘的数据结构对于一些朋友来说总是很神密!为什么我们删除了的文件用软件能找到?为什么我们格式化了的硬盘数据还能找回来?要回答这一切,你就得对硬盘的数据结构有个清醒的认识。

硬盘上的数据由五大部分组成,它们分别是:MBR区、DBR区,FAT区,DIR区和DATA区。

1.MBR(Main Boot Record)区,即主引导记录区,位于整个硬盘的0磁道0柱面1扇区.

2.DBR(Dos Boot Record)区,操作系统引导记录区。位于硬盘的0磁道1柱面1扇区,是操作系统可以直接访问的第一个扇区.

3.FAT(File Allocation Table文件分配表)区;

4.DIR(Directory)根目录区,记录着根目录下每个文件(目录)的起始单元,文件的属性等;

5.DATA区是真正意义上的数据存储的地方,位于DIR区之后,占据硬盘上的大部分数据空间。

了解了硬盘数据的基本结构,今天我们把重点放在mbr所在的扇区:主引导扇区。主引导扇区包括:mbr,dpt和结束标志。位于硬盘的0磁道0柱面1扇区,用diskman可以读出其中的内容,下面是一次操作的结果:

表一:

0 1 2 3 4 5 6 7 8 9 A B C D E F

00000000 EB48 90D0 BC00 7CFB 5007 501F FCBE 1B7C

00000010 BF1B 0650 57B9 E501 F3A4 CBBE BE07 B104

00000020 382C 7C09 7515 83C6 10E2 F5CD 188B 148B

00000030 EE83 C610 4974 1638 2C74 F6BE 1007 0302

00000040 8000 0080 68B6 7600 0008 FAEA 507C 0000

00000050 31C0 8ED8 8ED0 BC00 20FB A040 7C3C FF74

00000060 0288 C252 BE81 7DE8 3F01 F6C2 8074 5FB4

00000070 41BB AA55 CD13 7256 81FB 55AA 7550 A041

00000080 7C84 C075 0583 E101 7444 B448 BE00 7FC7

00000090 0442 00CD 1372 3766 8B4C 10BE 057C C644

000000A0 FF01 668B 1E44 7CC7 0410 00C7 4402 0100

000000B0 6689 5C08 C744 0600 7066 31C0 8944 0466

000000C0 8944 0CB4 42CD 1372 05BB 0070 EB7D B408

000000D0 CD13 730A F6C2 800F 84E8 00E9 8D00 BE05

000000E0 7CC6 44FF 0066 31C0 88F0 4066 8944 0431

000000F0 D288 CAC1 E202 88E8 88F4 4089 4408 31C0

00000100 88D0 C0E8 0266 8904 66A1 447C 6631 D266

00000110 F734 8854 0A66 31D2 66F7 7404 8854 0B89

00000120 440C 3B44 087D 3C8A 540D C0E2 068A 4C0A

00000130 FEC1 08D1 8A6C 0C5A 8A74 0BBB 0070 8EC3

00000140 31DB B801 02CD 1372 2A8C C38E 0648 7C60

00000150 1EB9 0001 8EDB 31F6 31FF FCF3 A51F 61FF

00000160 2642 7CBE 877D E840 00EB 0EBE 8C7D E838

00000170 00EB 06BE 967D E830 00BE 9B7D E82A 00EB

00000180 FE47 5255 4220 0047 656F 6D00 4861 7264

00000190 2044 6973 6B00 5265 6164 0020 4572 726F

000001A0 7200 BB01 00B4 0ECD 10AC 3C00 75F4 C300

000001B0 0000 0000 0000 0000 4CA6 4CA6 0000 8001

000001C0 0100 0BFE 3FD8 3F00 0000 5A31 3500 0000

000001D0 01D9 0FFE FFFF 9931 3500 04FF FB00 0000

000001E0 0000 0000 0000 0000 0000 0000 0000 0000

000001F0 0000 0000 0000 0000 0000 0000 0000 55AA

这块10.2G(以下显示为9766MB,误差原因不用我解释了吧?)的硬盘共分了四个区:分区结构如下:

主引导扇区中前446字节--偏移地址从0000H-01BDH为mbr区,存放着主引导程序,从上面的显示中,读者可能已经看出,这个硬盘以linux系统的grub为引导程序。


接下来的64字节为硬盘分区表--dpt,偏移地址从01BEH-01FDH,共分为四个分区表项,每个分区表项占16字节,表示一个分区,从这里大家就可以知道为什么硬盘只能分四个主分区了吧?但有时我们需要更多的分区来规划我们的硬盘,为解决这个问题,就把这四个分区表项中的一个定义为扩展分区(与主分区是并列关系),扩展分区中又可以定义逻辑分区(与扩展分区是包含与被包含的关系)。但读者不要以为这些信息都在这一个16字节的分区表项中。事实上是:被定义为扩展分区的这一个分区表项只包含了指向逻辑分区的信息。而逻辑分区的分区表在其它的扇区中存放!

本文重点介绍dpt中的内容,上面已经提到,dpt分为四个分区表项,每个分区表项占16个字节,下面着重讲述这16个字节是怎么分配的。

表三:

第1字节 引导标志,该值为80H表示为可自举分区(活动分区,仅有一个),该值为00H表示其余分区

第2字节 分区起始磁头

第3字节 低6位是分区起始扇区,高2位是分区起始的柱面的头两位

第4字节 分区起始柱面的低8位

第5字节 系统标志

第6字节 分区终止磁头

第7字节 低6位为分区终止扇区,高2位为终止柱面的前2位

第8字节 分区终止柱面的低8位。

第9-12字节 本分区前的扇区数,低位字节在前(注:不是低位在前)

第13-16字节 本分区总的扇区数,低位字节在前

现在根据上面的列表详细解释一下:我们提取出下面四个分区表项:

表四:

分区 | 字节序号

表项 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

1: | 80 01 01 00 0B FE 3F D8 3F 00 00 00 5A 31 35 00

2: | 00 00 01 D9 0F FE FF FF 99 31 35 00 04 FF FB 00

3: | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

4: | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

由于数据以16进制显示,每个数字占一个字节的四位,所以两个数字占一个字节。

对于第一个分区表项:

第1字节为80,表示活动分区;

第2字节为01,十进制为1,表示起始磁头号;

第3字节为01,二进制为00000001,低6位000001,对应的十进制为1,表示起始扇区;

第4字节为00,二进制为00000000,与第三字节的高2位00组成0000000000,十进制为0,表示起始柱面;

第5字节为0B,为系统标志;

第6字节为FE,十进制为254,表示终止磁头;

第7字节为3F,二进制为00111111,低6位为111111,转换为十进制为63,表示终止扇区;

第8字节为D8,二进制为11011000,与第7字节的高2位00组成0011011000,十进制为216,表示终止柱面;

第9-12字节为3F 00 00 00,按低位字节在前的原则排列为:00 00 00 3F,转换为十进制为63,表示该分区前的扇区数目;

第13-16字节为5A 31 35 00,按低位字节在前的原则排列为:00 35 31 5A,转换为十进制为3486042,表示该分区占用的扇区数目。

我们可以与表2对照,发现两者完全统一!同理,我们还可以分析第2个分区表项,这就交给感兴趣的读者自己完成吧。

在第3和第4个分区表项中,所以数据都为0,表示这两个分区表项没有分配。

最后两个字节--偏移地址从01FEH-01FFH,为结束标志,通常为55 AA,如果改为其它值,则硬盘可能不被引导。

通过以上的讲解,你是不是对硬盘的数据结构又有了更深的认识?对于使用windows和linux双系统的用户,经常要与mbr打交道,有很多网友问:装了linux和windows双系统,现在又不想使用linux了,于是把linux的分区格式化为fat32回收,但当初装在mbr的引导信息老是去不掉。这里我可以告诉你一个方法,就是用windows98启动盘启动电脑,然后运行fdisk/mbr命令就可以了,这条命令是重建mbr(前446字节),但并不破坏dpt中的数据,也就是并不破坏硬盘的分区表,可以安全使用。你可以在使用这条命令前后各查看一下主引导扇区,就会发现从447字节开始以后的数据都没有改变。如果你没有diskman这个软件,下面的C程序一样可以帮你搞掂!

以下是程序的源码:

#include <bios.h>

#include <stdio.h>

int main()

{

register int i;

unsigned char buffer[512] = {0};

biosdisk(2, 0x80, 0, 0, 1, 1, buffer);

for (i=0; i<512; i++)

{

if (!(i%8))

{

printf(" ");

if (!(i%16))

{

printf("\n");

printf("%04x:", i);

}

}

printf("%02x ", buffer);

}

}

在turboc2.0中可编译通过。运行biosdisk()函数,你还可进一步编写备份mbr,恢复mbr的程序或把mbr清0的程序,是不是很想试试。

由 beat 发表于 下午06点24分 | 回复 (0)

2006年04月25日 星期二

Resources Online about Mathematics

Mathematics Journals on the Web

Mathematics Archives on the Web

由 beat 发表于 下午01点11分 | 回复 (0)

2006年04月24日 星期一

老大结婚了!

老大结婚了,婚礼搞得非常浪漫...

每个人提起父母的时候,总有一种莫名的感动,掩饰不住自己的心情。新娘在提到父母的时候,我的心里也像聚集了一些什么。

我真的觉得自己很没有用!!

由 beat 发表于 下午07点56分 | 回复 (0)

2006年04月10日 星期一

Suse10安装 QtiPlot - Data analysis and scientific plotting

Linux下面的Origin

安装源文件都位于/software下

1.安装QwtPlot3D
下载地址:http://qwtplot3d.sourceforge.net/web/navigation/download_frame.html

解压qwtplot3d-0.2.6.tgz

mkdir /usr/include/qwtplot3d
将/software/qwtplot3d/include目录下所有文件拷贝至/usr/include/qwtplot3d

在/software/qwtplot3d/运行
/usr/lib/qt3/bin/qmake(我的Suse把qt3装在此目录)


这时make时会报错误,说-lXmu找不到库文件,Suse10下libXmu装的路径是/usr/X11R6/lib/
修改Makefile,将
LIBS = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/lib/ -lz -lqt-mt -lGLU -lGL -lXmu -lpthread
改为
LIBS = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/lib/ -L/usr/X11R6/lib/ -lz -lqt-mt -lGLU -lGL -lXmu -lpthread

然后make就可以了

把/software/qwtplot3d/lib/下所有文件拷贝至/usr/lib/下

2. 安装GSL库
下载地址:http://www.gnu.org/software/gsl/
beat@huang:/software> tar -zxvf gsl-1.7.tar.gz
beat@huang:/software> cd gsl-1.7/
beat@huang:/software/gsl-1.7> ./configure --prefix=/usr/
beat@huang:/software/gsl-1.7> make
beat@huang:/software/gsl-1.7> su
huang:/software/gsl-1.7 # make install
3. 安装qtiplot
下载地址:http://soft.proindependent.com/qtiplot.html
beat@huang:/software> tar -xf qtiplot-0.8.2.tar
beat@huang:/software> cd qtiplot-0.8.2/
beat@huang:/software/qtiplot-0.8.2> export PATH=$PATH:/usr/lib/qt3/bin/
beat@huang:/software/qtiplot-0.8.2> qmake
beat@huang:/software/qtiplot-0.8.2> make
beat@huang:/software/qtiplot-0.8.2> su
huang:/software/qtiplot-0.8.2 # make install

好啦,装完拉

由 beat 发表于 下午09点38分 | 回复 (0)

2006年04月09日 星期日

Gaim使用Google Talk

系统Suse 10
Gaim 版本 1.5.0-3

启动Gaim,选择帐户,添加;

协议选Jabber,用户名是gmail帐号(不含@gmail.com),服务器写:gmail.com;
密码是gmail邮箱密码;别名可任意取。

点下面的”显示全部选项“,只勾选“若可用则使用TLS”,端口:5222,连接服务器:talk.google.com。

然后确定,就可以登录使用Google Talk了。

由 beat 发表于 下午09点34分 | 回复 (0)

2006年04月08日 星期六

使用ASCIIMathML.js使网页支持latex

ASCIIMathML主页:http://www1.chapman.edu/~jipsen/mathml/asciimath.html

浏览器:Netscape7.1/Mozilla/Firefox或 Internet Explorer 6 + MathPlayer

示例:


$e^{i\pi}=\cos\pi+i\sin\pi=1$
源码:
<script type="text/javascript" src="http://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.js"></script>
\$e^{i\pi}=\cos\pi+i\sin\pi=1\$

由 beat 发表于 下午11点32分 | 回复 (0)

2006年04月04日 星期二

Richard Stallman ”未来的自由软件”

会议: 意大利都灵GPLv3会议
时间: 2006-03-18 9:30到13:30

演讲人: Richard Stallman
主题: 未来的自由软件

原文

演讲文稿

Richard Stallman:
Before I get into the main subject, which is the plans for version three of the GPL, I want to mention a very important fundamental issue.
[1h 27m 06s]
There is a term that some people use, which causes terrible confusion and should never be used, and that is the term "intellectual property". Now, I heard someone mention that term. I don't think he was explaining why that term should not be used.
It is devastatingly harmful to use the term "intellectual property" because that term implies the existence of something which does not exist.
Copyright law exists. Patent law exists. They have almost nothing in common in terms of the requirements that they put on the public. Trademark law also exists. It has nothing in common with copyright law or patent law about what it requires of the public. So, the idea that there is some general thing which these are instances of already gets people so confused that they cannot understand these issues. There is no such thing. These are three separate unrelated issues, and any attempt to generalise about them guarantees confusion. Everyone who uses the term "intellectual property" is either confused himself or trying to confuse you.
[applause]
[1h 29m 12s]
I came to this conclusion a few years ago and since then I have decided that I will never use that term. No exceptions. I will talk about why the term is confusing, because that's a useful thing to do, but I will never use that term. I never use it. I hope you will join me in making this firm policy of never using it. And if someone else says something about "intellectual property", I will not respond directly to what he said without first explaining the confusion buried in it, because you see, the confusion buried in a statement is usually more harmful than whatever may be false that he actually tried to say.
The false premises, the false presuppositions are the most important problem. So, if someone makes a statement about intellectual property and some part of it is the specific point, which I might disagree with, the first thing I will say is why it's a mistake to talk about intellectual property at all, and then I will try to translate what he said into clearer terms, and then I might say if I agree with it or not. But that's secondary, and explaining to people the confusion in the term intellectual property itself is the most important thing to do.
There is a tendency to, we all have it, to follow other people in their choice of terminology. If someone says an outrageous thing and he uses the term intellectual property, you will feel drawn into responding in the same terms. So, learn to resist that temptation.
[1h 31m 20s]
The most important mistake, the most important falsehood in that statement is its use of the term "intellectual property" in the first place. And the most important thing about it to respond to, if you could only choose one thing, is that one. And you can say: "and since your whole picture of the situation is totally confused, clearly the specifics of what you said need to be rethought".
That's all you need to do to deal with the specific thing he said.
And, by the way, when the term "intellectual property" is used in the name of a law or a committee, that is an example of the confusion. It's almost a certainty that any law named "intellectual property" is a harmful, an unjust law. Of course, you have to check the details to be sure of that, but you can be almost certain just from hearing the name. And the reason is that you can tell from the name that unjust premises and confusions went into the design of the law so what could you expect except harmfulness.
[1h 33m 00s]
So, at this point, I should go to the intended topic, which is version three of the GPL.
I designed GPL version one in 1989, and GPL version two in 1991. I thought of making a version three something like five or six years ago. We didn't intend to wait fifteen years. It was due to the fact that I was busy, and there were some things that were hard to figure out.
The idea that there would be changes in the GPL was planned from the beginning. That is, version one already included a plan for transition to future versions. We suggested that people release their programs under "version one or any later version of the GPL", and the idea was that when version two came out, it would automatically be usable for all those programs and in the time since version two, we've been suggesting that people release their software under "version two or any later version" and I believe most GPL covered programs do say that, with the result that when GPL version three comes out, a lot of software will be usable under GPL version three.
The older versions of the GPL also promise that future versions would be "similar in spirit". In other words, the changes will not be radical. Any radical change would be false to the spirit and would be wrong.
[1h 35m 17s]
The changes that we've proposed in version three are all in small sub-issues. Some of them are very important, but in the overall framework, they're small changes. And the overall effect of GPL version three will be basically the same as version two, protecting the same four freedoms, but doing it somewhat better, dealing with some problems which we've encountered and adapting better to various different laws around the world.
One thing that we've done is that we've restructured some of the concepts, for instance, we make it clear that many other activities that have the effect of providing copies to other people are treated the same as distribution. Anything that's covered by copyright law which has the effect that it enables other people to get copies is effectively equivalent to distribution, and this insulates GPL version three from certain differences between laws in various countries about just what constitutes distribution. So it has the effect of making the GPL work more the same in all countries, despite precisely how they have formulated their copyright laws.
There are many changes in GPL version three which do something like that, they actually just make it more uniform and more reliably doing the same thing we expected it already did.
[1h 37m 20s]
But there are some places where we actually have changed the policies in small ways. One of these concerns software patents. GPL version two is based on an implicit grant of a patent licence. The idea is that if somebody says "here is a thing and you can use it", implicitly he's promising he's not going to sue you for patent infringement if you go ahead and do what he said; however, since in the past eight years or so some other free software licences have included explicit statements of patent licenses, patent licence grants by people distributing the software, and so we decided to do the same thing, and we've included an explicit statement that the distributors of the software all promise not to sue anybody who is using any version of that software for patent infringement based on the versions that they distributed. Basically, whatever their versions do, they're promising not to sue you for.
However, there's a subtlety that came up in this. What if somebody doesn't have a patent but he has got a licence for that patent, and he distributes the code to you. Well, does that licence he got include your exercise of the four freedoms? Including your freedom to redistribute copies yourself, with changes? Maybe not, but if it doesn't, it creates a dangerous and unfair situation. Unfair to you because he is distributing the software, or distributing his version of the software, and he is not going to get sued for patent infringement because he got a licence. He distributes it to you under the GPL and the GPL says you are free to redistribute it too, but if you do that you might get sued because his patent license might not cover you.
[1h 40m 04s]
Well, this is unfair, this is something that's not supposed to happen. He received this program under the GPL and the GPL says when he distributes a version of it, he must really give you the freedom to do the same. If he can count on safely doing it, and he knows you will get sued if you do it, by a third party, he's cheating. So, GPL version three, along with the explicit patent licence grant, says that if he is knowingly relying on a patent licence for distributing his version, he must take some effective step to protect you as well if you distribute.
Now, the reason it talks about "knowingly relying" is that there are companies that have signed blanket cross licences with other companies, so the company distributing the program, might have some blanket cross licence with some company, and that blanket cross licence might cover a thousand patents, and they don't even know what those thousand patents say. So, if they don't even know that they have a patent licence, they're not required to pay attention, but if they know about a specific patent that would cover this program, that means they are knowingly relying on a patent licence and that means they have to keep you safe as well. This is a very controversial decision. It may seem like a subtle point, it covers a peculiar scenario, but it's not an impossible scenario. It could be a very important scenario. In this scenario, this point is essential to ensure that the GPL really does what it intends to do, which is, make sure that you do get the freedom to redistribute the software that you got. And this is typical of the ways that we are changing GPL version three. They apply to complicated scenarios but those scenarios may happen frequently, and in those scenarios we are trying to make sure that you really get the four fundamental freedoms which that free software.
Did someone earlier already describe the four freedoms?
Then I better do so.
[1h 42m 43s]
Freedom zero is the freedom to run the program as you wish for any purpose.
Freedom one is the freedom to study the source code and change it to do what you wish.
Freedom two is the freedom to help your neighbour, that's the freedom to make copies and distribute them to others when you wish.
Freedom three is the freedom to help your community, that's the freedom to publish or distribute modified versions when you wish.
So here we're talking about what is necessary to ensure that freedom two really exist for you in a certain special scenario, freedom two being the freedom to redistribute copies and also freedom three, it applies to that too.
[1h 43m 35s]
Another area where we have made changes concerns Digital Restrictions Management. Now, freedom zero says you are free to run the program as you wish for any purpose. We are not limiting freedom zero. If someone wants to run a program to encrypt something, that's fine. If someone wants to run a program to decrypt something, that's fine. If somebody wants to run a program to produce an encrypted medium that's difficult to access, that's fine. If somebody has some other GPL covered program to access that media and he wants to run it to access the encrypted data, that's fine too. And distributing software that could be used for those purposes is also entirely permitted, and will be permitted by GPL version 3.
[1h 44m 58s]
However, freedom zero does not include imposing your purposes on someone else who is going to run the program, because his freedom zero is the freedom to run the program for any purpose of his. So, there is no such thing as the freedom to use any software to impose your purpose on someone else. In fact, that should be illegal. I'm serious. And that's what DRM is.
When somebody distributes a player, that has DRM in it, what he's doing is trying to restrict your running of your computer for his purposes, which is directly in conflict with the four freedoms that you should have.
And that's what GPLv3 is in certain ways trying to stop and it does this simply by assuring you all four of the freedoms when you use the software. You see, because DRM - Digital Restrictions Management - is a plan to restrict the public, anyone distributing a version of a GPL-covered program as a player for DRM media always does something to stop the public from modifying the player, because his purpose in distributing a DRM player is to restrict you, he has to make sure you can't escape from his restrictions, from his power. That means he is always going to try to deny you freedom one. Freedom one is the freedom to study the source code of the program and change it to do what you want. What you want, might be, to escape from his restrictions, and if you have freedom one, you can escape from his restrictions. So his goal is somehow or other, for practical purposes, to deny you freedom number one.
[1h 47m 26s]
Now, what he might do is, use non-free software, and then completely deny you freedom number one. In fact, that's what they usually do. We can't change that with the GPL because they're not including any GPL-covered code. They don't have to pay attention to the GPL. There should just be a law against it. It should be illegal. DRM should be illegal, but we can't change laws by modifying the GPL.
However, there are those that want to use GPL-covered software for this purpose, and they want to do so by turning freedom number one into a sham, a facade. So they plan to do something like, make a modified version of the GPL-covered program, which contains code to restrict you, and distribute that to you and somehow arrange that you can't really modify it, or if you modify it it won't run, or if you modify it and operate it, it won't operate on the same data.
[1h 48m 42s]
They do this in various ways. This is known as Tivo-isation because this is what the Tivo does. The Tivo includes some GPL-covered software. It includes a GNU+Linux system, a small one, but it does, and you can get the source code for that, as required by the GPL because many parts of GNU+Linux are under the GPL, and once you get the source code, you can modify it, and there are ways to install the modified software in your Tivo and if you do that, it won't run, period. Because, it does a check sum of the software and it verifies that it's a version from them and if it's your version, it won't run at all. So this is what we are forbidding, with the text we have written for GPL version three. It says that the source code they must give you includes whatever signature keys, or codes that are necessary to make your modified version run.
In other words, it ensures that freedom number one is real. That you really can modify the source code, install it, and then it will run and not only that, we say, they must give you enough to make the modified version operate on the same range of data. Because, you see, Microsoft's plan, which they call Palladium, and then they change the name - they change these names frequently so as to evade criticism, to make criticism difficult, to make any kind of comment on their plans difficult. You talk about their plan and they say "Oh, we've dropped that, we have a different plan now". And probably it is different in some details, but the point is that they generate encryption and decryption keys using a check sum of the program which means that a different program can't possibly access the same data. Although, that's just the base level, and then on top of that they implement other facilities where the program simply has to be signed by the authorised signer in order to be able to access the data.
[1h 51m 29s]
Well, GPL version three says that if they distribute a GPL-covered program in this way, they must provide you with the key necessary so that you can sign your version and make it access the same data. Otherwise, they would say "Yes, you can run your modified version, but it will have a different check sum, so your version will only operate on data files made for your version, just as our version only operates on data made for our version". And what that means is that all the available files will only work with their version and your changed version will not be able to access them. That's exactly, in fact, how Treacherous Computing is designed to work. The plan is that they will publish files that are encrypted and it will be impossible to access those files with any other program, so GPL version three is designed to ensure that you really, effectively, get the freedom to take the program you were given, modify it, and run the modified version to do a different thing on the same data on the same machine.
But, there's one other way that we're trying to thwart DRM. You see, one thing they do is, some countries, including, I'm sad to say, this one, have adopted unjust laws that support DRM. The exact opposite of what they ought to do, which is prohibit DRM, and what they say is: when media have been encoded for DRM, then writing another program to access that media is illegal, and the way they do this is they say that DRM constitutes an effective, they call it "protection" I call it "restriction", measure. So, what we say is, by releasing a program under GPL version three, you agree that it is not an effective restriction measure. In other words, you authorise others to develop on their own software to read the output of your program.
This also is a matter of recognising and respecting their freedom to develop software and use their computers. And this, what I've described so far, is all that GPL version three says about DRM.
[1h 54m 36s]
Another area in which we've made large changes has to do with compatibility with a wide range of other free software licences.
We've always understood GPL version two, and version one, as being compatible with some other free software licences. Namely, those that don't require anything except what the GPL requires. So, for instance, there is the X11 licence, all it requires is that you keep the licence there. This doesn't actually demand anything that conflicts with the GPL, so we've always interpreted it as being compatible with the GPL, and what it means to say that two free software licences are compatible is that you can take code from a program under licence A and code from a program under licence B and put them together in one program and you have not violated either licence.
If both licences permit the combining of the code, then you can combine the code, and that's what it means to say the licences are compatible. Now, it's very useful to be able to combine the code, so compatibility of the licences is a convenient thing. Now, it's impossible for all free software licences to be compatible. You see, the GPL makes certain requirements and we are not willing to have them taken off, and so another licence, such as GPL version one, that doesn't have those requirements, cannot be compatible with GPL version two or three. That's impossible.
A licence like the Mozilla Public License has its own specific requirements, but it requires things the GPL doesn't require. It can't be compatible, I believe. So we can't be compatible with all of them, but we went through other free software licences and we identified certain kinds of requirements that are pretty harmless and we wouldn't mind if people could attach those kinds of requirements to GPL-covered programs, and we made an explicit list of those kinds of requirements. Section seven of the draft of GPL version three says you can put your own terms and conditions on code that you add to the GPL covered program, and your terms and conditions can include these kinds of requirements. You can also give additional permission. Any kind of additional permission you like. So your terms on your code can be more permissive than the GPL itself. And section seven makes it completely explicit that this is compatible with the GPL.
[1h 58m 22s]
Now, these, the added kinds of requirements that you can make, include different requirements as regards credit and notices and how to identify changes on your code. That's harmless, that only really is relevant when people change your code, and when they do that they will see your terms at the beginning of your code and they will know what to do. And it can include a requirement that they not use certain of your trademarks in ways that trademark law forbids. And this would just be a way of reinforcing trademark law using the copyright on your code. And that's harmless because you could actually do that with trademark law in the first place. So this doesn't actually restrict people in any way that they wouldn't be restricted otherwise.
[1h 59m 28s]
You can put on requirements that -- and this is a non-trivial kind of requirement that we've decided to let people put on -- requirements that if people run your code, on a publicly accessible server, then it must have a command that the user can use to download the source code of the version that is running. Which means that if someone makes changes and puts the changes in his version, on his server, he has to make his source code changes available to the users who talk to his server.
This requirement is known as the Affero clause because it's used in the Affero GPL. The Affero GPL is like GNU GPL version two except it has this requirement as well.
We were thinking of including some kind of requirement like that in GNU GPL version three. We didn't want to make it apply to everything automatically. That would be a drastic change, so we would have to make it something that people could activate explicitly for their programs, and then I realised people could activate it explicitly for their programs by putting the Affero GPL on their programs and as long as the GNU GPL says it's compatible with that, that's a way you could activate that requirement for your code and it means we don't have to put any specific thing about that in the GNU GPL, we only have to make the GNU GPL compatible with it and we did.
[2h 01m 33s]
There's another kind of requirement that we've decided to permit, and this is patent retaliation clauses. Now, the reason is that there are several other free software licences that have patent retaliation clauses.
Patent retaliation means, if you sue somebody for patent infringement, then you lose the right to use this code.
Of course there are many ways to do that because every patent retaliation clause puts on some specifics, if you sue him or him for patent infringement in certain circumstances, then you lose the right to use this code, and the question is, what are those circumstances, what are the conditions under which the retaliation operates.
Now, we saw that there are some very broad and nasty patent retaliation clauses. Some of them say, "if you sue me for patent retaliation, for any reason about anything, you lose the right to use this code". Now that's bad because it means, suppose I sue you for patent infringement and you have a patent so you counter sue me, and then my free software licence retaliates against you and you lose the right to use that code, now that's not fair because in that case you are defending yourself, you're not the aggressor, so we decided to accept only patent retaliation clauses that are limited enough that they do not retaliate against defense, that they only retaliate against aggression, so there are two kinds of clauses that we identified that do this. One is, if the clause itself, makes a distinction between defense and aggression, so it says, if you sue somebody for patent infringement and it's aggression, then you lose the right to use this code, but if you are suing in retaliation for aggression, then what you are doing is defensive and then we do not retaliate against you.
This is one kind of patent retaliation clause that we accept.
[2h 04m 21s]
The other kind is, if you sue, alleging that some free software, relating to this code is patent infringement, then you lose the right to use this code. In the broad space of possible kinds of patent retaliation clauses, we picked two kinds, each of which is limited enough that it will not retaliate against people for practicing defense with patents. It will only retaliate against aggressors. And we've said these two kinds of clauses are OK to add to your code in a GNU GPL covered program. This is a conceptually complicated thing. There's no way to make it any simpler, I hope, at least, that I've explained it clearly.
The GPL itself does contain one very limited kind of patent retaliation, but it's a different kind. It says if make changes in a GPL-covered program and then somebody else makes similar changes and you sue him for patent infringement then you lose the right to continue making changes and copying the program to your own machines.
This is a very limited situation and it's meant to protect against one particular kind of abuse on the part of server operators where they make an improvement, which they're free to do, and run it on their servers and they don't release their source code and if the code does not have the Affero clause on it then they don't have to release the source code, and then you decide that you are going to implement a similar improvement and then they sue you for patent infringement.
So, once again, we're making a change that keeps people honest and makes sure that the four standard freedoms that the four standard freedoms that the GPL has always tried to ensure, really apply in all cases.
This is pretty much it, but there is also one interesting change in the section that deals with modified versions. There has always been a requirement that if you get a program that prints some kind of notice about the licence when it starts up, you can't take that out. We've generalised that so that it applies to various kinds of user interfaces in various ways.
So, for instance, if the program is graphical and it has an "about" box, the about box has to say "this is free software under the GPL". And if it starts up interactively and asks for commands, then it has to print the notice at the beginning, and the requirements are a little bit different depending on how obtrusive this would be. For example, the about box is simply a menu item sitting in a menu, well that doesn't bother anybody, so we just say that always has to be there.
On the other hand, printing a notice at start up can be annoying, there are certain programs which shouldn't print notices at start up. So what we say is that if the program that you got doesn't print a notice and you change it, then your program doesn't have to print a notice either. You know, if you change Bash, well Bash isn't supposed to print a notice when it starts up and we don't require you make it print a notice, but if you gave it a GUI, with menus, you would have to put in an about box because the about box doesn't do any harm.
[2h 10m 02s]
I've covered all the issues I can think of that are worth discussing, and I am willing to ask for questions however you can discuss a question with me but if you think you see a problem, you should go to the site gplv3.fsf.org and report this problem and get it considered through our discussion committees and they'll either publish an answer eventually, or they will pass the issue on to me and I'll think about whether a change is needed.
So, I'm ready for questions.
[2h 10m 55s]
[applause]
Q1: I would like to ask, what is the position of Stallman, and to clarify a bit about the different position of the Linux community about Digital Rights Management.
Stallman: I can't speak for them, and I don't want to try. All I can point out is that Linux is one of thousands of programs in the GNU+Linux operating system. These programs already have various different licences. If some of those programs continue to be distributed under GPL version two while others move to GPL version three or to "GPL version three or later", that won't be any disaster. The developers of Linux are the ones who will decide which licence to use on their program, but I'm confident that most of the GNU+Linux system will be under the GPL version three, regardless of what the Linux developers decide about their program.
I hope that they will move to GPL version three because I want to see Linux resisting Tivo-isation. Linux, after all, is one of the programs that has already been Tivo-ised.
[applause]
Q2: (Question asked in Italian, something about linking and dynamic languages)
Stallman: Actually, there are changes making it clearer that it doesn't matter which kind of linking is being used. If there are two modules that are designed to be run linked together and it's clear from the design from one or the other that they are meant to be linked together then we say they are treated as one program and so I hope that will make it a little bit clearer although that's not really a change, it's a clarification. That's what we believe GPL version two means already.
Q3a: I have two different questions. The first is what happens if anyone released code under GPL version two maybe ten years ago and now isn't happy with version three and says you're changing the spirit, when I said I would release it under version two and subsequent version, I didn't think of these. Do you imagine he would be bound to version three, or...
Stallman: Yes. Because we're not changing the spirit. These are small changes.
Q3a2: OK, so basically, you're the one who judges...
Stallman: Well, maybe a court might, but I can't believe that anyone not strongly prejudiced would conclude that this is a change in the spirit. A change in the spirit certainly permits change in the details of the requirements and anyone who released it under version two or later should have seen the changes that were made from version one, which were not as big but they were the same kinds of things. So yeh, if he released it under GPL "two or later" you'll be able to use it now under version three.
Q3b1: OK, the second question is that, as you know, I'm involved in these United Nation processes on the Internet governance, so I'm interested to know, do you think the fight against Digital Rights Managements and Trusted Comp[interrupted]
Stallman: Digital Restrictions Management, and Treacherous Computing. Don't use the enemy's propaganda terms, every time you use those terms you are supporting the enemy.
[applause]
Q3b2: OK, so the correct term is Treacherous Computing right? So on the fight against these new mechanisms, do you think it can only be won by writing free software, releasing free software?
Stallman: I don't know.
Q3b3: Do you imagine that there should be need for intervention or lobbying at the legal level?
Stallman: I think Treacherous Computing should be illegal. But I don't know how we're going to convince governments to actually do that because governments mostly are not very democratic anymore. They mostly are the pro-consuls of the mega corporations, their job is to keep us in line under the rule of the empire. That's why they run for office, they get into office, they do what the emperor -- the emperor being the mega corporations -- tells them to do, and their job is explaining to us why they can't do what we want them to do. It's very very sad and once in a while somebody has enough courage to refuse to obey, somebody like [sounds like Hugo Chavez].
Q3b4: So do you think it's not even worth trying?
Stallman: Oh, it's worth trying. It's just going to be hard, the point is you have to keep putting the pressure on these politicians. In France, there is a battle going on and we still might win it about the legalisation of peer-to-peer copying on the Internet. This shows that when enough people get energised, the empire can lose a battle.
It's very important.
[applause]
[2h 19m 53s]
Stallman: Another thing that people should do is refuse to buy anything that's based on DRM. Don't buy corrupt disks, that is the fake CDs that have music set up so that you're blocked from copying it. Don't buy DVDs unless you have DeCSS and you can copy it.
If you can't copy it - don't buy it!
[applause]
[2h 20m 23s]
Q4: (Question in Italian, mentions Eben Moglen)
Stallman: Well, first, I'm the one who decides what goes into GPL version three, and, of course, whenever I think of language I'm usually working with Eben Moglen since he's a lawyer and he's the only one that can tell me if the language will really do what I hope it will do. Meanwhile, a lot of other people are involved. For instance, you can go to the gplv3.fsf.org site and study it and if you think you see something that's not good or whatever kind of problem you might think there is, you can report it and your comment will go to a discussion committee and, there are four discussion committees, it will go to one of those committees which will then group your comment with other comments that raise that same issue and then they will study each issue and post the issue and their response to it and your comment will be connected to the issue which they grouped it into so it will be connected to the response as well.
And thus, there are probably hundreds of people participating in checking the draft and trying to make sure it does the right thing.
Q5: In the end of the process of deciding what modifications of the licence will be done there's one single person, that is you. Can you explain why this decision and you have not chosen to make some group?
Stallman: I don't know other people who can do this.
I hope that the process that's going on now will help develop people who can be part of some group activity but at the moment, I don't know anyone that I could delegate this to. Obviously I can't always forever be the person doing this, barring unforeseen advances in medical technology or AI and nanotechnology, which I certainly hope will come soon but they're not likely, but at this point, I think this is the right thing to do.
Q5.2: Maybe it will change in the future.
Stallman: I hope. We're going to have to replace me somehow, sooner or later.
[applause]
[2h 24m 30s]
Q6: You told us about what GPLv3 will be, but what about the issues that are included, the suggestions that you refused. Can you give us some samples?
Stallman: Well, when I decided that we had to do something to resist Digital Restrictions Management, the obvious way to do this would be restrictions on what kinds of jobs the program can be made to do, but I decided that that would be the wrong way to do it and so I thought hard and I came up with a way to achieve the job by directly protecting the freedom of each user without any restrictions about what technical job a version of the program can do.
Another example of what we decided not to do was putting the Affero clause into the GNU GPL in some way.
Another example of something we decided not to do, we decided not to put in very much in the way of patent retaliation clause and the reason is we have doubts about how effective those clauses really can be. We have doubts about whether our community actually has enough power that the threat of our retaliation would scare anyone.
So, these are some examples of changes we decided not to do. Some for reasons of principle and some for practical reasons.
So, thank you for your attention, and happy hacking.
[applause]

由 beat 发表于 上午10点54分 | 回复 (0)

2006年04月01日 星期六

pdflatex使用中文字体

首先,还是使用gbkfonts程序自动生成所有的字体文件和map。

将生成的所有文件按目录结构放到系统目录下面。

将cjk.map拷贝到texmf/fonts/map/

修改texmf/web2c/updmap.cfg
最后面加上Map cjk.map

运行mktexlsr,运行updmap即可。

由 beat 发表于 下午04点13分 | 回复 (2)