📄 mbrbm.lis
字号:
1 ; $Id: mbrbm.S,v 1.2 2007/05/20 09:44:00 freakout42 Exp $ 2 3 ; mbrbm - Master Boot Record Boot Manager 4 ; 5 ; Copyright (C) 2007 Axel Reinhold 6 ; http://mbrbm.sourceforge.net/ 7 ; 8 ; This program is free software; you can redistribute it and/or modify 9 ; it under the terms of the GNU General Public License as published by 10 ; the Free Software Foundation; either version 2 of the License, or 11 ; (at your option) any later version. 12 ; 13 ; This program is distributed in the hope that it will be useful, 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 17 ; 18 ; You should have received a copy of the GNU General Public License 19 ; along with this program; if not, write to the Free Software 20 ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 ; 22 ; PC BIOS Boot Manager _within_ the Master Boot Record. 23 ; MBR Bootcode written in nasm (x86 assembler). 24 ; Displays partition list with type/size and let user choose booting partition. 25 ; Boots active partition at timeout. 26 ; Restrictions: no LBA support, no extended partitions support. 27 ; Compatible with DOS, Windows, Lilo, Grub, BSD, ... partition boot records. 28 ; 29 ; FULL BACKUP IS HIGHLY RECOMMENDED 30 ; USE ONLY IF YOU REALLY KNOW WHAT YOU'RE DOING HERE 31 ; YOU NEED A WORKING PARTITION BOOT SECTOR 32 ; 33 ; Compilation of the mbr: 34 ; nasm mbrbm.S -o mbrbm.bin 35 ; 36 ; Installation with Linux on first IDE Harddisk (cut/paste script into a sh-script): 37 %IFDEF INSTALLSH 38 #!/bin/sh 39 if [ -f /etc/hda.mbr ]; then 40 echo mbrbm installation failed 41 exit 1 42 fi 43 if [ ! -f mbrbm.bin ]; then 44 echo mbrbm installation failed 45 exit 1 46 fi 47 cp mbrbm.bin /etc 48 set -ex 49 cd /etc 50 rm -f hda.mbr 51 dd if=/dev/hda of=hda.mbr bs=1b count=1 52 if [ ! -f /etc/hda.mbr ]; then 53 echo mbrbm installation failed 54 exit 1 55 fi 56 dd if=mbrbm.bin of=hdambrbm.mbr bs=1 count=438 57 dd if=hda.mbr bs=1 skip=438 count=74 >>hdambrbm.mbr 58 MBRSIZE=`ls -l hdambrbm.mbr | awk '{print $5}'` 59 if [ ! "$MBRSIZE" -eq 512 ]; then 60 echo mbrbm installation failed 61 exit 1 62 fi 63 dd if=hdambrbm.mbr of=/dev/hda bs=1b count=1 64 # KEEP THE FILE /etc/hda.mbr AS BACKUP OF ORIGINAL MBR 65 exit 66 %ENDIF 67 ; 68 ; Deinstallation with Linux on first IDE Harddisk: 69 ; dd if=/etc/hda.mbr of=/dev/hda bs=1b count=1 70 ; 71 ; Installation with FreeDOS on first Harddisk (cut/paste script into a bat-script): 72 %IFDEF INSTALLBAT 73 @ECHO ON 74 IF EXIST C:\hda.mbr GOTO FAIL 75 IF NOT EXIST mbrbm.bin GOTO FAIL 76 COPY mbrbm.bin C:C: 77 CD DEL BOOT.MBR 78 FDISK /SMBR 1 79 IF NOT EXIST BOOT.MBR GOTO FAIL 80 COPY BOOT.MBR hda.mbr 81 IF NOT EXIST C:\hda.mbr GOTO FAIL 82 COPY mbrbm.bin BOOT.MBR 83 FDISK /AMBR 1 84 ECHO KEEP THE FILE C:\hda.mbr AS BACKUP OF ORIGINAL MBR 85 GOTO EXIT 86 :FAIL 87 ECHO mbrbm installation failed 88 :EXIT 89 %ENDIF 90 ; 91 ; Deinstallation with FreeDOS on first Harddisk: 92 ; C: 93 ; CD ; COPY hda.mbr BOOT.MBR 94 ; FDISK /AMBR 1 95 96 %IFDEF GPLICENSE 97 GNU GENERAL PUBLIC LICENSE 98 Version 2, June 1991 99 100 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 101 675 Mass Ave, Cambridge, MA 02139, USA 102 Everyone is permitted to copy and distribute verbatim copies 103 of this license document, but changing it is not allowed. 104 105 Preamble 106 107 The licenses for most software are designed to take away your 108 freedom to share and change it. By contrast, the GNU General Public 109 License is intended to guarantee your freedom to share and change free 110 software--to make sure the software is free for all its users. This 111 General Public License applies to most of the Free Software 112 Foundation's software and to any other program whose authors commit to 113 using it. (Some other Free Software Foundation software is covered by 114 the GNU Library General Public License instead.) You can apply it to 115 your programs, too. 116 117 When we speak of free software, we are referring to freedom, not 118 price. Our General Public Licenses are designed to make sure that you 119 have the freedom to distribute copies of free software (and charge for 120 this service if you wish), that you receive source code or can get it 121 if you want it, that you can change the software or use pieces of it 122 in new free programs; and that you know you can do these things. 123 124 To protect your rights, we need to make restrictions that forbid 125 anyone to deny you these rights or to ask you to surrender the rights. 126 These restrictions translate to certain responsibilities for you if you 127 distribute copies of the software, or if you modify it. 128 129 For example, if you distribute copies of such a program, whether 130 gratis or for a fee, you must give the recipients all the rights that 131 you have. You must make sure that they, too, receive or can get the 132 source code. And you must show them these terms so they know their 133 rights. 134 135 We protect your rights with two steps: (1) copyright the software, and 136 (2) offer you this license which gives you legal permission to copy, 137 distribute and/or modify the software. 138 139 Also, for each author's protection and ours, we want to make certain 140 that everyone understands that there is no warranty for this free 141 software. If the software is modified by someone else and passed on, we 142 want its recipients to know that what they have is not the original, so 143 that any problems introduced by others will not reflect on the original 144 authors' reputations. 145 146 Finally, any free program is threatened constantly by software 147 patents. We wish to avoid the danger that redistributors of a free 148 program will individually obtain patent licenses, in effect making the 149 program proprietary. To prevent this, we have made it clear that any 150 patent must be licensed for everyone's free use or not licensed at all. 151 152 The precise terms and conditions for copying, distribution and 153 modification follow. 154 155 GNU GENERAL PUBLIC LICENSE 156 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 157 158 0. This License applies to any program or other work which contains 159 a notice placed by the copyright holder saying it may be distributed 160 under the terms of this General Public License. The "Program", below, 161 refers to any such program or work, and a "work based on the Program" 162 means either the Program or any derivative work under copyright law: 163 that is to say, a work containing the Program or a portion of it, 164 either verbatim or with modifications and/or translated into another 165 language. (Hereinafter, translation is included without limitation in 166 the term "modification".) Each licensee is addressed as "you". 167 168 Activities other than copying, distribution and modification are not 169 covered by this License; they are outside its scope. The act of 170 running the Program is not restricted, and the output from the Program 171 is covered only if its contents constitute a work based on the 172 Program (independent of having been made by running the Program). 173 Whether that is true depends on what the Program does.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -