⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 de.9

📁 Unix操作系统minix 2.0源码
💻 9
字号:
.CD "de \(en disk editor".SX "de\fR [\fB\(enw\fR] \fIblock_device".SX "de \(enr \fIfile.FL "\(enr" "Recover a file that has been removed".FL "\(enw" "Enable writing, so device can be modified".EX "de \(enr /usr/ast/prog.c" "Undo the effects of: \fIrm /usr/ast/prog.c\fR".EX "de \(enw /dev/fd0" "Edit \fI/dev/fd0\fR for writing".PPThe \fIde\fR program allows a system administrator to examine and modifya \s-2MINIX\s0 file system device. Commands are available to move to any address on the diskand display the disk block contents. This information maybe presented in one of three visual modes: as two-byte words,as ASCII characters or as a bit map. The disk may be searchedfor a string of characters. If the \fB\(enw\fR option is given,\fIde\fR will open the device for writing and words may bemodified.Without this flag, writing is prohibited.Lost blocks and files can be recovered using a variety ofcommands. The \fB\(enr\fR option supports automated recovery offiles removed by \fIunlink\fR..SS "Positioning".PPDisks are divided into blocks (also called \*(OQzones\*(CQ) of 1024bytes. \fIDe\fR keeps a current address on the disk as ablock number and a byte offset within the block. In somevisual modes the offset is rounded off, for example, in\*(OQword\*(CQ mode the offset must be even..PPThere are different types of blocks on a file system device,including a super block, bit maps, i-nodes and data blocks.\fIDe\fR knows the type of the current block, but will allowmost positioning commands and visual modes to functionanywhere on the disk..PPThe \fIf\fR command (or PGDN on the keypad) moves forward to thenext block, similarly \fIb\fR (PGUP) moves backwards one block.\fIF\fR (END) moves to the last block and \fIB\fR (HOME) moves to thefirst block..PPThe arrow keys (or \fIu\fR, \fId\fR, \fIl\fR, and \fIr\fR) change the currentaddress by small increments. The size of the incrementdepends on the current display mode, as shown below. Thevarious sizes suit each display and pointers move on thescreen to follow each press of an arrow key..HS.if t .ta .75iR 1.5iR 2.25iR 3.0iR 3.75iR.if n .ta .75i 1.5i 2.25i 3.0i 3.75i.nf\fB	Mode	Up	Down	Left	Right\fR	Word	\(mi2	+2	\(mi32	+32	Block	\(mi64	+64	\(mi1	+1	Map	\(mi256	+256	\(mi4	+4.fi.HSThe \fIg\fR command allows movement to any specified block.Like all commands that take arguments, a prompt andsubsequent input are written to the bottom line of thescreen. Numerical entry may be decimal, octal orhexadecimal, for example 234, \(mi1, 070, 0xf3, \(miX3C..PPWhile checking an i-node one may want to move to a blocklisted as a zone of the file. The \fIG\fR command takes thecontents at the current address in the device as a blocknumber and indirectly jumps to that block..PPThe address may be set to the start of any i-node usingthe \fI\fR command and supplying an i-node number. The \fII\fRcommand maps a given file name into an i-node address.The file must exist on the current device and thisdevice must be mounted..SS "The Display".PPThe first line of the display contains the device name,the name of the current output file (if one is open) andthe current search string. If \fIde\fR is being run withthe \fB\(enw\fR option then the device name is flagged with \*(OQ(w).\*(CQIf a string is too long to fit on the line it is marked with \*(OQ...\*(CQ..PPThe second line contains the current block number, thetotal number of blocks, and the type of the current block.The types are: boot, super, i-node bit map, zone bit map,i-nodes and data block.If the current address iswithin a data block then the string \*(OQin use\*(CQ is displayedif the block corresponds to a set in the zone bit map..PPThe third line shows the offset in the current block. Ifthe current address is within either the i-node or zone bitmaps then the i-node or block number corresponding to thecurrent bit is shown. If the current address is within ani-node then the i-node number and \*(OQin use\*(CQ status is displayed.If the address is within a bit map or i-node block, but pastthe last usable entry, then the string \*(OQpadding\*(CQ is shown..PPThe rest of the screen is used to display data from thecurrent block. There are three visual display modes:\*(OQword,\*(CQ \*(OQblock,\*(CQ and \*(OQmap.\*(CQ The \fIv\fR command followed by\fIw\fR, \fIb\fR, or \fIm\fR sets the current display mode..PPIn \*(OQword\*(CQ mode 16 words, of two bytes each, are shown ineither base 2, 8, 10 or 16. The current base is displayedto the far right of the screen. It can be changed using the\fIo\fR command followed by either an \fIh\fR (hexadecimal), \fId\fR(decimal), \fIo\fR (octal) or \fIb\fR (binary)..PP\fIDe\fR knows where i-nodes are, and will display thecontents in a readable format, including the \fIrwx\fR bits,the user name and the time field. If the current pageis at the beginning of the super block, or an executablefile or an \fIar\fR archive, then \fIde\fR will also informthe user. In all other cases the contents of the 16words are shown to the right as equivalent ASCIIcharacters..PPIn \*(OQblock\*(CQ mode a whole block of 1024 bytes is displayedas ASCII characters, 64 columns by 16 lines. Control codesare shown as highlighted characters. If the high order bitis set in any of the 1024 bytes then an \*(OQMSB\*(CQ flag is shownon the far right of the screen, but these bytes are notindividually marked..PPIn \*(OQmap\*(CQ mode 2048 bits (256 bytes) are displayed from thetop to the bottom (32 bits) and from the left to the rightof the screen. Bit zero of a byte is towards the top of thescreen. This visual mode is generally used to observethe bit map blocks. The number of set bits displayed iswritten on the far right of the screen..SS "Searching".PPA search for an ASCII string is initiated by the \fI/\fR command.Control characters not used for other purposes may beentered in the search string, for example CTRL-J is an end-of-line character. The search is from the current position tothe end of the current device..PPOnce a search string has been defined by a use of \fI/\fR, thenext search may be initiated with the \fIn\fR command, (a \fI/\fRfollowed immediately by an ENTER is equivalent to an \fIn\fR)..PPWhenever a search is in progress \fIde\fR will appendone \fI.\fR to the prompt line for every 500 blocks searched. If thestring is found between the end of the file system and theactual end of the device, then the current address is set tothe end of the file system..PPSome of the positioning commands push the current addressand visual mode in a stack before going to a new address.These commands are \fIB\fR, \fIF\fR, \fIg\fR, \fIG\fR, \fIi\fR, \fII\fR, \fIn\fR, \fIx\fR and \fI/\fR. The \fIp\fR(previous) command pops the last address and visual modefrom the stack. This stack is eight entries deep..SS "Modifying the File System".PPThe \fIs\fR command will prompt for a data word and store it atthe current address on the disk. This is used to changeinformation that can not be easily changed by any othermeans..PPThe data word is 16 bits wide, it may be entered in decimal,octal or hexadecimal. Remember that the \fB\(enw\fR option mustbe specified for the \fIs\fR command to operate. Be carefulwhen modifying a mounted file system..SS "Recovering Files".PPAny block on the disk may be written to an output file.This is used to recover blocks marked as free on thedisk. A write command will request a file name the firsttime it is used, on subsequent writes the data is appendedto the current output file..PPThe name of the current output file is changed using the\fIc\fR command. This file should be on a different file system,to avoid overwriting an i-node or block before it isrecovered..PPAn ASCII block is usually recovered using the \fIw\fR command.All bytes will have their most significant bit cleared beforebeing written to the output file. Bytes containing '\\0'or '\\177' are not copied. The \fIW\fR command writes the currentblock (1024 bytes exactly) to the output file..PPWhen a file is deleted using \fIunlink\fR the i-node numberin the directory is zeroed, but before its removal, it iscopied into the end of the file name field. This allowsthe i-node of a deleted file to be found by searchingthrough a directory. The \fIx\fR command asks for the pathname of a lost file, extracts the old i-node number andchanges the current disk address to the start of thei-node..PPOnce an i-node is found, all of the freed blocks may berecovered by checking the i-node zone fields, using 'G'to go to a block, writing it back out using 'w', goingback to the i-node with \fIp\fR and advancing to the nextblock. This file extraction process is automated by usingthe \fIX\fR command, which goes through the i-node, indirectand double indirect blocks finding all the block pointersand recovering all the blocks of the file..PPThe \fIX\fR command closes the current output file and asksfor the name of a new output file. All of the disk blocksmust be marked as free, if they are not the command stopsand the file must be recovered manually..PPWhen extracting lost blocks \fIde\fR will maintain \*(OQholes\*(CQ inthe file. Thus, a recovered sparse file does not allocateunused blocks and will keep its efficient storage scheme.This property of the \fIX\fR command may be used to move a sparsefile from one device to another..PPAutomatic recovery may be initiated by the \fB\(enr\fR option onthe command line. Also specified is the path name of afile just removed by \fIunlink\fR. \fIDe\fR determines whichmounted file system device held the file and opens it forreading. The lost i-node is found and the file extracted byautomatically performing an \fIx\fR and an \fIX\fR command..PPThe recovered file will be written to \fI/tmp\fR. \fIDe\fR willrefuse to automatically recover a file on the same filesystem as \fI/tmp\fR. The lost file must have belonged to theuser. If automatic recovery will not complete, then manualrecovery may be performed..SS "Miscellaneous".PPThe user can terminate a session with \fIde\fR by typing\fIq\fR, CTRL-D, or the key associated with SIGQUIT..PPThe \fIm\fR command invokes the \s-2MINIX\s0 \fIsh\fR shell as a subprocess..PPFor help while using \fIde\fR use \fIh\fR..SS "Command Summary".LP.ta 0.25i 1.0i 1.5i.nf.sp	PGUP	b	Back one block	PGDN	f	Forward one block	HOME	B	Goto first block	END	F	Goto last block	UP	u	Move back 2/64/256 bytes	DOWN	d	Move forward 2/64/256 bytes	LEFT	l	Move back 32/1/4 bytes	RIGHT	r	Move forward 32/1/4 bytes		g	Goto specified block		G	Goto block indirectly		i	Goto specified i-node		I	Filename to i-node		/	Search		n	Next occurrence		p	Previous address		h	Help	EOF	q	Quit		m	\s-2MINIX\s0 shell		v	Visual mode (w b m)		o	Output base (h d o b)		c	Change file name		w	Write ASCII block		W	Write block exactly		x	Extract lost directory entry		X	Extract lost file blocks		s	Store word.fi.spNOTES:When entering a line in response to a prompt from \fIde\fRthere are a couple of editing characters available. Theprevious character may be erased by typing CTRL-H and thewhole line may be erased by typing CTRL-U. ENTER terminatesthe input. If DELETE or a non-ASCII character is typedthen the command requesting the input is aborted..PPThe commands \fIG\fR, \fIs\fR and \fIX\fR will only function ifthe current visual display mode is \*(OQword.\*(CQ The commands\fIi\fR, \fII\fR and \fIx\fR change the mode to \*(OQword\*(CQ oncompletion. The commands \fIG\fR and \fI/\fR change the modeto \*(OQblock\*(CQ. These restrictions and automatic modeconversions are intended to aid the user..PPThe \*(OQmap\*(CQ mode uses special graphic characters, andonly functions if the user is at the console..PP\fIDe\fR generates warnings for illegal user input or iferroneous data is found on the disk, for example acorrupted magic number. Warnings appear in the middleof the screen for two seconds, then the current pageis redrawn. Some minor errors, for example, settingan unknown visual mode, simply ring the bell. Majorerrors, for example I/O problems on the file systemdevice cause an immediate exit from \fIde\fR..PPThe i-node and zone bit maps are read from the devicewhen \fIde\fR starts up. These determine whether \*(OQin use\*(CQor \*(OQnot in use\*(CQ is displayed in the status field atthe top of the screen. The bit maps are not re-readwhile using \fIde\fR and will become out-of-date ifobserving a mounted file system..PP\fIDe\fR requires termcap definitions for \*(OQcm\*(CQ and \*(OQcl\*(CQ.Furthermore, \*(OQso\*(CQ and \*(OQse\*(CQ will also be used if available. The ANSI strings generated by the keypad arrows are recognized,as well as any single character codes defined by \*(OQku\*(CQ,\*(OQkd\*(CQ, \*(OQkl\*(CQ and \*(OQkr\*(CQ..SS "Author".PPThe \fIde\fR program was written by Terrence Holm.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -