|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
☆PC机上的内存(RAM)可分为4类:
1.传统内存
传统内存的地址空间是位于0KB~640KB之间。不论使用哪一种类型的CPU,从8086到486,传统内存都是必需的。它是MS-DOS运行程序最重要的舞台。
2.保留内存
由于MS-DOS最初是为8086/8088 CPU设计的操作系统,最多只能使用1MB的内存。这1MB内存最前面的640KB就是前述的传统内存;至于后面剩下的384KB,则保留给BIOS ROM、硬件接口卡(如VGA卡、硬盘控制卡)上的ROM与VidelBuffer使用。
保留内存(Reserved Memory)的地址空间位于640KB~1024KB之间,是保留给外部使用的地址空间。保留内存其实不应该称为内存,应该称为保留内存空间,因为在此空间内并未安装实体的RAM。
在保留内存的384KB地址空间内,除了由视频缓冲区、BIOS ROM和其他硬件扩充卡所使用之外,仍有许多空隙。可运用386/486的分页(paging)能力,将扩展内存映射过来填补这些空隙,因为这些空隙还在DOS的1MB范围之内。(以往是因为没有安插内存,所以才无法使用,现在以分页技术配置好内存之后,便成为可供DOS使用的内存了---这句其实不太明白)我们称这些在640KB以上地址的内存为“上位内存(Upper Memory)”,上位内存可能因外部卡的安装而被分成几个块,所以又称为上位内存块(Upper Memory Blocks)简称UMB。
3.扩展内存
扩展内存(Extended Memory)是指位于1024KB以后的内存。对于我们的内存RAM,扣除640KB的传统内存,其余全部都是扩展内存。
虽然从计算机主机板上看,所有的RAM都排列在一起,但事实上,超过640KB传统内存以外的RAM,其安插的位置是跳过384KB的保留内存而往1MB以后的空间再延续下去。(在640KB~1024KB的区间是没有RAM存在的)[?这两段合着是说,假如我有2M的RAM,事实上是占有(2M+384KB)的空间呢,还是说号称2M其实真实容量是(2M-384KB)----因为有384KB的空间位置是虚的?]
由于MS-DOS本来只能管理1MB以内内存,而保留内存内又没有实体RAM,所以只有传统内存才是MS-DOS的“管辖区”。必须通过286/386/486的保护模式,才可以使用高于1024KB地址的内存。
(1)HMA
在1MB以后的第一个64KB(1024~1088KB)的扩展内存,我们称为HMA(High Memory Area)。
80286以上的CPU,由于地址线超过20条,可以很巧妙地使DOS获得额外的64KB使用空间。其关键在于CPU是否将A20地址线打开(设为ON)。所以在286以上的计算机上,将A20地址一律设为ON,就可以获得这额外的64KB内存,这也就是HMA的所在。
(2)XMM
如前所述,MS-DOS的管不到扩展内存的,为了有效地利用扩展内存,程序应该通过“管理程序”来统一运用扩展内存。此种管理程序就称为扩展内存管理程序(XMM,extended Memory Manager)。
(3)XMS(extended Memory Specification)
为了能有共同的“管理规则”,Lotus/Intel/Microsoft/AST4家公司提出了所谓的XMS规则。MS-DOS提供的Himen.sys程序,就是一个符合这一规则的扩展内存管理程序。
4.扩充内存
以扩充内存槽加插内存而扩充出来的内存称为“扩充内存”(Expanded Memory)。它不像扩展内存线性地排列在1MB之后,而是独立于一旁。Lotus/Intel/Mircosoft3家公司共同提出了所谓的LIM/EMS(~Specification)规范。依据LIMEMS的规定,程序必须通过页帧(Page Frame)的映射,才能对扩充内存进行数据的存取。不像其他的内存可以直接根据地址来存取数据,所以速度较慢。(这块完全没有概念,难道现在第二个插槽的内存都属于扩充内存?#_#)
Last edited by Billunique on 2007-4-9 at 08:01 AM ]
☆The memory (RAM) on a PC can be divided into 4 categories:
1. Traditional Memory
The address space of traditional memory is between 0KB ~ 640KB. Regardless of the type of CPU used, from 8086 to 486, traditional memory is necessary. It is the most important stage for MS-DOS to run programs.
2. Reserved Memory
Since MS-DOS was originally an operating system designed for 8086/8088 CPUs, it can use at most 1MB of memory. The first 640KB of this 1MB memory is the aforementioned traditional memory; as for the remaining 384KB, it is reserved for BIOS ROM, ROM on hardware interface cards (such as VGA cards, hard disk control cards), and VidelBuffer.
The address space of reserved memory (Reserved Memory) is between 640KB ~ 1024KB, which is an address space reserved for external use. Reserved memory should not actually be called memory, but should be called reserved memory space, because no physical RAM is installed in this space.
In the 384KB address space of reserved memory, in addition to being used by video buffers, BIOS ROM, and other hardware expansion cards, there are still many gaps. The paging (paging) capability of 386/486 can be used to map extended memory over to fill these gaps, because these gaps are still within the 1MB range of DOS. (Previously, because there was no installed memory, it could not be used. Now, after configuring memory with paging technology, it becomes memory available for DOS - I don't really understand this sentence) We call the memory above the 640KB address "Upper Memory (Upper Memory)", and upper memory may be divided into several blocks due to the installation of external cards, so it is also called Upper Memory Blocks ( Upper Memory Blocks ) for short UMB.
3. Extended Memory
Extended memory (Extended Memory) refers to the memory after 1024KB. For our memory RAM, after deducting 640KB of traditional memory, the rest is all extended memory.
Although all RAM is arranged together from the computer motherboard, in fact, the RAM beyond the 640KB traditional memory is inserted in the space after 1MB, skipping the 384KB reserved memory. (There is no RAM in the interval of 640KB ~ 1024KB)
Since MS-DOS originally could only manage memory within 1MB, and there is no physical RAM in the reserved memory, only traditional memory is the "jurisdiction" of MS-DOS. It is necessary to use the protected mode of 286/386/486 to use the memory above the 1024KB address.
(1) HMA
The first 64KB (1024 ~ 1088KB) of extended memory after 1MB is called HMA (High Memory Area).
For CPUs above 80286, since the address lines exceed 20, it can cleverly enable DOS to obtain an additional 64KB of use space. The key is whether the CPU turns on the A20 address line (set to ON). So on computers above 286, setting the A20 address to ON uniformly can obtain this additional 64KB of memory, which is where HMA is located.
(2) XMM
As mentioned earlier, MS-DOS cannot manage extended memory. In order to effectively use extended memory, the program should uniformly use extended memory through a "manager". Such a manager is called an extended memory manager (XMM, extended Memory Manager).
(3) XMS (extended Memory Specification)
In order to have a common "management rule", Lotus/Intel/Microsoft/AST four companies put forward the so-called XMS rule. The Himen.sys program provided by MS-DOS is an extended memory manager that conforms to this rule.
4. Expanded Memory
The memory expanded by inserting memory into the expanded memory slot is called "Expanded Memory". It is not linearly arranged after 1MB like extended memory, but is independent. Lotus/Intel/Mircosoft three companies jointly put forward the so-called LIM/EMS (~Specification) specification. According to the LIMEMS regulations, the program must access data in expanded memory through page frame (Page Frame) mapping. Unlike other memories that can directly access data according to the address, so the speed is slower. (I have no concept of this piece at all, could it be that the memory in the second slot now belongs to expanded memory? #_#)
Last edited by Billunique on 2007-4-9 at 08:01 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-8 07:51 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
☆关于Format(其实基础的东西需要了解的还很多):
Format命令的用途主要是将磁盘格式化,以建立磁道、扇区的构造,并且会在磁盘上建立启动扇区(Boot Sector)、根目录(Root)以及FAT表(File Allocation Table),用以管理磁盘的文件。
早期版本的Format做格式化时,会把扇区里的数据完全清除。但从DOS5.0版起的Format,默认采用了“非破坏性”的方式。
它并不会将磁盘上原有的数据完全消除。事实上,做完非破坏性格式化后,原有数据还是存在磁盘上,只有启动扇区、根目录和FAT更新而已。由于启动扇区、根目录和FAT记载的是硬盘的使用状态,所以更新之后,表面看起来像是全新的空磁盘,DIR时什么也看不到,但事实上硬盘的原数据还是存在的。这就是我们能将磁盘数据救回来的真正原因!
非破坏性的格式化会在磁盘里建立“隐藏性”的文件,叫“Mirror映像文件”,以保存原来的启动扇区、FAT和根目录等“与磁盘系统有关的”数据,以备Unformat时使用。
建好隐藏性的映像文件后,Format便开始建立新的启动扇区、空白的FAT与根目录,至于其他扇区,则只做检查(Verify)而不改变扇区的内容。由于原来的启动扇区、FAT、根目录都被保存起来了,而所有的文件、子目录则未予更动,所以非破坏格式化之后,若立即运行Unformat命令,便可将数据完整地恢复出来。所以“非破坏性”的格式化也就是“可恢复的”格式化。
当Format发现原磁盘所剩空间不足以建立Mirror映像文件,即存放启动扇区、FAT和根目录数据的时候(基本上针对软盘了,^_^),就会询问用户是否要运行破坏性的格式化。
Format默认是非破坏性的,如果用户自己需要破坏性格式化,则可以给Format指定/U参数。
如果使用了/S参数,则Format完成非破坏性格式化后要将系统文件写入软盘时,会避开该软盘里原来的数据,而若原来的数据太多,使得系统文件写入后势必盖掉一些原来的数据扇区,这时候就会显示信息询问用户是否仍要将系统文件写入。(WARNING:This disk cannot be unformatted if system files are transferred.Proceed with system transfer anyway(Y/N)?)
注:如果连续做两次非破坏性格式化,就不能用Unformat恢复原状了,因为在做第二次的时候,Mirror里保存的数据会是“当时”的,也就是硬盘状态为未使用时的记录。这样的话,恢复后就会得到一个空的FAT和根目录。
如果使用/Q参数,会略过“检查扇区”的步骤。换言之,就是“简化”的非破坏性格式化,所以运行速度很快。(如果确信硬盘没问题,完全可以加上这一参数,加快格式化速度)
如果使用/Q/U组合,则原来的启动扇区、FAT和根目录不会被保存,而会直接重建,至于其他扇区则既不被破坏,也不被检查。换言之,就是“简化”的破坏性格式化。
Last edited by Billunique on 2007-4-10 at 03:07 AM ]
☆About Format (actually, there are still many basic things to understand):
The main purpose of the Format command is to format the disk to establish the structure of tracks and sectors, and it will create a boot sector (Boot Sector), root directory (Root), and FAT table (File Allocation Table) on the disk to manage files on the disk.
When early versions of Format were used for formatting, they would completely erase the data in the sectors. But starting from DOS version 5.0, Format uses the "non-destructive" method by default.
It does not completely erase the original data on the disk. In fact, after non-destructive formatting, the original data still exists on the disk, and only the boot sector, root directory, and FAT are updated. Since the boot sector, root directory, and FAT record the usage status of the hard disk, after the update, it seems like a brand new empty disk on the surface, and nothing is seen when using DIR, but in fact, the original data of the hard disk still exists. This is the real reason why we can recover disk data!
Non-destructive formatting will create a "hidden" file in the disk, called a "Mirror image file", to save the original boot sector, FAT, root directory, and other "disk system-related" data for use when using Unformat.
After creating the hidden image file, Format starts to create a new boot sector, blank FAT, and root directory, while only checking (Verify) other sectors without changing the content of the sectors. Since the original boot sector, FAT, and root directory are all saved, and all files and subdirectories are not changed, after non-destructive formatting, if the Unformat command is run immediately, the data can be completely recovered. So "non-destructive" formatting is also "recoverable" formatting.
When Format finds that there is not enough free space on the original disk to create the Mirror image file, that is, to store the data of the boot sector, FAT, and root directory (Basically for floppy disks, ^_^), it will ask the user whether to run destructive formatting.
Format is non-destructive by default. If the user needs destructive formatting by themselves, they can specify the /U parameter for Format.
If the /S parameter is used, when Format completes non-destructive formatting and needs to write system files to the floppy disk, it will avoid the original data in the floppy disk. If there are too many original data, so that the system files will definitely overwrite some original data sectors after writing, then a message will be displayed asking the user whether to still write the system files. (WARNING: This disk cannot be unformatted if system files are transferred.Proceed with system transfer anyway(Y/N)?)
Note: If non-destructive formatting is done twice in a row, Unformat cannot restore it to the original state, because the data saved in Mirror during the second time will be the "current" one, that is, the record when the hard disk state is unused. In this case, after recovery, an empty FAT and root directory will be obtained.
If the /Q parameter is used, the step of "checking sectors" will be skipped. In other words, it is a "simplified" non-destructive formatting, so the running speed is very fast. (If you are sure that the hard disk is okay, you can definitely add this parameter to speed up the formatting speed)
If the /Q/U combination is used, the original boot sector, FAT, and root directory will not be saved, but will be rebuilt directly, while other sectors are neither destroyed nor checked. In other words, it is a "simplified" destructive formatting.
Last edited by Billunique on 2007-4-10 at 03:07 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-9 08:33 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
☆80x86的地址表示法:
当一个程序运行时,其内存空间的分布可以分为:程序区、数据区以及堆栈区。其中,程序区存放程序码以供CPU来读取、运行,数据区存放被处理的数据,而堆栈区则作为程序中断或调用子程序时的数据及返回地址的缓冲区。
早期8088CPU的内部寄存器只有16位。这些寄存器是AX、BX、CX、DX、BP、IP、SP、SI、DI、CS、DS、ES、SS及FLAG,共14个。后来的80x86系列虽然已有更多的改良,但仍保持8088的基本模式。
前列的14个寄存器组中,有一个寄存器叫指令寄存器(Instruction Pointer,简称IP)当程序运行时,IP会指向程序的起始地址,然后CPU便往IP所指的地址上读取指令。接着IP自动指向下一指令的地址,以便继续运行下一指令。
IP只有16位,只能定义出2的16次方即65536个字节,又如何能定出1M字节的内存地址呢?IP岂不是还差4个位才能定出1MB的内存地址?80x86是如何来补足这4个位的呢?为了解决这个问题,80x86是以两个16位的寄存器来组合出一个20位的地址的。80x86有4个16位寄存器叫段寄存器(Segment Pointer):CS、DS、ES、SS,将其中的CS指示器与IP相配合,就可以构成20个位来定出1MB的空间。
也就是说,80x86将段指示器的值看到20个定址位的后16位,即b4~b19(由b0算起),而将IP的值看成是20位地址的前16位,即b0~b15,将这两个寄存器错开4个位相加后就建立一个20位的位数组,CPU将此20位送往地址线就可以定出1M的地址了。
以986895这个地址而言,其16进制表示为F0F0F,可以将段指示器设为F0F0,而IP设为000F,二者错开4个位(即1个16进制位)相加后就是F0F0F了。
一个地址是由5位的16进制表示的,但为了要指出其段指示器与IP的组成内容,可以直接列出此二寄存器的值,而以冒号来分隔。Debug程序就是以这种方式来表示地址的。称段指示器CS的值为段地址,而程序指示器IP的值为段内地址。
虽然F0F0:0000F组合成的地址是F0F0F,但F0F0F不一定是由F0F0:000F组合成的,它可能由F000:0F0F或F001:0EFF等非常多的方式组成,除非查出寄存器真正的内含值,否则无法断言一个地址是由什么样的两个值组成的。
Last edited by Billunique on 2007-4-26 at 03:44 AM ]
☆Address Representation of 80x86:
When a program is running, the memory space distribution can be divided into: program area, data area, and stack area. The program area stores program codes for the CPU to read and run, the data area stores processed data, and the stack area serves as a buffer for data and return addresses during program interrupts or subroutine calls.
Early 8088 CPU internal registers were only 16-bit. These registers are AX, BX, CX, DX, BP, IP, SP, SI, DI, CS, DS, ES, SS, and FLAG, a total of 14. Later 80x86 series, although there have been more improvements, still maintain the basic mode of 8088.
Among the first 14 register groups, there is a register called the Instruction Pointer (abbreviated as IP). When the program is running, IP will point to the starting address of the program, and then the CPU will read the instruction from the address pointed to by IP. Then IP automatically points to the address of the next instruction to continue running the next instruction.
IP is only 16-bit, which can only define 2^16, that is, 65536 bytes. How can it define a 1M-byte memory address? Doesn't IP still lack 4 bits to define a 1MB memory address? How does 80x86 make up for these 4 bits? To solve this problem, 80x86 uses two 16-bit registers to combine to form a 20-bit address. 80x86 has 4 16-bit registers called segment registers (Segment Pointer): CS, DS, ES, SS. Cooperating the CS indicator with IP can form 20 bits to define a 1MB space.
That is to say, 80x86 sees the value of the segment indicator as the last 16 bits of the 20 addressing bits, that is, b4 to b19 (counting from b0), and sees the value of IP as the first 16 bits of the 20-bit address, that is, b0 to b15. Adding these two registers with a shift of 4 bits establishes a 20-bit bit array. The CPU sends this 20 bits to the address line to define a 1M address.
Taking the address 986895 as an example, its hexadecimal representation is F0F0F. The segment indicator can be set to F0F0, and IP can be set to 000F. Adding them with a shift of 4 bits (that is, 1 hexadecimal digit) results in F0F0F.
An address is represented by 5 hexadecimal digits, but in order to indicate the composition of its segment indicator and IP, you can directly list the values of these two registers and separate them with colons. The Debug program represents the address in this way. The value of the segment indicator CS is called the segment address, and the value of the program indicator IP is called the intra-segment address.
Although the combination of F0F0:0000F forms the address F0F0F, F0F0F is not necessarily composed of F0F0:000F. It may be composed of F000:0F0F or F001:0EFF, etc. in many ways. Unless the true contents of the registers are found out, it is impossible to assert what kind of two values an address is composed of.
Last edited by Billunique on 2007-4-26 at 03:44 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-10 06:27 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
☆Debug浅尝(等有好书后再研究):
A(汇编)
直接将8086/8088记忆码合并到内存。
该命令从汇编语言语句创建可执行的机器码。所以数值都是十六进制格式,必须按一到四个字符输入这些数值。在引用的操作码前指定前缀记忆码。
C(比较)
比较内存的两个部分。
D(转储)
显示一定范围内存地址的内容。
E(键入)
将数据输入到内存中指定的地址。
可以按十六进制或ASCII格式键入数据。任何以前存储在指定位置的数据全部丢失。
F(填充)
使用指定的值填充指定内存区域中的地址。
可以指定十六进制或ASCII格式表示的数据。任何以前存储在指定位置的数据将会丢失。
G(转向)
运行当前在内存中的程序。
H(十六进制)
对指定的两个参数执行十六进制运算。
I(输入)
从指定的端口读取并显示一个字节值。
L(加载)
将某个文件或特定磁盘扇区的内容加载到内存。
M(移动)
将一个内存块中的内容复制到另一个内存块中。
N(名称)
指定Debug I或W命令的可执行文件的名称,或者指定正在调试的可执行文件的参数。
O(输出)
将字节值发送到指定端口。
P(执行)
执行循环、重复的字符串指令、软件中断或子例程;或通过任何其他指令跟踪。
Q(退出)
停止Debug会话,不保存当前测试的文件。
R(寄存器)
显示或改变一个或多个CPU寄存器的内容。
S(搜索)
在某个地址范围搜索一个或多个字节值的模式。
T(跟踪)
执行一条指令,并显示所有注册的内容、所有标志的状态和所执行指令的解码形式。
U(反汇编)
反汇编字节并显示相应的原语句,其中包括地址和字节值。反汇编代码看起来像已汇编文件的列表。
W(写入)
将文件或特定分区写入磁盘。
XA(分配扩展内存)
分配扩展内存的指定页面数。
要使用扩展内存,必须安装符合4.0版的Lotus/Intel/Microsoft扩展内存规范的扩展内存设备驱动程序。
XD(释放扩展内存)
释放指向扩展内存的句柄。
XM(映射扩展内存页)
将属于指定句柄的扩展内存逻辑页映射到扩展内存的物理页。
XS(显示扩展内存状态)
显示有关扩展内存状态的信息。
(云里雾里的,忍了<img src="images/smilies/face-raspberry.png" align="absmiddle" border="0">)
Last edited by Billunique on 2007-4-10 at 07:29 AM ]
☆Debug Taste (Wait to study after having a good book):
A (Assembly)
Directly merge 8086/8088 mnemonics into memory.
This command creates executable machine code from assembly language statements. So the values are all in hexadecimal format, and these values must be entered as one to four characters. Specify prefix mnemonics before the referenced opcodes.
C (Compare)
Compare two parts of memory.
D (Dump)
Display the contents of a range of memory addresses.
E (Type)
Enter data into the specified address in memory.
You can enter data in hexadecimal or ASCII format. Any previously stored data in the specified location is completely lost.
F (Fill)
Fill the addresses in the specified memory area with the specified value.
You can specify data represented in hexadecimal or ASCII format. Any previously stored data in the specified location will be lost.
G (Go)
Run the program currently in memory.
H (Hexadecimal)
Perform hexadecimal operations on the specified two parameters.
I (Input)
Read and display a byte value from the specified port.
L (Load)
Load the contents of a file or a specific disk sector into memory.
M (Move)
Copy the contents of one memory block to another memory block.
N (Name)
Specify the name of the executable file for the Debug I or W command, or specify the parameters of the executable file being debugged.
O (Output)
Send a byte value to the specified port.
P (Proceed)
Execute loops, repeated string instructions, software interrupts or subroutines; or trace through any other instructions.
Q (Quit)
Stop the Debug session without saving the currently tested file.
R (Register)
Display or change the contents of one or more CPU registers.
S (Search)
Search for a pattern of one or more byte values in a range of addresses.
T (Trace)
Execute an instruction and display the contents of all registers, the status of all flags, and the decoded form of the executed instruction.
U (Unassemble)
Unassemble bytes and display the corresponding original statement, including the address and byte value. The unassembled code looks like a list of assembled files.
W (Write)
Write a file or a specific partition to a disk.
XA (Allocate Extended Memory)
Allocate the specified number of pages of extended memory.
To use extended memory, an extended memory device driver that complies with the Lotus/Intel/Microsoft Extended Memory Specification version 4.0 must be installed.
XD (Free Extended Memory)
Free the handle pointing to extended memory.
XM (Map Extended Memory Page)
Map the extended memory logical page belonging to the specified handle to the physical page of extended memory.
XS (Display Extended Memory Status)
Display information about the status of extended memory.
(In a fog, endure it:P)
Last edited by Billunique on 2007-4-10 at 07:29 AM ]
附件
1: Debugh.jpg (2007-4-10 07:05, 32.25 KiB,下载次数: 4)
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-10 07:05 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
☆网络管理命令(Some):
远程登录--Telnet
远程登录就是将本地计算机作为远程主机上的一个终端使用。目前使用最多的BBS系统。简单地讲,远程登录就是在本地计算机上键入的所有命令,并不是在本地机上执行,而是在远程主机上执行。就好像本地计算机的键盘与显示器直接连到了远程主机上。这样,从远程终端就可以直接管理服务器,给网络管理与测试带来很大的方便。
要想使用Telnet远程登录,远程主机必须先启动Telnet服务,并设置好相应的参数与环境变量;另外,Telnet是一个基于TCP/IP协议的程序,所以本地计算机首先要配置好TCP/IP协议。
显示和修改本地ARP列表--ARP
ARP(Address Resolution Protocol)是负责将IP地址解析成MAC地址的协议,对于网络中的高层应用程序,网络主机之间的通信是靠IP地址来完成的,但在TCP/IP协议的最底层,主机之间的交换则是通过MAC地址来定位的。每台装网卡的主机中都有一个ARP表,保存着同一网络中IP到MAC之间的映射记录。ARP表并不是一成不变的,大约每两分钟更新一次,这种记录称为动态式(Dynamic)记录。还有一种称为静态记录,也就是表中的记录不变,直到TCP/IP协议重启后才会消失。
-a 通过询问TCP/IP显示当前ARP项。可指定特定IP。
-d 删除由特定IP指定的项。
-s 在ARP缓存中添加项,将IP地址和物理地址相关联。在“租期”到了之后,项自动从缓存中删除。
ARP在添加静态记录之前,必须有一个MAC寻址的过程。当一个TCP/IP的包要发出时,会先查看本机ARP表中的记录是否有该IP的记录。如果有,则直接转换成该IP对应的MAC;如果没有,则将发一个ARP Request广播封包向对方查询MAC地址。这个广播包会被同一子网内的所有主机收到。但只有与该IP相同的主机接收,并回答一个ARP APPLY封包,该包有相应IP与MAC的信息,这样就可以找到相应主机的MAC地址了。
在ARP表中的记录一般是动态的,大约每两分钟刷新一次。如果本地有频繁的IP要访问时,比如网关、伺服器、路由器等,为了减少发送ARP Request广播包,可以在ARP表中创建静态记录。
显示和修改本地路由表命令--Route
大多数主机都驻留在只连接一台路由器的网段上,因此不存在使用哪一台路由器将数据包发送到远程计算机的问题。该路由器的IP地址即是该网段上所有计算机的缺省网关。但是,当网络上拥有两个或多个路由器时,就不一定只依赖默认网关了。可以让某些远程IP地址通过某个特定的路由器来传递,而其他的远程IP通过另一个路由器来传递。这时,需要相应的路由信息,这些信息存储在路由表中,每个主机和每个路由器都配有自己独一无二的路由表。大多数路由器使用专门的路由协议来交换和动态更新路由器之间的路由表。但在有些情况下,必须手动将项目添加到路由器和主机上的路由表中。这时就要用到Route命令,它用于显示、人工添加和修改路由表项目。(具体先不管了,以后再说,毕竟现在主要学习DOS,而非NT改进命令。)
Last edited by Billunique on 2007-4-10 at 10:47 AM ]
☆Network Management Commands (Some):
Remote Login -- Telnet
Remote login means using the local computer as a terminal on a remote host. Currently, it is the most widely used BBS system. Simply put, all commands typed on the local computer are not executed on the local machine but on the remote host. It's like the keyboard and monitor of the local computer are directly connected to the remote host. In this way, you can directly manage the server from a remote terminal, bringing great convenience to network management and testing.
To use Telnet remote login, the remote host must first start the Telnet service and set up corresponding parameters and environment variables; besides, Telnet is a program based on the TCP/IP protocol, so the local computer must first configure the TCP/IP protocol.
Display and Modify Local ARP List -- ARP
ARP (Address Resolution Protocol) is a protocol responsible for resolving IP addresses into MAC addresses. For high-level applications in the network, communication between network hosts is completed by IP addresses, but at the bottom layer of the TCP/IP protocol, the exchange between hosts is located by MAC addresses. Each host with a network card has an ARP table that stores mapping records of IP to MAC in the same network. The ARP table is not static; it is updated approximately every two minutes, and such records are called dynamic records. There is also a static record, that is, the records in the table do not change until the TCP/IP protocol is restarted.
-a Queries TCP/IP to display current ARP entries. A specific IP can be specified.
-d Deletes the entry specified by a specific IP.
-s Adds an entry in the ARP cache, associating the IP address with the physical address. The entry is automatically deleted from the cache after the "lease" expires.
Before adding a static record in ARP, there must be a MAC addressing process. When a TCP/IP packet is to be sent, it will first check whether there is a record of the IP in the local ARP table. If there is, it is directly converted into the MAC corresponding to the IP; if not, an ARP Request broadcast packet will be sent to query the MAC address from the other party. This broadcast packet will be received by all hosts in the same subnet. But only the host with the same IP will receive and answer an ARP APPLY packet, which has the corresponding IP and MAC information, so that the MAC address of the corresponding host can be found.
The records in the ARP table are generally dynamic and are refreshed approximately every two minutes. If there are frequent visits to IPs locally, such as gateways, servers, routers, etc., in order to reduce the sending of ARP Request broadcast packets, static records can be created in the ARP table.
Display and Modify Local Routing Table Command -- Route
Most hosts reside on a segment connected to only one router, so there is no problem of which router to use to send packets to a remote computer. The IP address of this router is the default gateway for all computers on this segment. However, when there are two or more routers on the network, you don't have to rely only on the default gateway. Some remote IP addresses can be passed through a specific router, and others can be passed through another router. At this time, corresponding routing information is needed, and this information is stored in the routing table. Each host and each router is equipped with its own unique routing table. Most routers use special routing protocols to exchange and dynamically update the routing tables between routers. But in some cases, items must be manually added to the routing tables on routers and hosts. Then the Route command is used, which is used to display, manually add, and modify routing table items. (Specifically, let's not care for now, we'll talk about it later. After all, we are mainly learning DOS now, not NT improved commands.)
Last edited by Billunique on 2007-4-10 at 10:47 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-10 10:10 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
☆网络测试命令(some):
显示NetBIOS协议的统计资料命令--Nbtstat
Nbtstat命令用于显示本地计算机和远程计算机的基于TCP/IP协议的NetBIOS统计资料、NetBIOS名称表和NetBIOS名称缓存。Nbtstat可以刷新NetBIOS名称缓存和注册的Windows Internet名称服务(WINS)名称。
NetBIOS(Network Basic Input Output System,网络基本输入输出系统)是局域网(LAN)上的程序可以使用的API,几乎所有的局域网计算机都是在NetBIOS基础上工作的。NetBIOS为程序提供了请求低级服务的统一的命令集,这些服务是管理名称、执行会话和在网络节点之间发送数据包所要求的。
显示网络连接信息--Netstat
在服务器与网络的管理中,需要经常查看服务器所开放的端口、当前的所有连接,以便随时了解网络状态。这时就要使用Netstat命令。该命令可以让管理员轻松查看计算机系统服务是否正常,是否被“黑客”留下后门、木马等。Netstat同时也是一个实时的入侵检测工具,可以随时查看是否有不正常的连接。
Netstat命令用于显示活动的TCP连接、计算机侦听端口、以太网统计信息、IP路由表、IPv4统计信息(对于IP、ICMP、TCP和UDP协议)以及IPv6统计信息(对于IPv6、ICMPv6通过IPv6的TCP及通过IPv6的UDP协议)。
数据包跟踪诊断--Tracert
当数据包从本地计算机经过多个网关传送到目的地时,它寻找一条具体路径来传送,每次传送数据包,不能保证或认为总遵循唯一的一条路径。那么如何知道发送的数据包所经过的路径呢?这时就要用到Tracert命令。它同样是内置于TCP/IP的应用程序之一,可以对IP地址或URL进行相应的域名转换。Tracert一般用于检测故障的区段,从而便于查找和排除故障。
Tracert诊断实用程序将包含不同生存时间(TTL)值的Internet消息控制协议(ICMP)回显数据包发送到目标,以决定到达目标使用的路由。要在转发数据包上的TTL之前至少递减1,必须经过路径上的每个路由器,所以TTL是有效的跃点计数。数据包上的TTL达到0时,路由器应该将“ICMP已超时”的消息发送回源系统。Tracert先发送TTL为1的回显数据包,并在随后的每次发送过程将TTL递增1,直到目标响应或TTL达到最大值,从而确定路由。路由通过检查中级路由器返回的“ICMP已超时”的消息来确定路由。不过,有些路由器下传包含过期TTL值的数据包,而Tracert看不到。(看不懂,再说)
☆Network test commands (some):
Command to display NetBIOS protocol statistics -- Nbtstat
The Nbtstat command is used to display NetBIOS statistics, NetBIOS name tables, and NetBIOS name caches based on the TCP/IP protocol for the local computer and remote computers. Nbtstat can refresh the NetBIOS name cache and registered Windows Internet Name Service (WINS) names.
NetBIOS (Network Basic Input Output System) is an API that programs on a local area network (LAN) can use. Almost all LAN computers work based on NetBIOS. NetBIOS provides a unified set of commands for programs to request low-level services, which are required for managing names, performing sessions, and sending data packets between network nodes.
Display network connection information -- Netstat
In server and network management, it is necessary to frequently check the ports opened by the server and all current connections to understand the network status at any time. At this time, the Netstat command is used. This command allows administrators to easily check whether the computer system services are normal and whether "hackers" have left backdoors, Trojans, etc. Netstat is also a real-time intrusion detection tool that can check at any time whether there are abnormal connections.
The Netstat command is used to display active TCP connections, computer listening ports, Ethernet statistics, IP routing tables, IPv4 statistics (for IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for IPv6, ICMPv6 over IPv6 TCP, and UDP over IPv6 protocols).
Packet trace diagnosis -- Tracert
When a data packet is transmitted from the local computer to the destination through multiple gateways, it finds a specific path to transmit. Each time a data packet is transmitted, it cannot be guaranteed or assumed that it always follows a unique path. Then how to know the path that the sent data packet has passed through? At this time, the Tracert command is used. It is also one of the applications built into TCP/IP, which can perform corresponding domain name conversion for IP addresses or URLs. Tracert is generally used to detect the faulty section, so as to facilitate finding and eliminating faults.
The Tracert diagnostic utility sends Internet Control Message Protocol (ICMP) echo packets with different Time to Live (TTL) values to the target to determine the route used to reach the target. The TTL must be decremented by at least 1 before forwarding the TTL on the packet, and each router on the path must be passed, so TTL is an effective hop count. When the TTL on the packet reaches 0, the router should send an "ICMP timed out" message back to the source system. Tracert first sends an echo packet with TTL of 1, and increments the TTL by 1 in each subsequent transmission until the target responds or the TTL reaches the maximum value, thereby determining the route. The route is determined by checking the "ICMP timed out" message returned by the intermediate router. However, some routers pass down packets with expired TTL values, and Tracert cannot see them. (Don't understand, say again)
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-11 04:57 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
☆ Boot.ini文件解释(基础的东西里面都是有文章的):
Boot.ini文件的内容可分为和两部分。就不说了,我们来看看。比如有这样一个----
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdist(0)partition(2)WINNT="Microsoft Windows 2000 Server" /fastdetect
英文引号内的文字,就是引导菜单里显示出来的,选择操作系统的提示文字。至于前面那段涉及ARC命名,它是x86或RISC计算机中用于标识设备的动态方法。ARC命名的第一部分用于标识硬件适配卡/磁盘控制器,它有两个选项SCSI和Multi。Multi表示一个非SCSI硬盘或一个由SCSI BIOS访问的SCSI硬盘,而SCSI则表示一个SCSI BIOS禁止的SCSI硬盘,(x)是硬件适配卡序号;Disk(x)表示SCSI总线号,如果硬件适配卡为Multi,其正确表示方法就为disk(0),rdisk(x)则表示硬盘的序号,如果硬件适配卡为SCSI则忽略此值;partition(x)表示硬盘的分区序号。
开关符的含义:
/fastdetect:使系统不检查串行口和并行口。
/safeboot:安全启动,系统只启动HKLM\System\Current ControlSet。
/basevideo:使用标准VGA方式启动。这种方式主要用于显示驱动失效时。
/BurnMemory=:使NT在已知的内存上少使用指定的数量,如果/burnmemory=64,则有64M的内存不使用。
/Bootlog:将日志写入%System%\NTbtlog.txt。
/MaxMem:n:指定NT可以使用的最大内存数,如果一个内存片坏了,这个开关就会有些用。
/Numproc=n:只允许前n个系统处理器工作。
/OneCPU:在多处理器中只使用一个处理器。
/NoGUIBoot:不加载VGA程序,也就不会显示启动过程和失败时的蓝屏信息。
/SOS:在调入驱动程序名时显示它的名字,在因驱动问题而无法启动时使用比较好。
/Win95DOS:在装有3个系统DOS、Win9x和NT的系统上,让NTLDR直接调用DOS的启动文件bootsect.dos。
/Win95:在上述情况下,让NTLDR直接调用Win9x启动文件bootsect.w40。( ?)
※-------------------------------------------------------------------------------------------------- 个人觉得上面这部分开关的作用要大些。
/baudrate:指出用于调度的波特率,如果用户不设置,则使用默认的9600,而对于线缆Modem则使用19200。 =_=
/debug:在启动NT时调入调度器,它可以在任何时间激活,在错误时可以再次出现时使用它比较合适。
/CrashDebug:调度器在NT启动时启动,只有在内核错误时才有用,如果系统经常会无故出错,这个选项就很有用了。
/debugport=comx:指定用于调度的端口,x就是指端口号。
/Nodebug:不使用调度信息。
/HAL=<hal>:允许用户不使用默认的HAL。
/NoserialMice=:在特定的COM中禁止对串行鼠标的检测。如果用户有一个非鼠标设备接在COM口上,这个选项有些用。
/Year=:使用指定的年份。
/PCLlock:不让NT为多PCI设置分配IO/IRQ资源,而启用BIOS设置。
Last edited by Billunique on 2007-4-12 at 03:24 AM ]
☆ Explanation of the Boot.ini File (There are implications in the basic things):
The content of the Boot.ini file can be divided into two parts: and . The need not be discussed; let's take a look at the . For example, there is such a ----
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdist(0)partition(2)WINNT="Microsoft Windows 2000 Server" /fastdetect
The text within the English quotes is the prompt text displayed in the boot menu for selecting the operating system. As for the preceding part involving ARC naming, it is a dynamic method for identifying devices in x86 or RISC computers. The first part of the ARC naming is used to identify the hardware adapter card/disk controller, which has two options: SCSI and Multi. Multi indicates a non-SCSI hard disk or a SCSI hard disk accessed by the SCSI BIOS, while SCSI indicates a SCSI hard disk for which the SCSI BIOS is disabled. (x) is the hardware adapter card number; Disk(x) indicates the SCSI bus number. If the hardware adapter card is Multi, its correct representation method is disk(0); rdisk(x) indicates the hard disk number. If the hardware adapter card is SCSI, this value is ignored; partition(x) indicates the hard disk partition number.
Meaning of switches:
/fastdetect: Makes the system not check the serial port and parallel port.
/safeboot: Safe boot, the system only starts HKLM\System\Current ControlSet.
/basevideo: Starts in standard VGA mode. This mode is mainly used when the display driver fails.
/BurnMemory=: Makes NT use a specified amount less of known memory. If /burnmemory=64, 64M of memory is not used.
/Bootlog: Writes the log to %System%\NTbtlog.txt.
/MaxMem:n: Specifies the maximum amount of memory that NT can use. This switch is useful if a memory chip is bad.
/Numproc=n: Only allows the first n system processors to work.
/OneCPU: Uses only one processor in a multi-processor system.
/NoGUIBoot: Does not load the VGA program, so the boot process and the blue screen information on failure will not be displayed.
/SOS: Displays the name of the driver when loading the driver. It is better to use when the system cannot boot due to driver problems.
/Win95DOS: On a system with 3 systems: DOS, Win9x, and NT, let NTLDR directly call the DOS boot file bootsect.dos.
/Win95: In the above situation, let NTLDR directly call the Win9x boot file bootsect.w40. ( ?)
※-------------------------------------------------------------------------------------------------- Personally, I think the role of the above switches is more significant.
/baudrate: Indicates the baud rate used for scheduling. If the user does not set it, the default 9600 is used, and 19200 is used for the cable modem. =_=
/debug: Loads the scheduler when starting NT. It can be activated at any time, and it is more appropriate to use it when an error can occur again.
/CrashDebug: The scheduler starts when NT starts, which is only useful when there is a kernel error. This option is very useful if the system often has unexpected errors.
/debugport=comx: Specifies the port used for scheduling, where x is the port number.
/Nodebug: Does not use scheduling information.
/HAL=<hal>: Allows the user not to use the default HAL.
/NoserialMice=: Prohibits detecting the serial mouse on the specific COM. This option is useful if the user has a non-mouse device connected to the COM port.
/Year=: Uses the specified year.
/PCLlock: Prevents NT from allocating IO/IRQ resources for multiple PCI settings and enables BIOS settings.
Last edited by Billunique on 2007-4-12 at 03:24 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-11 08:35 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
☆ Msdos.sys文件解释:
WinDir=C:\Windows --系统所在目录
WinBootDir=C:\Windows --系统启动目录
HostWinBootDrv=C --系统所在分区
Win98的Msdos.sys文件中的块中的一些设置(各选项中默认值写在前面)。
Autoscan=1/0 --异常关机后下次启动是否运行Scandisk
BootDelay=2/? --开机时热键按下前的等待时间(秒)
BootGUI=1/0 --启动时是否进入Windows界面(否则为DOS界面)
BootKeys=1/0 --启动时热键是否有效
BootMenu=0/1 --启动时是否显示启动菜单(否则要按下热键才显示)
BootMenuDefault=1/? --显示启动菜单时的默认项(即光标所在项)
BootMulti=0/1 --是否支持与旧版DOS的多启动(有旧版DOS启动文件,且此盘必须为FAT16)
BootWarn=1/0 --在启动过程失败后,下次启动是否提示进入安全模式
BootWin=1/0 --启动时是否自动装入旧版DOS(?)
DblSpace=0/1 --启动时是否装入DblSpace.bin
DoubleBuffer=0/1 --是否启动双缓冲区支持
DrvSpace=0/1 --启动时是否装入DrvSpace.bin
LoadTop=1/0 --启动时是否将系统核心的一部分装入高端内存
Logo=1/0 --启动时是否显示“蓝天白云”
Winver=4.10.1998 --Windows版本
Last edited by Billunique on 2007-4-12 at 04:20 AM ]
☆ Explanation of the Msdos.sys file:
WinDir=C:\Windows --System directory
WinBootDir=C:\Windows --System startup directory
HostWinBootDrv=C --System partition
Some settings in the block of the Msdos.sys file in Win98 (the default value in each option is written first).
Autoscan=1/0 --Whether to run Scandisk next time after an abnormal shutdown
BootDelay=2/? --Waiting time (seconds) before the hotkey is pressed during startup
BootGUI=1/0 --Whether to enter the Windows interface during startup (otherwise, it is the DOS interface)
BootKeys=1/0 --Whether the hotkey is valid during startup
BootMenu=0/1 --Whether to display the startup menu during startup (otherwise, you need to press the hotkey to display it)
BootMenuDefault=1/? --Default item (that is, the item where the cursor is located) when the startup menu is displayed
BootMulti=0/1 --Whether to support multi-boot with the old version of DOS (there is an old version of DOS startup file, and this disk must be FAT16)
BootWarn=1/0 --Whether to prompt to enter safe mode next time after the startup process fails
BootWin=1/0 --Whether to automatically load the old version of DOS during startup (?)
DblSpace=0/1 --Whether to load DblSpace.bin during startup
DoubleBuffer=0/1 --Whether to start double buffer support
DrvSpace=0/1 --Whether to load DrvSpace.bin during startup
LoadTop=1/0 --Whether to load part of the system core into the upper memory during startup
Logo=1/0 --Whether to display the "blue sky and white clouds" during startup
Winver=4.10.1998 --Windows version
Last edited by Billunique on 2007-4-12 at 04:20 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-12 03:47 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
这本书大致就到这里了,明天就去还了去。
下一本是什么呢,现在还没有概念,感觉学得挺乱的,没有一个循序渐进的过程。
This book is roughly here. I'll return it tomorrow. :P
What's the next book? I don't have an idea now. It feels quite messy to study, and there's no process of gradual progress.
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-12 04:19 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
★《计算机系统结构精髓》(《Essentials of Computer Architecture》By Douglas E.Commer----清华大学出版社)乱弹
*●*遵循 冯·诺依曼体系结构的计算机,将程序和数据两者都存放在存储器中。这样的话,对每条指令,处理器至少必须进行一次存储器访问。如果一个或多个操作指定的数据项在存储器中,那么处理器就得多次访问存储器来读取或存放数值。系统结构设计师用冯·诺依曼瓶颈(Von Neumann bottleneck)这个术语来描绘这种状况。为了避免这种瓶颈,要利用一些技术,诸如把大多数操作数限制在寄存器里。
链接:
1.概括起来,冯·诺依曼结构有3条重要的设计思想:
(1)计算机应由运算器、控制器、存储器、输入设备和输出设备5大部分组成,每个部分有一定的功能。
(2)以二进制的形式表示数据和指令,二进制是计算机的基本语言。
(3)程序预先存入存储器中,使计算机在工作中能自动地从存储器中取出程序指令并加以执行。
2.指令(Instruction)就是可以为硬件所识别的操作。一个操作就是一条指令,操作的集合我们称为指令集或指令系统(Instruction Set)。每一次重新进入一个读取-执行周期意味着处理器又在执行一条指令。
→ *●*读取-执行周期
一个可编程的处理器是怎样来一步步读取和执行程序的呢?虽然具体细节各不相同,但是所有的可编程处理器都遵循同样的基本范式。这一基础机制称为读取-执行周期(fetch-exccute cycle)
实现读取-执行周期,处理器自动地历经一个程序,一步一步执行。就是说,每个可编程处理器重复地执行两个基本功能。即:
永远重复{
读取:从程序存放的地方读取程序的下一步。
执行:执行程序的这一步。
}
处理器在执行程序的最后一步后会发生什么?--处理器硬件不被设计成停止,它不停地继续运行读取-执行周期。当然,一个处理器不可以永久停止(就是你关了电源)--正常的操作中,处理器将一条指令接一条指令地连续执行。
在某些情况下,程序利用一个循环来进行延迟。例如,微控制器可能需要等待一个传感器的信号来判断是否满足某个外部条件,再继续执行。但是,处理器并非停下来等待这个传感器,而是在程序中包含一个循环,不断地对传感器进行测试。所以,从硬件的观点看,读取-执行周期继续着。
无穷尽的读取-执行观点,对程序设计造成一个直接的结果:软件必须设计得使处理器一直有下一步执行。对于诸如控制物理设备的微控制器这类专用系统,程序由一个无穷循环构成--当它完成程序的最后一步时,处理器再从第一步开始。对于通用计算机,总是有一个操作系统。操作系统能把一个应用程序装载到存储器,然后指挥处理器运行这个应用程序,为了保持读取-执行周期运转,当应用程序完成时,操作系统必须约定收回控制。在没有应用程序运行时,操作系统进入一个循环,等待输入(例如键盘或鼠标的输入)。
摘要如下:因为处理器无穷运行读取-执行周期,所以一个系统必须被设计成确保一直有下一步执行。 在专用系统中,同一程序反复执行;在通用系统中,在没有应用程序运行时,操作系统一直运行着。
→ *●*处理器一旦完成一条指令的执行,就自动转移到存储器中下一单元,再读取下一条指令。为了执行读取-执行周期,处理器使用一个称为程序计数器(program counter)的专用寄存器--有的系统设计师不称为程序计数器,而称指令指针(Instruction Pointer),两个术语完全一致。
当一个读取-执行周期开始时,程序计数器里有下一条要执行的指令的地址。一条指令读取后,程序计数器就立即更新为下一条指令的地址。每个读取-执行周期期间程序计数器的更新,意味着处理器自动地历经存储器里相继的指令。下面表明了读取-执行周期怎样历经相继指令。
赋给程序计数器一个程序的起始地址。
永远重复{
读取:从程序计数器给定的单元获取程序的下一步。
把内部地址寄存器A置值为刚读取的指令的后一个地址。
执行:执行此步程序。
把地址寄存器A的内容复制到程序计数器。
}
这个算法让我们明白转移指令怎样工作。 绝对转移(absolute branch)指明要执行的下一条指令的地址。通常绝对转移指令称为 跳转(jump)指令。jump指令在执行阶段把由操作数字段给予的地址加载到上述算法所说明的内部寄存器A。在读取-执行周期最后,硬件把这个数值复制到程序计数器,表明了将按这个地址来读取下一条指令。(相对转移暂搁不表)
Last edited by Billunique on 2007-6-6 at 11:11 AM ]
### ★ "Essentials of Computer Architecture" (By Douglas E. Commer - Tsinghua University Press) Random Talk
*●* Computers following the von Neumann architecture store both programs and data in memory. In this case, for each instruction, the processor must perform at least one memory access. If the data items specified by one or more operations are in memory, the processor has to access memory multiple times to read or store values. System architects use the term "Von Neumann bottleneck" to describe this situation. To avoid this bottleneck, techniques such as restricting most operands to registers are employed.
Link:
1. In summary, there are 3 important design ideas in the von Neumann structure:
(1) A computer should be composed of 5 major parts: arithmetic unit, controller, memory, input device, and output device, each with certain functions.
(2) Represent data and instructions in binary form, and binary is the basic language of the computer.
(3) Programs are pre-stored in memory, enabling the computer to automatically fetch program instructions from memory and execute them during operation.
2. An instruction is an operation recognizable by hardware. An operation is a single instruction, and the set of operations is called an instruction set or instruction system. Each time re-entering a fetch-execute cycle means the processor is executing another instruction.
→ *●*Fetch-Execute Cycle
How does a programmable processor read and execute a program step by step? Although specific details vary, all programmable processors follow the same basic paradigm. This basic mechanism is called the fetch-execute cycle.
To implement the fetch-execute cycle, the processor automatically goes through a program, executing step by step. That is, each programmable processor repeatedly performs two basic functions. That is:
Repeat forever {
Fetch: Fetch the next step of the program from where the program is stored.
Execute: Execute this step of the program.
}
What happens after the processor executes the last step of the program? - The processor hardware is not designed to stop; it keeps continuing the fetch-execute cycle. Of course, a processor cannot stop permanently (unless you turn off the power) - in normal operation, the processor continuously executes one instruction after another.
In some cases, the program uses a loop for delay. For example, a microcontroller may need to wait for a sensor signal to determine if an external condition is met before continuing execution. However, the processor does not stop to wait for this sensor but includes a loop in the program to continuously test the sensor. So, from the hardware perspective, the fetch-execute cycle continues.
The concept of the endless fetch-execute has a direct result on program design: software must be designed so that the processor always has the next step to execute. For dedicated systems such as microcontrollers controlling physical devices, the program consists of an infinite loop - when it finishes the last step of the program, the processor starts from the first step again. For general-purpose computers, there is always an operating system. The operating system can load an application program into memory and then direct the processor to run this application. To keep the fetch-execute cycle running, when the application is completed, the operating system must agree to take back control. When no application is running, the operating system enters a loop, waiting for input (such as keyboard or mouse input).
The summary is as follows: Because the processor runs the fetch-execute cycle infinitely, a system must be designed to ensure that there is always the next step to execute. In dedicated systems, the same program is repeatedly executed; in general-purpose systems, when no application is running, the operating system is always running.
→ *●* Once the processor finishes executing an instruction, it automatically moves to the next unit in memory and fetches the next instruction. To execute the fetch-execute cycle, the processor uses a special register called the program counter - some system architects do not call it the program counter but the instruction pointer, and the two terms are completely the same.
When a fetch-execute cycle starts, the program counter holds the address of the next instruction to be executed. After an instruction is fetched, the program counter is immediately updated to the address of the next instruction. The update of the program counter during each fetch-execute cycle means that the processor automatically goes through successive instructions in memory. The following shows how the fetch-execute cycle goes through successive instructions.
Assign the program counter an initial address of the program.
Repeat forever {
Fetch: Obtain the next step of the program from the unit given by the program counter.
Set the internal address register A to the address after the just-fetched instruction.
Execute: Execute this step of the program.
Copy the content of address register A to the program counter.
}
This algorithm makes us understand how a transfer instruction works. An absolute branch indicates the address of the next instruction to be executed. Usually, an absolute transfer instruction is called a jump instruction. The jump instruction loads the address given by the operand field into the internal register A described in the above algorithm during the execution phase. At the end of the fetch-execute cycle, the hardware copies this value to the program counter, indicating that the next instruction will be fetched at this address. (Relative transfer is put aside for now.)
Last edited by Billunique on 2007-6-6 at 11:11 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-14 06:38 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
 『第 26 楼』:
使用 LLM 解释/回答一下
*●*CPU复杂性的部分原因:
它必须充当几个 重要的角色==运行操作系统、运行应用程序、控制外部I/O设备、启动和停止计算机、管理存储器等。没有一种单一的指令集对于所有这些角色都是最理想的,因此,一个CPU常包含多个指令集。
保护和特权==现代计算机都含有一个保护系统,它可以赋予某些子系统有更高的特权。例如,可以防止一个应用程序直接与I/O设备交互;可以防止操作系统的代码被有意无意地篡改。
硬件优先权==CPU采用优先权方案,赋予某些计算任务比其他计算任务有更高的优先权。例如,I/O设备比应用程序有更高的运行优先权--如果CPU在运行一个程序时,有一个I/O设备需要服务,此刻CPU就会停止应用程序的运行,而去处理这个设备。
→ *●*CPU利用执行模式(mode of execution)。在有些CPU中,各模式的特性差别相当大,可以认为CPU是几个分开的、不同的硬件子系统,由模式来决定当前使用的是哪个硬件子系统。
以下是由CPU执行模式控制的一些典型特性。模式改变时,CPU的特性也明显改变:
~指令系统的一个有效子集 ~数据顶的大小
~可以访问的存储器范围 ~可用的功能部件 ~特权量
→ *●*特权和保护:
执行模式关系到CPU的那些用于特权和保护的机制。就是说,当前模式部分指定了CPU的特权级。例如,当CPU为一个I/O设备服务时,它允许操作系统中的设备驱动软件与设备交互作用,并执行控制功能。但是必须防止其他随便什么应用程序无意或恶意地向硬件发送命令,或执行控制功能。所以操作系统执行应用程序前,先要改变模式,降低特权。运行更小特权的模式时,CPU不准许直接控制I/O设备(即,CPU把一个特权操作视为一条无效指令)。
→ *●*多级保护:
到底需要多少级特权?每一级应当允许一些什么样的操作?这个课题,硬件系统设计师和操作系统设计师已经讨论了多年。创建了不提供保护的CPU,又创建了提供八级保护的CPU,一个比一个有更多的特权。保护的想法在于,在任何时刻利用必需的最小级别的特权,来帮助防范问题的发生。摘要如下:
利用保护方案来限制允许的操作,CPU能够检测那些企图执行未经授权的操作。
下图表示了两级特权的概念。

