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

📄 mbrbm.lis

📁 PC BIOS Boot Manager _within_ the Master Boot Record (MBR) Displays list of partitions and let user
💻 LIS
📖 第 1 页 / 共 4 页
字号:
   347                                  programs whose distribution conditions are different, write to the author   348                                  to ask for permission.  For software which is copyrighted by the Free   349                                  Software Foundation, write to the Free Software Foundation; we sometimes   350                                  make exceptions for this.  Our decision will be guided by the two goals   351                                  of preserving the free status of all derivatives of our free software and   352                                  of promoting the sharing and reuse of software generally.   353                                     354                                  			    NO WARRANTY   355                                     356                                    11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY   357                                  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN   358                                  OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES   359                                  PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED   360                                  OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF   361                                  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS   362                                  TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE   363                                  PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,   364                                  REPAIR OR CORRECTION.   365                                     366                                    12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING   367                                  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR   368                                  REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,   369                                  INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING   370                                  OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED   371                                  TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY   372                                  YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER   373                                  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE   374                                  POSSIBILITY OF SUCH DAMAGES.   375                                     376                                  		     END OF TERMS AND CONDITIONS   377                                  %ENDIF   378                                     379                                  CR		EQU	0x0D   380                                  LF		EQU	0x0A   381                                     382                                  ; PC AT bios   383                                     384                                  ; video   385                                  VIDEO		EQU	0x10		; bios video interrupt   386                                  PUTC		EQU	0x0E		; put character   387                                  CNTRL		EQU	0x0007		; control word   388                                     389                                  ; disc   390                                  DISC		EQU	0x13		; bios disc interrupt   391                                  READ1		EQU	0x0201		; bios read, 1 sector   392                                  WRITE1		EQU	0x0301		; bios write, 1 sector   393                                  DRIVE0		EQU	0x80		; bios hard disc drive 0 number   394                                     395                                  ; keyboard   396                                  KEYB		EQU	0x16		; bios keyboard interrupt   397                                  KEYBST		EQU	0x01		; bios keyboard status   398                                  KEYBK		EQU	0x00		; bios keyboard key   399                                     400                                  ; time   401                                  RTIME		EQU	0x1A		; bios time interrupt   402                                  GETTIME 	EQU	0x00		; get time   403                                  READDT		EQU	0x04		; bios read date   404                                     405                                  ; RealTimeClock   406                                  RTCPORT		EQU	70		; rtc port   407                                  RTCPIO		EQU	0x71		; rtc ioadr   408                                  RTCREAD		EQU	0x80		; read request   409                                  RTCDAY		EQU	7		; day offset   410                                  RTCMONTH	EQU	8		; month offset   411                                  RTCYEAR		EQU	9		; year offset   412                                  RTCCENTURY	EQU	50		; century offset   413                                     414                                  ; MasterBootBlock   415                                  MAGIC		EQU	0xAA55		; hard disc boot block magic word   416                                  SDEV		EQU	0x80		; boot partition flag   417                                  MBOOTL		EQU	512		; boot block length   418                                  NPARTN		EQU	4		; max. number of partitions   419                                  PARTL		EQU	16		; partition table entry length   420                                  NPARTL		EQU	PARTL*NPARTN	; partition table length   421                                  BCODEL		EQU	MBOOTL-NPARTL-2	; max. length of boot code   422                                  PARTAB		EQU	BCODEL		; position of partition table   423                                  SIGNUM		EQU	MBOOTL-2	; position of signum magic word   424                                  P_BOOT		EQU	0		; boot flag   425                                  P_HEAD		EQU	1		; partition start head   426                                  P_SEC		EQU	2		; partition start sector   427                                  P_CYL		EQU	3		; partition start cylinder   428                                  P_SYS		EQU	4		; partition start cylinder   429                                  P_BASE		EQU	8		; partition start block   430                                  P_SIZE		EQU	12		; partition block length   431                                  INVPART 	EQU	'?'		; invalid partition   432                                  LOWPART 	EQU	0		; low partition   433                                  HIGPART 	EQU	7		; high partition   434                                     435                                  ; locations of mboot in memory   436                                  LOADLOC 	EQU	0x7C00		; boot block load location in memory   437                                  COPYLOC 	EQU	0x0600		; copy location of boot block   438                                  COPYLOCSHR4 	EQU	0x0060		; copy location of boot block shifted 4r   439                                     440                                  LOADADR 	EQU	LOADLOC-COPYLOC	; load location in segment   441                                     442                                  MBRBR0:   443                                  ; master boot block code   444                                  	ORG	0			; for .BIN file   445                                     446 00000000 FA                      	CLI				; clear interrupts   447                                     448                                  ; set data segment pointers to COPYLOC for org 0   449 00000001 B86000                  	MOV	AX, COPYLOCSHR4		; shift segment adress   450 00000004 8ED0                    	MOV	SS, AX			; set all segments   451 00000006 8ED8                    	MOV	DS, AX			; COPYLOC -> offset 0   452 00000008 8EC0                    	MOV	ES, AX			; LOADLOC -> offset LOADADR   453                                     454                                  ; set SP to use below load address   455 0000000A BC0076                  	MOV	SP, LOADADR		; enough stack below load area   456 0000000D FB                      	STI   457 0000000E FC                      	CLD   458                                      459                                  ; copy boot block to COPYLOC   460 0000000F BE0076                  	MOV	SI, LOADADR		; copy block to get load area free   461 00000012 31FF                    	XOR	DI, DI			; for operation system bootstrap   462 00000014 B90002                  	MOV	CX, MBOOTL   463 00000017 F3A4                    	REP	MOVSB   464                                     465                                  ; jump far to copied code   466 00000019 EA[1E06]0000            	JMP	0:COPYLOC+JMP_TO_COPY	; jump far over jmp   467                                  JMP_TO_COPY:   468                                     469                                  ; display logo and headline   470 0000001E BE[3B00]                	MOV	SI, LOGO		; logo   471 00000021 E88800                  	CALL	PUTS   472                                  ; analyse drives   473 00000024 E8B400                  	CALL	ANALYSE_TABLE		; analyse first hard disc   474 00000027 FE06[5900]              	INC	BYTE [DRIVE]		; next hard disc   475 0000002B E85000                  	CALL	READ_TABLE		; read partition table   476 0000002E 08E4                    	OR	AH, AH			; read ok?   477 00000030 7503                    	JNZ	ASK			; 2. disk installed   478 00000032 E8A600                  	CALL	ANALYSE_TABLE		; analyse second hard disc   479                                  ASK:   480 00000035 BE[7800]                	MOV	SI, PROMPT		; issue prompt   481 00000038 E9ED00                  	JMP	GET_PART		; jump over error message   482                                     483                                  ; data   484                                  WAITC	EQU	300			; wait counter for mboot   485                                  LOGO:   486 0000003B 6D6272626D320D0A        	DB	'mbrbm2',CR,LF		; logo string   487                                  HEAD:   488 00000043 447276205061727420-     	DB	'Drv Part SysId  1GB'	; partition table headline   489 0000004C 537973496420203147-   490 00000055 42                    491                                  CRLF:   492 00000056 0D0A00                  	DB	CR,LF,0			; carriage return, line feed   493                                  PARTITION:				; partition string   494                                  DRIVE:					; drive number ascii 0..1   495 00000059 30202020                	DB	'0   '   496                                  PART:   497 0000005D 30                      	DB	'0'			; partition number ascii 0..7   498                                  ACTIND:   499 0000005E 422020202020            	DB	'B     '		; active partition indicator   500                                  SYSID:   501 00000064 30202020202020          	DB	'0      '		; system identification number ascii   502                                  MEGBYTE:   503 0000006B 300D0A00                	DB	'0',CR,LF,0		; partition size in megbytes ascii   504                                  ACTIVE:   505 0000006F 3F                      	DB	INVPART			; init active partition to unvalid   506 00000070 0D0A00                  	DB	CR,LF,0   507                                  INVTABLE:   508 00000073 496E760D0A              	DB	'Inv',CR,LF		; error message invalid partition   509                                  PROMPT:   510 00000078 426F6F743F00            	DB	'Boot?',0		; load partition prompt string   511                                     512                                  ; read boot block   513                                  READ_TABLE:   514 0000007E B90100                  	MOV	CX, 00001		; cyl 0, sect 1   515 00000081 BA5000                  	MOV	DX, DRIVE0-'0'		; head 0   516 00000084 0216[5900]              	ADD	DL, [DRIVE]		; drive 0 or 1   517 00000088 E80C00                  	CALL	READ_DISC   518 0000008B BEBE77                  	MOV	SI, LOADADR+PARTAB	; copy partition table   519 0000008E BF[BE01]                	MOV	DI, PART_TAB		; to copy area for save

⌨️ 快捷键说明

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