虽然没有一种能满足所有CPU的保护方案,不过设计者们一般对运行应用程序的CPU,认同一种最低限度的方案:
一个运行应用程序的CPU至少需要两级保护:操作系统一定以完全的特权运行,而应用程序以有限的特权运行。
Last edited by Billunique on 2007-6-6 at 11:11 AM ]
*●*Part of the Reason for CPU Complexity:
It has to act as several important roles == running the operating system, running applications, controlling external I/O devices, starting and stopping the computer, managing memory, etc. No single instruction set is ideal for all these roles, so a CPU often contains multiple instruction sets.
Protection and Privilege == Modern computers contain a protection system that can give certain subsystems higher privileges. For example, it can prevent an application from directly interacting with an I/O device; it can prevent the code of the operating system from being intentionally or unintentionally tampered with.
Hardware Priority == The CPU adopts a priority scheme, giving certain computing tasks higher priority than others. For example, an I/O device has a higher running priority than an application -- if the CPU is running a program and an I/O device needs service, the CPU will stop running the application and handle this device at this moment.
→ *●*The CPU uses the mode of execution. In some CPUs, the characteristics of each mode are quite different, and it can be considered that the CPU is several separate and different hardware subsystems, and the mode determines which hardware subsystem is currently in use.
The following are some typical characteristics controlled by the CPU execution mode. When the mode changes, the characteristics of the CPU also change significantly:
~An effective subset of the instruction set ~The size of the data stack
~The range of memory that can be accessed ~Available functional components ~Amount of privilege
→ *●*Privilege and Protection:
The execution mode is related to those mechanisms of the CPU used for privilege and protection. That is, the current mode partially specifies the privilege level of the CPU. For example, when the CPU is serving an I/O device, it allows the device driver software in the operating system to interact with the device and perform control functions. But other random applications must be prevented from unintentionally or maliciously sending commands to the hardware or performing control functions. So the operating system changes the mode and lowers the privilege before executing the application. When running in a mode with lower privilege, the CPU does not allow direct control of the I/O device (that is, the CPU treats a privileged operation as an invalid instruction).
→ *●*Multi-level Protection:
How many levels of privilege are needed? What kind of operations should each level allow? This topic has been discussed by hardware system designers and operating system designers for many years. CPUs that provide no protection have been created, and CPUs that provide eight levels of protection have been created, each with more privileges. The idea of protection is to use the minimum necessary level of privilege at any time to help prevent problems from occurring. The summary is as follows:
Using a protection scheme to limit allowed operations, the CPU can detect attempts to perform unauthorized operations.
The following figure shows the concept of two levels of privilege.

Although there is no protection scheme that can satisfy all CPUs, designers generally recognize a minimum scheme for the CPU running applications:
A CPU running an application needs at least two levels of protection: the operating system must run with full privilege, and the application runs with limited privilege.
Last edited by Billunique on 2007-6-6 at 11:11 AM ]
此帖被 +10 点积分 点击查看详情 评分人:【 lxmxn 】 | 分数: +10 | 时间:2007-4-19 09:54 |
|
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-14 08:22 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
我来学习一下,顺便顶一个。
I'm here to learn, and by the way, I'll give it a thumbs up.
|
|
2007-4-19 09:54 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
多谢lxmxn莅临指导  。这几天有点忙,同时也不知道记些啥好了。不过我会坚持的~将学习进行到底!
Thanks for lxmxn's presence and guidance :lol:. These days I'm a bit busy and don't know what to record. But I'll persevere~ Keep learning to the end!
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-20 03:54 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 29 楼』:
使用 LLM 解释/回答一下
★《微机原理与接口技术》(电子工业出版社)乱弹
☆十进制数转换为R进制数
(1)整数部分的转换。常用的方法有除R取余法和降幂法。
[例]用除R取余法将十进制的1223转换成等值的十六进制数。
具体做法是:除16取余,先得低位,逐次取得较高位,一直进行到商数为0时为止,然后按反序获得对应的十六进制数。

[例]用降幂法将十进制83转换成等值的二进制数。
具体做法是:(对于给定的一个十进制数M)
¥ 在R的N次幂中寻找N的最大值,使有(R的N次方)<=M,然后在R进制的对应位上置1,否则置0;
¥ M=M-(R的N次方)赋给,若M=0,则结束;否则重复第一步。
83-64=19 (64=2的6次方,0|1|0|0|0|0|0|0)
19-16=3 (16=2的4次方,0|1|0|1|0|0|0|0)
3-2=1 (2=2的1次方,0|1|0|1|0|0|1|0)
1-1=0 (1=2的0次方,0|1|0|1|0|0|1|1)
所以,(83)D=(01010011)B
(2)小数部分的转换
十进制小数转换成R进制小数的方法是:乘R取整,先得高位,依次获得低位。如果十进制小数不能用有限的R进制小数表示,则可根据需要取若干位作为近似值。对于既有整数部分又有小数部分的十进制数,转换时只需将整数部分和小数部分分别进行转换,然后用小数点连接起来即可。
[例]把十进制小数0.5625转换成等值的二进制数。
小数部分 整数部分
2×0.5625 1 (高位)
2×0.1250 0
2×0.2500 0
2×0.5000 1 (低位)
0.0000
所以,(0.5625)D=(0.1001)B
Last edited by Billunique on 2007-6-6 at 11:13 AM ]
★"Principles of Microcomputer and Interface Technology" (Publishing House of Electronics Industry) Random Talk
☆Conversion of Decimal Numbers to Base R Numbers
(1) Conversion of Integer Parts. Common methods include division by R to get remainders and descending power method.
Convert the decimal number 1223 to its equivalent hexadecimal number using division by R to get remainders.
Specific practice: Divide by 16 to get remainders, first get the lower digit, successively get higher digits, and continue until the quotient is 0, then obtain the corresponding hexadecimal number in reverse order.

Convert the decimal number 83 to its equivalent binary number using the descending power method.
Specific practice: (For a given decimal number M)
¥ Find the maximum value of N among R^N such that R^N <= M, then set 1 in the corresponding digit of base R, otherwise set 0;
¥ Assign M = M - R^N, if M = 0, end; otherwise repeat the first step.
83 - 64 = 19 (64 = 2^6, 0|1|0|0|0|0|0|0)
19 - 16 = 3 (16 = 2^4, 0|1|0|1|0|0|0|0)
3 - 2 = 1 (2 = 2^1, 0|1|0|1|0|0|1|0)
1 - 1 = 0 (1 = 2^0, 0|1|0|1|0|0|1|1)
So, (83)D = (01010011)B
(2) Conversion of Decimal Parts
The method to convert a decimal fraction to a base R fraction is: multiply by R to get integers, first get the higher digit, successively get lower digits. If a decimal fraction cannot be represented by a finite base R fraction, take several digits as an approximation as needed. For a decimal number with both integer and decimal parts, when converting, just convert the integer part and decimal part respectively, then connect them with a decimal point.
Convert the decimal fraction 0.5625 to its equivalent binary number.
Fractional part Integer part
2 × 0.5625 1 (Higher digit)
2 × 0.1250 0
2 × 0.2500 0
2 × 0.5000 1 (Lower digit)
0.0000
So, (0.5625)D = (0.1001)B
Last edited by Billunique on 2007-6-6 at 11:13 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-24 07:54 |
|
|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
☆汉字的编码
在计算机内部,任何信息都是用二进制代码表示的(包括字母、数字、符号和汉字)。一般情况下,计算机依靠输入设备把要输入的字符或汉字转换成为一定格式的二进制代码,然后才能接收。输出则是相反的过程,计算机首先把要输出的字符或汉字的二进制代码送到输出设备,然后再由输出设备处理输出。总之,无论是输入还是输出,都必须对文字符和汉字进行编码。
西文是拼音文字,用有限的几个字母(如英文26个,俄文32个)就可以拼写出全部西文信息。因此,西文仅需对有限个数的字母进行编码,就可以将全部西文信息全部输入计算机。而汉字信息则不一样,汉字是象形文字,一个汉字就是一个方块图形。计算机要对汉字信息进行处理,就必须对数目繁多的汉字进行编码,建立一个含成千上万个汉字的字符集。
所谓的国标码是《国家标准信息交换用汉字编码基本字符集》的简称。这是我国国家标准总局于1981年,为适应计算机对汉字信息交换的处理而颁布的国家标准,编号为GB2312-80。该标准按94×94的二维代码表形式,收集了6763个汉字和682个一般字符、序号、数字、拉丁字母、希腊字母、汉语拼音符号等,共7745个图形字符。该标准最多可包含8836个图形字符,适合于一般汉字处理、汉字通信等系统之间的信息交换。(2000年又颁布了GB18030-2000,扩充了字符集,加入了对少数民族文字的支持)
汉字编码有内码、外码之分。外码实际上就是汉字的输入编码,比如区位码、国标码、全拼码、双拼码、五笔字形码、郑码等等。内码是计算机系统内部进行汉字信息存储、交换、检索等操作的编码。汉字内码采用两个字节表示,没有重码。
区位码:用每个汉字在二维码表中的行、列位置的序数来表示的代码,共4位数字,简称为区位码,前二位为行号(也称区号),后二位为列号(也称位号)。如“啊”的区位码为1601,表示“啊”在二维代码表中位于16区01位。
国标码:国标码为区号和位号各加32后,得到的双七位二进制编码。如“啊”的国标码为4833,国标码用于不同汉字系统之间汉字的传输和交换,也可用做汉字的输入编码。
内码:汉字国标码是双七位二进制编码,要用它作机内码将会与英文字符的机内码ASCII码相混淆,为此特把两字节国标码的每个字节的最高位置“1”,以与ASCII码最高位为“0”区别开来。这样,便形成了汉字的机内码。简单说,机内码=国标码+8080H(即1000000010000000)
Last edited by Billunique on 2007-4-26 at 12:34 AM ]
### ☆Encoding of Chinese Characters
In the internal part of a computer, any information is represented by binary code (including letters, numbers, symbols, and Chinese characters). Generally, a computer relies on an input device to convert the characters or Chinese characters to be input into a certain format of binary code before it can be received. The output is the opposite process. The computer first sends the binary code of the characters or Chinese characters to be output to an output device, and then the output device processes the output. In short, whether it is input or output, encoding of text characters and Chinese characters must be carried out.
Western texts are alphabetic texts. With a limited number of letters (such as 26 in English, 32 in Russian), all Western text information can be spelled out. Therefore, only encoding of a limited number of letters is needed for Western texts to input all Western text information into the computer. However, it is different for Chinese character information. Chinese characters are pictographic characters, and each Chinese character is a square graphic. For a computer to process Chinese character information, it is necessary to encode the numerous Chinese characters and establish a character set containing thousands of Chinese characters.
The so-called national standard code is the abbreviation of "National Standard Information Interchange Chinese Character Coding Basic Character Set". This is a national standard promulgated by the State Bureau of Standards of China in 1981 to adapt to the processing of Chinese character information by computers, with the number GB2312-80. This standard collects 6,763 Chinese characters and 682 general characters, serial numbers, numbers, Latin letters, Greek letters, Pinyin symbols, etc., in the form of a 94×94 two-dimensional code table, totaling 7,745 graphic characters. This standard can contain up to 8,836 graphic characters, suitable for information exchange between general Chinese character processing, Chinese character communication and other systems. (In 2000, GB18030-2000 was promulgated, expanding the character set and adding support for minority scripts)
There are distinctions between internal code and external code in Chinese character encoding. The external code is actually the input encoding of Chinese characters, such as area code, national standard code, full Pinyin code, double Pinyin code, Wubi method code, Zheng code, etc. The internal code is the code for Chinese character information storage, exchange, retrieval, etc. in the computer system. The Chinese character internal code is represented by two bytes without duplicate codes.
Area Code: The code represented by the serial numbers of the row and column positions of each Chinese character in the two-dimensional code table, with a total of 4 digits, simply called the area code. The first two digits are the row number (also called the area number), and the last two digits are the column number (also called the position number). For example, the area code of "啊" is 1601, indicating that "啊" is located at position 01 in area 16 in the two-dimensional code table.
National Standard Code: The national standard code is the double seven-bit binary code obtained by adding 32 to each of the area number and the position number. For example, the national standard code of "啊" is 4833. The national standard code is used for the transmission and exchange of Chinese characters between different Chinese character systems and can also be used as the input encoding of Chinese characters.
Internal Code: The Chinese character national standard code is a double seven-bit binary code. If it is used as the machine internal code, it will be confused with the machine internal code ASCII code of English characters. Therefore, the highest bit of each byte of the two-byte national standard code is set to "1" to distinguish it from the highest bit of ASCII code being "0". In this way, the machine internal code of Chinese characters is formed. Simply put, machine internal code = national standard code + 8080H (that is, 1000000010000000)
Last edited by Billunique on 2007-4-26 at 12:34 AM ]
|

★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲ |
|
2007-4-25 08:36 |
|
|