summaryrefslogtreecommitdiffstats
path: root/client/shared/lib
diff options
context:
space:
mode:
authoradv <adv@uma.es>2011-12-13 11:02:55 +0000
committeradv <adv@uma.es>2011-12-13 11:02:55 +0000
commitd89a58fc262f552483f65d7a62b8aa6090dbd093 (patch)
tree6ed6352dd2282f28efd1b063c0e150e74ee336c6 /client/shared/lib
parentec051d0b73dfa79e3181ab72a8d1acf0e0c0e4aa (diff)
1.0.2 #461 grub4dos version 0.4.5b - nsolo se incluye ficheros, no se activa, pero soluciona error con hp pro slimline -
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2393 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/lib')
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/COPYING340
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_GRUB4DOS.txt704
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_chenall.txt645
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS.txt4138
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS_CN.txt4314
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/badgrub.exebin0 -> 289455 bytes
-rwxr-xr-xclient/shared/lib/grub4dos/grub4dos-0.4.5b/bootlace.combin0 -> 37092 bytes
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/config.sys6
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/default46
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/grldrbin0 -> 273039 bytes
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr.mbrbin0 -> 9216 bytes
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.exebin0 -> 292015 bytes
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.pifbin0 -> 967 bytes
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/hmload.combin0 -> 1856 bytes
-rw-r--r--client/shared/lib/grub4dos/grub4dos-0.4.5b/menu.lst132
15 files changed, 10325 insertions, 0 deletions
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/COPYING b/client/shared/lib/grub4dos/grub4dos-0.4.5b/COPYING
new file mode 100644
index 00000000..eeb586b3
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_GRUB4DOS.txt b/client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_GRUB4DOS.txt
new file mode 100644
index 00000000..9d54b92d
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_GRUB4DOS.txt
@@ -0,0 +1,704 @@
+2011-12-05 Issue 53: add new command 'iftitle' for menu.(thanks @Steve6375).
+2011-11-17 (tinybit)supported utf8 and unicode char printing.
+2011-11-04 (tinybit)added new argument of max_width for putchar; various fixes.
+2011-10-29 (tinybit)add new command 'font' for vesa fonts.(Not yet complete).
+2011-10-22 (tinybit)bug fix on failed loading multi-boot kernel(issue 44).
+2011-10-20 (tinybit)increased SYSTEM_RESERVED_MEMORY upto 0x2000000(i.e., 32M).
+2011-10-19 (tinybit)merged console/graphics setcolor functions.
+2011-10-18 (tinybit)rearranged memory usage and preparing for vbe support. merged console/graphics setcolor functions.
+2011-10-03 (tinybit)changed buf_addr from 0x20000 to 0x100000 to avoid possible conflict between dd_func and get_diskinfo.
+2011-10-01 (tinybit)resolved conflicts between gfxmenu and configfile.
+2011-09-28 (chenall)fixed partition enumeration problem(important!)(disk_io.c).
+2011-09-16 (tinybit)disabled ELCR code for ASUS eee PC 1215B.
+2011-09-06 (tinybit)fixed pxe_detect to handle long bootfile name.
+2011-08-05 (tinybit)added a map option --e820cycles for Dell Laptop N4030.
+2011-07-27 (tinybit)fixed a careless mistake in clean_entry().
+2011-07-21 (tinybit)added a map option --int15nolow. Some changes on handler.
+2011-07-10 (tinybit)re-enabled int13/ah=16h floppy detection in int13_handler.
+2011-07-27 (tinybit)fixed a careless mistake in clean_entry().
+2011-07-21 (tinybit)added a map option --int15nolow. Some changes on handler.
+2011-07-10 (tinybit)re-enabled int13/ah=16h floppy detection in int13_handler.
+2011-06-28 (tinybit)fixed a careless mistake in probe_mbr(missing evaluation on C/H/S). fixed a bug in clean_entry() which return the address of a local variable.
+2011-06-27 (tinybit)added wee_skip_to as a replacement for skip_to.
+2011-06-22 (tinybit)better probe_mbr handling abnormal partition tables.
+2011-06-19 (karyonix)int15 fix. (tinybit)remove code to save handler room.
+2011-06-10 (tinybit)trust CHS in floppy BPB for GRUB.EXE to run under DOS.
+2011-06-09 (tinybit)trust CHS in floppy BPB for GRUB.EXE to boot via NTLDR.
+2011-06-04 (namiltd)added exFAT filesystem accessibility.
+2011-06-02 (tinybit)better handling loading grub.exe from NTLDR in floppy
+2011-05-31 (tinybit)fix chainloading grub.exe from Grub4DOS
+2011-05-31 (tinybit)make grub.exe loadable by NTLDR
+2011-05-24 (tinybit)make grub.exe chainloadable
+2011-05-19 applied Roy's patch(Issue 27: adding PC-DOS/MS-DOS chainloading support).
+2011-05-14 (tinybit)use HLT command in key detection
+2011-05-09 applied steve6375's patch( Issue 23: Improve grub4dos menu item numbering).
+2011-05-07 applied Roy's patch(Issue 25: Add chainloading DELL DRMK DELLBIO.BIN support).
+2011-05-06 applied Roy's patch(issue 24: Add ReactOS freeldr chainloading support).
+2011-04-29 (tinybit)exclude ntfs short filename.allow space in fb_filename.
+2011-03-22 fixed a bug on case sensitivity in filename completion. added a new parameter "case_insensitive" to print_a_completion().
+2011-03-19 fixed a bug on NTFS unicode filename handling. let unicode_to_utf8() return string length after convertion.
+2011-03-05 fixed a bug on "cdrom --add-io-ports=...".
+2011-03-04 setup a byte at offset 0x1F0 of GRUB.EXE to indicate number of
+ sectors used by the DOSSTART.S; change boot_drive to -1 so that
+ external programs can set it up before transfer control to grub4dos;
+ when grub.exe is loaded as a kernel, the default boot device of
+ grub.exe will be set to the current root device of current grub4dos.
+2011-02-20 prevent IO.SYS from wiping out int32-3F.
+2011-02-17 fixed a bug of "0xEA not properly restored" in realmode_run(asm.S).
+2011-02-16 fixed a bug on stack checking in realmode_run(asm.S).
+2011-02-16 changed real_to_prot(asm.S) and related calls according to WEE.
+2011-01-22 fixed "map (hd1) (0xFF)" issue of failed cdrom emulation.
+2011-01-18 set "APM BIOS call" as default halt method(see http://reboot.pro/13632/).
+2011-01-16 clear preset_menu before enter_cmdline. uncomment the required "default entry number" resolving code(stage2.c).
+2011-01-15 trying to fix ELF executable loading problem(issue 14). (confirmed by the reporter).
+2011-01-07 applied karyonix's patch (issue 9: fix geometry_tune function)
+2011-01-07 applied Roy's patch(supported packed DR-DOS).
+2010-12-29 applied Roy's patch(fixed build issue).
+2010-12-25 applied Roy's patch(issue 13: fix autoconf and gcc issues in Linux).
+2010-12-11 (r73)applied karyonix's patch(issue 11: Wrong data read USB)
+2010-11-30 (r69)applied karyonix's patch(support lzma decompression).
+2010-12-07 (r68)applied karyonix's patch(issue 9).
+2010-11-15 improved ACPI halt code(patched by zw2312914,Thanks for MR.rockrock99 and MR.xianglang reports their different and special hardware response mechanism ).
+2010-11-04 finally fixed the ACPI halt failure on AMI netbook(by commenting out ACPI-enable code).
+2010-11-03 partially go back to ACPI halt code of 2010-10-29.
+2010-11-02 deleted a duplicate code snip which could cause halt failure.
+2010-10-31 fixed the find issue. changed ACPI halt code(based on zw2312914).
+2010-10-29 improved ACPI halt code(patched by zw2312914).
+2010-10-22 fixed AMI netbook gray-screen-of-death problem on halt.
+2010-10-19 allow BSD primary partitions to be made active.
+2010-10-12 fixed grub.exe issues when booting off Linux/kexec. Only comments added compared to 2010-10-11.
+2010-10-11 try to fix grub.exe issues when booting off Linux/kexec(enabled system timer 0 init).
+2010-10-09 try to fix grub.exe issues when booting off Linux/kexec(enabled writing ELCR port 4D0/4D1).
+2010-10-08 try to fix grub.exe issues when booting off Linux/kexec(enabled coprocessor init by writing port F0/F1).
+2010-10-07 try to fix grub.exe issues when booting off Linux/kexec(disabled writing ELCR port 4D0/4D1).
+2010-10-04 improved halt with ACPI. try to fix grub.exe issues when booting off Linux/kexec(by sending 100 EOIs to PICs).
+2010-09-22 let chainloader recognize isolinux.bin 4.02.
+2010-09-19 added support for 800x600 graphics mode(SVGA mode 6A).
+2010-08-09 improved CHS probing code of map command on ISO9660 images.
+2010-08-04 finally find out the missing-extended-partition problem is caused by a gcc bug, and workarounds are created.
+2010-07-25 re-enabled the extended partition with logical partitions in disorder.
+2010-07-24 patch by chenall: cat --length=0 will return the size of the compressed file if it is gzipped; fix memory-not-enough problem when mapping a gzipped memory-file with a high compression ratio.
+2010-07-23 improved next_pc_slice() to cope with the partition-loop problem.
+2010-07-22 try to solve the problem of missing Linux extended partitions in Tab-completion.
+2010-07-21 improved next_pc_slice() to cope with the partition-loop problem.
+2010-07-20 changed code about pxe_basemem to solve the problem that pxe_unload fail to release memory.
+2010-07-12 fixed a bug in guess_dos_versions(for DOS executable grub.exe).
+2010-06-21 applied bean's patch(supported new (ud) device created with fbinst1.6).
+2010-06-09 applied karyonix's patch(fixes on grub_read and blocklist).
+2010-06-07 adjusted probe_int(dosstart.S) to deal with HP DV3-2309TX on its garbage int76 vector.
+2010-06-03 adjusted restore_BDA_EBDA(dosstart.S) to deal with HP on its garbage EBDA size byte.
+2010-05-31 unhook int13 before hooking it in load_initrd() to avoid duplicate hooking.
+2010-05-29 resolved conflict between drives_addr and mmap_addr for multiboot kernels.
+2010-05-27 adjusted probe_int(dosstart.S) to deal with DELL on its garbage int05 vector.
+2010-05-23 change /main.lst back to /menu.lst, and the original /menu.lst dir to /menu for pxe booting.
+2010-05-21 changed initial config filename from /menu.lst to /main.lst for pxe booting.
+2010-05-19 fixed problem of mapping small file(<512B) to (rd).
+2010-05-15 added --keep-pxe option for grub.exe running under DOS.
+2010-05-14 (chenall)fixed ntfs small file(<4KB) access problem.
+2010-05-13 added --off option for hiddenmenu. added nokeep subcommand for pxe. let halt return on failure.
+2010-05-03 hopefully non-linux kernels could get loaded now. version number changed to 0.4.5b.
+2010-03-14 fixed problems in set_bootdev and others.
+2010-03-13 fixed a (possible)bug in init_pic(affect grub.exe as a linux kernel format). applied Icecube's patch(curr_part_start).
+2010-01-22 applied karyonix's patch(PAE).
+2010-01-07 fixed problem of "command-line length limited to 15" on external executables.
+2010-01-03 applied karyonix's patch(PAE paging).
+2010-01-02 applied karyonix's patch(map improvements).
+2009-12-30 fixed the failed find. note that the kernel command could hang while loading non-linux kernels, which is a known bug on newish 0.4.5 versions.
+2009-12-28 initial implementation of program execution. fixed a bug causing FAT16 search hang(grldrstart.S). version number changed to 0.4.5a.
+2009-12-12 moved up 32-bit grub kernel code at above physical addess 3M. moved down buffer for dd and geometry-tune at 0x20000. moved down raw disk buffer at 0x30000. version number changed to 0.4.5.
+2009-12-02 (chenall)fixed a bug in color_func(builtins.c).
+2009-12-01 (chenall)fixed a bug which caused dd/write to write onto the wrong sector of the disk(fsys_ntfs.c).
+2009-11-29 (chenall)fixed a bug when using (md) to access memory at 2G and above(bios.c). improved memmove64 to support overlap(asm.S).
+
+2009-11-25 Caution! Reports say build 2009-11-08 and later will write wrong data onto disk when using dd and/or write commands.
+
+2009-11-13 (chenall)added --replace option for cat. This will write to file. Caution!
+2009-11-11 let PXE_BUF use BUFFERADDR. cancelled (hd+) support. added (hd) and (hd-N) support.
+2009-11-09 moved FSYS_BUF and some other buffers up at 0x3E0000. (chenall)added (hd+) support for map.
+2009-11-08 map memdrive images at memory address above 4GB(only for 64-bit CPU). deleted SETUP, INSTALL and EMBED commands.
+
+2009-10-16 Turned off int13/AX=4B01/DL=7F cdrom query which may hang on some machines. Commented out DMA code related to running via KEXEC. Implemented 64-bit int13 memdrive block moving code.
+2009-06-20(r68) add (ud) device to access space created with fbinst.
+2009-06-11 fixed a bug of missing assignment of ES and BX registers in int13_handler(asm.S).
+2009-05-13 fixed size-wrap-to-0 infinite loop issue in grub_read()(disk_io.c).
+2009-05-07(r67) resolved conflict between int10 stack and BIOS Data Area(grldrstart.S).
+2009-05-03 fixed a bug in geometry_tune(grldrstart.S, asm.S). zw2312914 report.
+2009-04-30 triple mbr without bpb also bootable as a floppy(grldrstart.S).
+2009-04-26 added ending CHS calculation for partition entry in mbr of the triple mbr(bootlace.inc).
+2009-04-25 bug fix in dd about device length calculation(builtins.c).
+2009-04-24 save and restore GDTR in int13_handler(asm.S).
+2009-04-06 accept partitions starting in the mbr track(probe_mbr, builtins.c).
+2009-04-05 triple mbr floppy partition (fdX,Y) support for some USB BIOSes(disk_io.c).
+2009-04-04 fixed partition table entries in the 2nd and 3rd mbr of the triple mbr(bootlace.inc).
+2009-03-31(r66) 0.4.4 official release.
+2009-03-28 removed the problematic global variable "i"; reduced one open-file step for configfile on cdrom.
+2009-03-27 fixed memory overlap issue on "map --rehook".
+2009-03-25 disabled the search for DEFAULT file on cdrom(in cmain, stage2.c).
+2009-03-24 fixed problem of WRITE/DD on modifying internal variables. added dd options for user-defined buffer.
+2009-03-21 bug fix: turned errorcheck on in run_script and enter_cmdline.
+2009-03-20(r65) fixed `configfile not working in menu init command group'.
+2009-03-19 trying to fix problem of `configfile running slowly'.
+2009-03-18 fixed problem of `geometry-tune too slow' on vmware.
+2009-03-17 fixed endless loop problem while running "configfile (md)4+8".
+2009-03-15 added new option --sync for geometry command.
+2009-03-14 added new option --tune for geometry command.
+2009-03-12 rearranged preset-menu items.
+2009-03-11 changed geometry-tune code(aim to solve problem on vmware).
+2009-03-07 fixed a bug(in grldrstart.S) brought in since 2009-02-05.
+2009-03-03 fixed memory overflow issue with (rd). canceled restrictions on some disk write commands.
+2009-02-26 fixed geometry-tune issue(reportedly with Virtual PC).
+2009-02-21 changes made according to Simon's hiddenmenu patches.
+2009-02-20 documented the command line needed for chainloading stage2 of grub legacy.
+2009-02-19 now a range of drives can be unmapped.
+2009-02-18 possibility to run another menu.lst after gfxmenu.
+2009-02-17 fix graphics display issue generated last time.
+2009-02-15 improved color command to set color for help text and heading line.
+2009-02-13 fix problems booting Linux when there are mappings.
+2009-02-11 added ext4 support(in fsys_ext2fs.c).
+2009-02-09 isolinux.bin(version 3.73) gets chainloaded again.
+2009-02-08 Move some variables to a known address. The read command returns value at addess.
+2009-02-03 New initrd syntax loading multiple cpio files for Linux 2.6 kernels.
+2009-01-30 Supported per-menu-item help text.
+2009-01-28 Fixed printf issue. Allowed non-block files to be written with dd and write.
+2009-01-24 New syntax of WRITE support writing string to file.
+2009-01-16(r64) Added gfxmenu support
+2009-01-09 New commands dd and uuid. fixed a bug in disk emulation.
+2008-12-30 Work around for BIOSes lacking INT15/E820 support.
+2008-12-29(r63) Now the preset menu holds the highest priority. MSYS/MinGW support.
+2008-12-24 Added "detect" sub-command for the "pxe" command.
+2008-12-21 Fixed several bootlace bugs when running under DOS.
+2008-12-20 bootlace is now able to create triple MBR.
+2008-12-19 fixed problem of Disk Read Error on the last track.
+2008-12-16 under DOS bootlace can use a parameter file for its command-line arguments.
+2008-12-12 added a new option --chs-no-tune for bootlace.com.
+2008-12-07 workaround for buggy no-emulation-mode cdrom BIOSes.
+2008-12-04 fixed ext3 inode size issue on bootlace. fixed partition table check issue on bootlace.
+2008-12-03 cut off the MENU_BUF. removed the TESTLOAD command. added TITLES array.
+2008-12-01 added new program badgrub.exe. changed syntax of the find command.
+2008-11-19(r62) enable interrupt when DELAY. avoid disabling CPU cache in a20_test(a20.inc).
+2008-11-18p added STIs to better respond hardware interrupt(a20.inc, asm.S).
+2008-11-18 changed DELAY code(a20.inc). added JMPs in unreal mode for RAM disk emulation(asm.S).
+2008-11-15 loosened the check of the first FAT entry(fsys_fat.c). avoid using OUT instruction in DELAY(a20.inc).
+2008-11-11(r61) added --ignore-cd option for the find command.
+2008-11-08 read the boot file to determin the pxe block size. avoid running pxe_detect for non-pxe booting.
+2008-11-02 added a new option --mbr-no-bpb for bootlace.com.
+2008-11-01 changed PXE_MIN_BLKSIZE and PXE_MAX_BLKSIZE. allowed FAT cluster size larger than 32K.
+2008-10-26 fixed pxe block size issue.
+2008-10-21 fixed cylinder issue in int13/ah=8. Fixed stack conflict in bootlace.
+2008-10-17 added command line options --serial-number=SN and --restore-mbr to bootlace.
+2008-10-12 fixed a bug in fsys_fat.c causing FAT32 mount failure.
+2008-10-03 cancelled unnecessary initialisations for the root device.
+2008-10-02 improved int15 probing in probe_int.
+2008-10-01 before booting GRLDR, give the user a chance to boot previous mbr.
+2008-09-30 fixed a big bug in set_bootdev causing extra rawread executed and the geometry messed up.
+2008-09-29 fixed a big bug in get_diskinfo causing duplicate geometry calculation for each IO request on floppy.
+2008-09-27 fixed a new bug intrduced recently in get_diskinfo.
+2008-09-25 fixed an issue of uninitialised current_term in boot.c, causing the failure of the kernel command in graphics mode.
+2008-09-24 fixed the issue of "$BITMAP should be non-resident when in attribute list" in fsys_ntfs.c.
+2008-09-23 fixed virtual cdrom sector read issue(64K at a time) for a non-mem mapping.
+2008-09-21 added a new command "tpm --init".
+2008-09-21 fixed memory conflicts between graphics mode and linux kernel.
+2008-09-20 fixed a serious problem in grldrstart causing boot failure on FAT.
+2008-09-19 fixed a new bug intrduced last in get_diskinfo.
+2008-09-15 fixed a problem when different action occurs on a drive between chs and lba.
+2008-09-13 fixed a problem of reentering int13 handler from a virtual device on a real cdrom device driven by the builtin cdrom driver.
+2008-09-12 fixed an issue of whole cdrom mapping.
+2008-09-09 fixed virtual cdrom sector read issue when it is not a mem-mapping.
+2008-09-07 title delimitors(or comments) can be used in menu now.
+2008-08-27 save stack space occupation by the int13_handler.
+2008-08-26 fixed a bug relevant to iso emulation, causing disk read error.
+2008-08-24 save stack space occupation by the int13_handler.
+2008-08-14 enlarged stage2 stack space.
+2008-08-13 fixed again the bug on the root command.
+2008-08-12 fixed int5 in probe_int.
+2008-08-10 added a new command checkrange; fixed a bug on the root command.
+2008-08-08 added builtin stack for int13_handler to avoid stack overflow.
+2008-08-06 fixed a suspicious problem on the SCRATCH buffer in get_diskinfo.
+2008-08-04 fixed again error handling problem about operator && and ||; added STIs to better respond hardware interrupt.
+2008-08-03 fixed error handling problem about operator && and ||; grldr.mbr structure change; other small alterations.
+2008-07-28 added STIs to better respond hardware interrupt or to feed watchdog.
+2008-07-10(r60) let KEY_UP(KEY_DOWN) loop to the last(first) menu entry.
+2008-07-06 added backup_int13 and restore_int13 for a buggy usb bios f24a ver 1.00parttbl on compaq v5235tu(reporter: uleak). turn a20 debug on for memdrives.
+2008-06-28 fixed ext3-inode-size issue in grldr boot sector and bootlace.inc.
+2008-06-26 fixed int4C-4F in probe_int for Lenovo A6900.
+2008-06-24 fixed "256-byte ext3 inode size" issue in fsys_ext2fs.c.
+2008-06-23 added command ls.
+2008-06-22 disabled safe_int13 code for a buggy usb bios f24a ver 1.00parttbl on compaq v5235tu(reporter: uleak).
+2008-06-21 add A20 debug code to help locate a20 failure.
+2008-06-18 A20 test begins. Update version number to 0.4.4.
+2008-06-12 Let HIDE and UNHIDE respond with a message.
+2008-06-10 Let ROOT show correct filesystem info.
+2008-06-07 Let MAKEACTIVE and GEOMETRY show active partitions.
+2008-06-01 commented out the terminal-switching code in run_menu.
+2008-05-31 changed asm.S to avoid clearing out bss for the configfile command.
+2008-05-27 initialize saved_videomode/font8x16 for working across configfile.
+2008-05-25 fixed int76 in probe_int for a Tongfang.
+2008-05-22 fixed an issue of CPU cache wrongly disabled in GRUB.EXE for long.
+2008-05-21 fixed an issue of stack-overflow in real_get_cmdline.
+2008-05-17 enable the geometry_tune code for test only.
+2008-05-14 fix int5 and int8 in probe_int.
+2008-05-06 adjustment on probe_int for "pxe keep".
+2008-05-03 fixed problem on the commands setup and install.
+2008-05-02(r59) add new command checktime.
+2008-05-01 fixes on int vector probing, A20 control, configfile, find, etc.
+2008-03-14(r58) commented out the geometry-tune code. other fixes.
+2008-01-01(r57): mini build support
+2007-12-25(r56): created the test branch
+2007-12-25(r55) removed commands uppermem, ioprobe, impsprobe and displayapm.
+2007-12-14 test 3 of the geometry-tune.
+2007-12-10 cleanups on chainloader and errorcheck.
+2007-12-05 fixed a bug in ntfs file system module.
+2007-12-04 fixes on gzipped (rd) image support.
+2007-12-02 int13 emulation workaround for buggy BIOSes('Disk read error').
+2007-11-23 implemented cdrom emulation.
+2007-10-15(r54) version 0.4.3
+2007-10-08 implemented chainloading isolinux.
+2007-10-04 changed drive number of (md) to 0xffff.
+2007-10-02 reduced output messages for "debug off".
+2007-09-27 added a new map option of --a20-keep-on.
+2007-09-26 a workaround for buggy USB floppy BIOSes(hang at INT13/AH=48h).
+2007-08-27(r53) new notation () standing for the current root device.
+2007-08-26 new feature of root prefix for support of relative path.
+2007-08-25 fixed one more possible issue on A20.
+2007-08-24 fixed another possible issue on A20 for memdrives.
+2007-08-23 fixed a possible issue on A20 for memdrives.
+2007-08-21 expand memdrive size according to the probed CHS.
+2007-08-17 test A20 control for memory mapped disks.
+
+ Updated code for hmload.
+ Fixed a major problem of endless loop on enumeration of partitions.
+ Fixed an issue in probe_mbr.
+ Fixed a bug on compressed NTFS volume.
+ Fixed a problem in probe_int by capturing int10.
+
+2007-07-25 version 0.4.3pre2
+
+ Added a new command OUTLINE, and a new option --duce for GRUB.EXE.
+ Changed PARTNEW syntax. Fixed a problem of OPEN_PARTITION.
+ The arguments of PARTTYPE have changed to be optional.
+
+ A Fault-Recovery-Handler was imposed on probe_int to fight against
+ some very serious BIOS bugs(reportedly of DELL machines).
+
+ The DEBUG command syntax was changed for verbosity control.
+
+2007-06-22 version 0.4.3pre1
+
+ Fixed two problems on GRUB.EXE: preset_menu and FreeDOS related.
+ Added a new command `hiddenflag'; Added BPB in GRLDR.MBR; Ignored the
+ partition-ID check in filesystem modules; other fixes.
+
+ PXE and NTFS fixes.
+ Fixed a bug in probe_int for GRUB.EXE running in VM86 mode.
+ Rewrite fsys_ntfs.c
+ Fixed probe_int and init_pic in GRUB.EXE. Reduced warnings in bios.c.
+ Added PXE support.
+ NTFS code update for bootlace. Fixed timing functions.
+ fix a bug in get_diskinfo; protect the MBR of an in-situ-mapped drive.
+ Insert-key to debug on startup; polish graphics. NTFS boot record fix.
+ Bugfixes on STAGE2_SIZE, arrow keys, and handling `&&'/`||' in menu.
+ Move preset menu to the end/tail of pre_stage2.
+ Numeric keys to select menu entry; fixed a bug of int13 harddrives.
+ Code clean-ups on build script and keycode translation.
+ F11/F12 hotkey handling.
+ Added builtin NTFS boot sectors into GRLDR.
+ Added 3 commands is64bit, errnum and errorcheck.
+ Applied Robert Millan's patch of check_64bit.
+ Implemented two syntactic operators `&&' and `||'.
+ Added a new option --in-situ for the map command.
+
+ Fixed an auto-probe-int problem of GRUB.EXE under "EMM386 noems".
+
+ Workaround for buggy VirtualPC on a issue of floppy-emulation-mode
+ bootable CDROM.
+
+2006-12-28 version 0.4.2
+
+ Fixed a bug hidden deeply in memcheck.
+ Fixed a bug hidden deeply in get_diskinfo.
+ Fixed a bug in load_image.
+ GRLDR(as a no-emulation-mode bootable CDROM image) was adapted to
+ cope with some buggy BIOSes(e.g., VirtualPC).
+ Added LBA-to-CHS geometry translation(in int13_handler) to simulate
+ LBA(EBIOS)-enabled drives on CHS-only drives.
+ Added a new feature of Unconditional Command-line Entrance.
+ Applied Beverly Brown's patch to load_initrd.
+ Added two new options to the map command to better serve Win9x.
+ The default config file search path for GRUB.EXE was changed to
+ (DOS file) .\menu.lst and then (DOS file) \menu.lst and then
+ (GRUB file) /menu.lst.
+ Other bug fixes.
+
+2006-10-24 version 0.4.2pre11
+
+ Made a workaround for buggy USB-bootable board QDI 848E.
+ Made a workaround for buggy 965 board with SATA CDROM connected.
+
+2006-10-07 version 0.4.2pre10
+
+ Fixed a problem in GRUB shell which causes failure in grub-install.
+ Enabled GRUB.EXE to run under FreeDOS with memdrives in use.
+ Implemented an auto-probe mechanism to support all kinds of DOSes.
+
+2006-09-19 version 0.4.2pre9
+
+ Resolved several problems:
+ 1. (about kexec)Dropped the problematic kexec-tools-1.101-patch.
+ 2. (about stack)Adjusted code in C files to use less stack.
+ 3. (about cdrom)Fixed a few bugs in the cdrom driver.
+
+2006-08-29 version 0.4.2pre8
+
+ Added a new command `setvbe'.
+ Dropped the obsolete EZ-BIOS(with signature `AERMH') support.
+ Fixed a bug in parsing Rock-Ridge extension.
+ No-emulation-mode Bootable CD can be chainloaded now.
+ Some work was done to improve remote/diskless boot.
+ Fixed one more USB/Floppy EBIOS problem(in get_diskinfo).
+ Merged protected mode stack into real mode stack at 0x2000.
+ Code clean-up.
+
+2006-07-31 version 0.4.2pre7
+
+ Imported ATAPI CDROM driver from Smart Boot Manager.
+
+ Dropped the previous implementation of SCDROM/BIOSCDROM.
+
+ Fixed a USB/Floppy EBIOS problem that could cause media access failure
+ or even hang the machine when using USB storage devices.
+
+ Fixed a bug in BOOTLACE.COM that had improperly set the LBA indicator
+ byte(which is at offset 0x02 of the boot sector).
+
+ Fixed a bug in GRLDR that caused failure in finding the associated
+ MENU.LST config-file(which should be in the same directory as GRLDR).
+
+2006-06-18 version 0.4.2pre6
+
+ Dropped the obsolete EZD disk map support.
+ Fixed several bugs that may hang or slow the qemu virtual machine.
+ Fixed a bug that causes the pause command not to respond any key-press.
+ Fixed a bug that causes a command to accidentally fail if in a menu.
+ Fixed a bug that causes the menu not to work once a cdrom had booted.
+
+2006-06-05 version 0.4.2pre5
+
+ Added a static-linked binary executable file GRUB(a Linux utility).
+
+ Fixed a gateA20 problem related to memdrive emulation.
+
+ Boot GRUB.EXE directly off Windows9x/Me(experimental; might hang).
+
+2006-04-03 version 0.4.2pre4
+
+ Made GRUB.EXE run under EMM386.
+ Fixed a bug in splashimage_func().
+ Made `ignore error' constant and removed the `--ignore-error' option,
+ and renamed the option `--seconds=T' to `--wait=T' for savedefault.
+ The sample menu.lst was modified accordingly.
+
+2006-03-28 version 0.4.2pre3
+
+ New syntax for the `default' and `savedefault' commands was
+ implemented.
+
+ Changed `int' to `unsigned long' for filemax, filepos and fsmax, and
+ modified all fsys_*.c files in order to open large files(2GB or
+ longer).
+
+2006-03-09 version 0.4.2pre2
+
+ The directory `boot/grub/' was removed from the release tree(GRUB4DOS
+ does not use the stage files at boot time). The default config file for
+ GRUB.EXE was changed to (hd0,0)/menu.lst(but preset_menu still locates
+ (hd0,0)/boot/grub/menu.lst when (hd0,0)/menu.lst does not exist).
+
+ Added DOS command-line options --bypass, --time-out=T and --hot-key=K
+ for GRUB.EXE.
+
+2006-02-24 version 0.4.2pre1
+ gcc-4 support by VirusCamp.
+
+ Limited support for returning to DOS from GRUB.EXE.
+
+ Implemented a new feature that GRUB.EXE can be used as a DOS device
+ driver and be started in CONFIG.SYS with a DEVICE line.
+
+ Better IODELAY was made for initialization of PIC to fix the
+ keyboard-not-responding problem when running through KEXEC.
+
+ Better A20 gate control was made to help fix various problems on the
+ boot of grub.
+
+2005-12-14 version 0.4.1
+ Fixed a partition enumeration bug(in disk_io.c). Fixed a bug of mapping
+ partitions to harddrives(in builtins.c). Fixed a bug that causes
+ failure when `find --set-root' on a CD-ROM device(in builtins.c). Added
+ a new feature of directly chainloading ntldr and some dos kernels.
+
+2005-11-14 version 0.4.1pre32
+ Fixed more bugs.
+
+2005-11-02 version 0.4.1pre31
+ A few bugs were fixed.
+
+2005-10-23 version 0.4.1pre30
+ A bug about "bootlace.com --floppy" was fixed.
+
+2005-10-18 version 0.4.1pre29
+ Added ram disk device (rd) to access, typically, the initrd image.
+ Added many new command-line options for bootlace.com to install GRLDR
+ boot record onto the boot sector of a floppy. A few bugs about
+ "map --mem" were fixed. Another bug about finding grldr in NTFS was
+ also fixed. It may cause the machine to hang up when there is no ntfs
+ boot record in the boot area of the NTFS partition.
+
+2005-09-25 version 0.4.1pre28
+ Commandline option --config-file="FILENAME_OR_RAW_COMMANDS" was added
+ for GRUB.EXE where GRUB.EXE is treated as a Linux kernel.
+ Fixed a bug which causes installation failure when BOOTLACE.COM is
+ used for large disks.
+
+2005-09-21 version 0.4.1pre27
+ Added a patch to the kexec-tools-1.101. Kexec might fail to load
+ grub.exe without this patch.
+
+2005-09-14 version 0.4.1pre26
+ Fixed a bug for the DOS part of BOOTLACE.COM
+
+2005-09-11 version 0.4.1pre25
+ GRUB4LIN has merged into GRUB.EXE; A new command-line option
+ --read-only was added for BOOTLACE.COM; A few bug fixes.
+
+2005-09-01 version 0.4.1pre24
+ BOOTLACE.COM runs under both DOS and Linux.
+
+2005-08-27 version 0.4.1pre23
+ Added a utility BOOTLACE.COM for installing grldr bootstrap code to MBR
+
+2005-07-30 version 0.4.1pre22
+ Added bootstrap file GRLDR.MBR for launching grldr from MBR.
+
+2005-07-24 version 0.4.1pre21
+ Added Windows NT 4.0 support(actually fixed a bug reported by Stefan
+ Baur). For other new features, see README.txt.
+
+2005-07-20 version 0.4.1pre20
+ Added ext2/ext3 boot record code for loading grldr from the beginning
+ sector of a floppy or a partition.
+
+2005-05-25 version 0.4.1pre5
+ GRUB commands can be embedded into the command line of GRUB.EXE
+
+2005-05-20 version 0.4.1pre4
+ Bug fixes: When the system has no floppies, some operations,
+ e.g., the find command, will hang the machine.
+
+2005-05-17 version 0.4.1pre3
+ Search for cdrom_drive from drive 0x88 to drive 0xff
+
+2005-05-11 version 0.4.1pre2
+ Our base is now upgraded to GNU GRUB 0.97.
+
+2005-04-25 version 0.4.1pre
+ Fixed a bug reported by Gilles van Ruymbeke
+ <gvr_no_spam_123@ruymbeke.com> <gvr_grub4dos123@ruymbeke.ch>:
+
+ The map_func improperly opened the emulation image for 3 times, that
+ might slow down the load speed heavily, especially for gzipped files.
+
+2005-04-15 version 0.4.0
+ Add /boot/grub/menu.lst in preset menu. This is final.
+
+2005-04-07 version 0.4.0pre7
+ config_file takes precedence over preset_menu.
+
+2005-04-06 version 0.4.0pre6
+ GRLDR can be used with no-emulation-mode bootable CD-ROM.
+
+2005-03-09 version 0.4.0pre4
+ Now preset menu find /menu.lst, no longer support /boot/grub/menu.lst
+
+ Partition images can emulate a partition (hd?,0) with --mem option.
+
+2005-03-02 version 0.4.0pre3
+ GRLDR startup code search all partitions in all harddrives for GRLDR.
+
+ chainloader can boot images larger than 512 bytes, and can load image
+ to a different location than 0000:7C00.
+
+2005-02-06 version 0.4.0pre
+ Switched to GNU GRUB 0.96
+ The --mem option of MAP command was added for memdrive emulation.
+
+ Also announced 0.2.0 final.
+
+2004-10-23 version 0.2.0pre13
+ GRUB.EXE runs in DOSBOX.
+ GRUB4LIN is introduced to boot off LINUX.
+ Fixed a bug reported by windrv: NTFS check contiguity failure
+ Rearranged the patches.
+
+2004-08-31 version 0.2.0pre12
+ Fixed a bug reported by szwp: cannot load GRLDR on partition that is
+ not CHS-accessible.
+
+ Fixed a bug reported by windrv: take too much time to check contiguity
+
+2004-08-15 version 0.2.0pre11
+ Mark the scdrom module as experimental.
+
+2004-07-13 version 0.2.0pre9
+ Merged GNU GRUB 0.95
+
+ BOOTGRUB removed. Use BOOT.INI line C:\GRLDR="Start GRUB" instead.
+
+ Patches from Gandalf: NTFS and ATAPI CDROM support(also thanks to
+ Tobias Svensson <tobiassvensson@home.se>)
+
+ Patches from Chris Semler <csemler@mail.com>: findroot
+
+2004-04-12 version 0.2.0pre6
+ Now GRUB.EXE can be used in CONFIG.SYS this way:
+
+ shell=C:\some\where\grub.exe --config-file=(hd0,0)/boot/grub/menu.lst
+
+ or
+
+ shell=C:\some\where\grub.exe
+
+ No other changes.
+
+2004-04-09 version 0.2.0pre5
+ Now BOOTGRUB contains 4 sectors, i.e., 2048 bytes. Optionally, you may
+ copy the 2nd, 3rd and 4th sectors of BOOTGRUB to the three sectors that
+ immediately follow the MBR. Also Optionally, you may copy 446 bytes
+ from the very beginning of BOOTGRUB to the very beginning of MBR. In
+ this way, the GRLDR can be started out of MBR, without the presence of
+ NTLDR.
+
+ CAUTION: Don't copy 512 bytes to MBR. The partition table should not
+ be overwritten. The partition table is in the end of MBR. If you make
+ a mistake, you will lose your whole system!!
+
+2004-02-18 version 0.2.0pre4
+ Arbitrary-size floppy and hard disk emulation finally implemented.
+ GRUB for NTLDR is included. See README file.
+ Splash image version is available in the SPLASH directory.
+
+2003-09-23 version 0.1.4 -- development unstable release
+ Unfortunately 0.1.3 has an ugly bug. Fixed.
+
+2003-09-01 version 0.1.3 -- development unstable release
+ Rewrite the code for guessing FreeDOS int vectors. Hopefully it works
+ for all the future versions of FreeDOS :-)
+
+2003-08-25 version 0.1.2 -- development unstable release
+ Fixed a small bug that affects the read of the emulated floppy sectors.
+
+ Added some files (including the menu.lst file) for installing GRUB to
+ MBR from DOS. Usage:
+
+ Copy the boot directory to C:\ ; You must do this on Windows, NOT dos,
+ because DOS cannot deal with the long filenames.
+
+ Run grub to access the menu.lst file in C:\boot\grub ; Of cause on DOS.
+
+ When menu occurs, select a proper menu item for installing GRUB to MBR.
+
+ If the menu does not appear, you should get the "grub>" prompt. At the
+ prompt, type the following commands:
+
+ grub> configfile (hd0,1)/boot/grub/menu.lst
+ grub> configfile (hd0,2)/boot/grub/menu.lst
+ grub> configfile (hd0,3)/boot/grub/menu.lst
+
+ Then, the menu should occur.
+
+2003-06-29 version 0.1.0.1 -- development unstable release
+ Do some cleanups on 0.1.0, no important changes.
+ BTW, it seems that the 0.1.0 is quite stable :-)
+
+2003-06-29 version 0.0.8
+ Restore mapped int13 to the unmapped state while grub is invoked
+ after a previously performed drive map operation.
+
+2003-05-29 version 0.1.0 -- development unstable release
+ Floppy 1.44M drive emulation are OK. GOOD!!!! Usage:
+
+ # boot Windows 98 SE
+ map (hd1,0)/dos98se.img (fd0)
+ chainloader (hd1,0)/dos98se.img
+ rootnoverify (fd0)
+ boot
+
+ Another example:
+
+ # boot Mandrake hard disk installer
+ map (hd0,0)/hd.img (fd0)
+ chainloader (hd0,0)/hd.img
+ rootnoverify (fd0)
+ boot
+
+ Note that the floppy image file must size 1440KB, i.e., 1474560 bytes.
+ _AND_ also, the file must consist of one contiguous disk area, no
+ holes, no fragments. Use GRUB's blocklist command to determine whether
+ or not an image file is contiguous. It is known that a 1440KB-file is
+ always non-contiguous if it resides in an ext2 filesystem. But you may
+ get a 1440KB contiguous file with an FAT32 partition(vfat filesystem).
+
+ Floppy(and hard disk) with arbitrary sizes will be emulated in the
+ future.
+
+2003-05-06 version 0.0.7
+
+ Fixed a huge bug!! Read the following carefully!
+
+ Using the drive map command(just as many distributions currently do)
+
+ map TO_DRIVE FROM_DRIVE
+
+ to boot your system could seriously _damage_ your hard disk data,
+
+ totally and thoroughly!! This bug has just been fixed in 0.0.7 :-)
+
+ This bug is not specific to grub_for_dos, but caused by the original
+
+ grub-0.93 release. So do _NOT_ use map command any more until my fix is
+
+ accepted by GRUB maintainers or a similar fix is made by other
+
+ people. For now, do _NOT_ use map command in any kind of Linux
+
+ distributions such as Red Hat or Mandrake or any others.
+
+ Because GRUB_FOR_DOS-0.0.7 already applied the fix, so it
+
+ should be safe to use the map command.
+
+ Another small bug was also fixed in grub_for_dos-0.0.7 :-)
+
+2003-04-29 version 0.0.6
+ Runs also on MS-DOS 3.30. No other changes.
+
+2003-04-26 version 0.0.5
+ Runs on MS-DOS 4.0, 5.0, 6.0, 6.20, 6.21, 6.22, 7.0, 7.10, 8.0 and
+ FreeDOS(build 2029). GOOD!!
+
+2003-04-20 version 0.0.4
+ Running on FreeDOS(build 2029), GOOD!! (But currently GRUB.EXE only
+ has limited FreeDOS support, maybe unstable.)
+
+ Add a "Guess DOS Version" feature. The program now exit to DOS when
+ guess failed. The previous versions of GRUB.EXE always hang when
+ running on an unsupported DOS version.
+
+2003-04-13 version 0.0.3
+ The option "--config-file=FILE" was added.
+
+2003-04-11 version 0.0.2
+ Also runs on MS-DOS 8.0 (i.e., the DOS with WinMe/2000/XP), GOOD!!
+ The GRUB.PIF file included, so GRUB.EXE can be started from Windows 9x
+
+2003-04-10 version 0.0.1
+ Runs on MS-DOS 7.10(Win98)
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_chenall.txt b/client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_chenall.txt
new file mode 100644
index 00000000..cc498a49
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/ChangeLog_chenall.txt
@@ -0,0 +1,645 @@
+2011-12-11
+ 1.可以使用map --status=n来获取已经映射磁盘的状态。 use map --status=n to get status of hooked drive n.
+ 返回以下两个变量信息(return)
+ %?%=Start_Sector
+ %@retval%=Sector_Count
+ 如果该磁盘不存在返回0.
+
+2011-12-08
+ 1.支持菜单自动编号(使用动态菜单时比较有用)。 Support menu AutoNumber.this is useful when used iftitle.
+ usage:
+ write 0x8274 0x2001
+ or
+ write 0x8274 0x2D01
+ 0x20(space) or 0x2d ('-') is the delimiter char in ascii code.
+ 更多的用法介绍:
+ http://bbs.wuyou.com/viewthread.php?tid=180142&page=193#pid2351695
+
+2011-12-06
+ 1.bug修正。
+ 2.使用调试模式启动时可以显示条件菜单执行的命令。
+
+2011-12-05
+ 1.添加条件菜单功能 added iftitle.
+ 语法: iftitle [<command>] Actual Title displayed\nOptional help line
+ 只要条件不成立该菜单项目无效。
+ eg.如果(hd0,0)上有bootmgr文件才会显示第一个菜单,如果有NTLDR文件才会显示第二个菜单
+
+ iftitle [if exist (hd0,0)/bootmgr] Boot to NT6.X from (hd0,0)
+ chainloader (hd0,0)/bootmgr
+
+ iftitle [if exist (hd0,0)/ntldr] Boot to NT5.X from (hd0,0)
+ chainloader (hd0,0)/ntldr
+
+2011-12-01
+ 1.BUG修正。
+ BUG fixed.
+ 2.添加使用INT18启动功能。
+ Supported boot via INT 18.
+ 用法(usage):
+ boot -1
+ or
+ boot --int18
+ 3.一些代码精简
+
+2011-11-29
+ 1.BUG修正。
+ 2.新的color命令语法。
+ color color_state=color [..]
+ 其中color_state字符串可以如下。
+ normal 未选中菜单
+ highlight 选中菜单
+ helptext 菜单帮助信息
+ heading 菜单头(GRUB4DOS信息)
+ standard 默认色(控制台)
+ border 菜单边框VBE模式下有效果
+ 3.新的setcolor/setcolorstate函数
+
+2011-11-27
+ 1.修正fontfile命令在splashimage后面时导至背景图颜色错误的问题.
+ 2.VGA模式(0x12/0x6a)没有使用splashimage命令时可以指定字体颜色和console模式一样.
+
+2011-11-22
+ 1.新的COLOR命令允许设置控制台默认字体颜色和背景色(只限于文本模式或VBE模式)
+ 方法: 直接使用只带一个参数的color命令即可.
+ 注: 在命令行或批处理脚本中执行有效.
+
+2011-11-19
+ 1.cursor_state bit 0=1 show cursor,bit 1=1 show splashimage.
+ use setcursor(n) to change if need,can change from commandline e.g.
+ call Fn.70 0 disable cursor and splashimage.
+ 2.清理部份无用代码.
+
+2011-11-18
+ 1.支持BMP背景图片,只限于VBE模式 supported splashimage with BMP format(VBE mode only).
+ 2.使用BMP图片时,如果非处于VBE模式,则尝试自动匹配图片分辨率.
+
+2011-11-03
+ 1.修正一个map的bug. bug fixed in map_func.
+ 相关贴子:
+ http://bbs.wuyou.com/viewthread.php?tid=201887
+ http://bbs.wuyou.com/viewthread.php?tid=201647
+ 2.忽略ISO9660文件系统上文件名的大小写. Make name comparisoncase-insensitive on iso9660.
+ 可以使用以下命令禁用该功能. You can use below command to disable this feature.
+ write 0x4CA24 0
+ 3.cat命令添加--locatei参数, added --locatei option for cat.
+ 查找时忽略大小写 ignore case locate.
+ eg.
+ cat --locatei=Test (md)0x300+1
+
+2011-10-07
+ 1.新增?_BOOT变量,访问启动GRUB4DOS的Boot_drive
+ add new Variable ?_BOOT to access grub4dos Boot_drive.
+ 2.为了节省代码GRUB4DOS内部不再处理外部命令WENV的兼容性(WENV tuxw版)
+ 解决办法如下:
+ 如果需要使用该版本WENV则自己在菜单或批处理中添加以下命令
+ write --offset=0x1f8 (md)0x228+1 ?_WENV\0
+ 3.uuid 命令对于uuid字符的判断不区分大小写。
+
+2011-10-02
+ 1.取消对fb启动盘的修正,恢复原样.
+ 2.其它批处理相关代码微调.
+
+2011-09-28
+ 1.修正访问磁盘分区的BUG(disk_io.c),感谢Yonsm的报告和测试.
+ fixed a bug in disk_io.c
+ http://bbs.wuyou.com/viewthread.php?tid=200520&extra=page%3D1
+
+2011-09-13
+ 1.修正insmod的一个bug(不能直接insmod默认路径下的文件)
+ fixed a bug in insmod_func.
+
+2011-09-05
+ 1.insmod支持指定名字,比如insmod fat.gz fat.
+ Support specified name when insmod a module.
+
+2011-09-02
+ 1.fixed a bug in setloca/endlocal.
+2011-08-25
+ 1.修正cat命令的一个BUG,使用cat --locate-align参数时会出错.
+ fixed a bug in cat_func.
+2011-08-23
+ 1.添加echo/cat命令的帮助信息.(issue: 38,40)
+ add help text for command echo/cat.
+ 2.修复help --all显示的问题(issue: 39)
+ fixed "help --all" issue.
+2011-08-09
+ 1.批处理call/gotoBUG修复.
+ 2.新的call可以直接call一个命令.
+
+2011-08-08
+ 1.一些代码微调.
+ 2.修正Ctrl+C强制中止批处理脚本,有时会失败的问题(call和&&,||连用时可能会失败)
+ 3.使用管道符"|"时超过0xC00长度的之符将被丢弃.
+
+2011-08-01
+ 1.外部命令调用修改,优先使用当前目录下的命令(如果存在的话).
+ 2.修复在批处理中使用exit命令退出批处理,导致批处理返回值为0的问题.
+
+2011-07-30
+ 1.批处理执行时允许使用Ctrl+C强制中断运行.
+
+2011-07-19
+ 1.内置变量?_WENV=?_UUID=?
+ 注:1.将来会取消?_UUID,为了保持兼容性,暂时先放一段时间.
+ 请使用%?%或%?_WENV%代替%?_UUID%来获取UUID.
+ 2.%?%变量可以获取命令返回的字符串信息.
+ 目前可用的信息有两个.uuid dev(返回指定设备的UUID字符串),cat --locate= (返回最后一个找到的位置)
+ 2.@random算法修改.
+
+
+2011-07-13
+ 1.在执行cmain之前初始化变量内存空间。
+
+2011-07-12
+ 1.执行clear命令时同时设置count_lines为0。
+ 2.内置变量增加@retval,其实就是之前的0x4cb00
+ 3.增加setlocal @和endlocal @用法。
+ setlocal @可以在批处理中使用,把当前的环境保存起来
+ 除非使用endlocal @否则setlocal @之后的设置会一直保留(批处理退出也不影响).
+ 注:1.在批处理中出现setlocal @则在批处理中setlocal @之前的setlocal命令会全部失效。
+ 所以setlocal @有必要的使用的话一般要放在批处理最前面。
+ 2.setlocal @后面如果还有出现setlocal,则setlocal之后的设置不会保留.
+
+2011-07-11
+ 1.添加SETLOCAL和ENDLOCAL命令,和WINDOWS下的批处理用法一样。
+
+2011-07-05
+ 1.尝试解决%~d0,%~f0路径提取的问题,现在%~f0应该可以提取到正确的路径。
+ 2.解决if命令输出转向失败的问题。
+ 3.其它代码调整。
+
+2011-05-27
+ 1.优化PXE_DIR代码。
+ 2.其它微调。
+
+2011-05-25@176
+ 1.调整cat命令的查找字符串代码。
+ 2.修改批处理的调试模式开启方法(改为debug 3才会进入调试模式)
+ 3.消除一些编译时的警告信息。
+
+2011-05-23@174
+ 1.修正一个TFTP相对路径的问题,感谢2011exuejiao@wuyou.
+ 2.在批处理中可以使用debug 3临时开启debug模式。
+
+2011-04-30@159
+ 1.取消前面版本对批处理参数的调整.恢复到04-16版.
+ 2.修正一个BUG.(函数print_root_device).
+ 3.批处理参数新增%~f 文件全路径,%~z文件大小.
+ 4.现在批处理脚本可以使用使用errorcheck命令控制是否检测错误(默认错误就退出).
+
+2011-04-29@157
+ 1.find 命令不再查找(hdx)设备.
+ 2.删除@root变量的前导空格.
+ 3.ls命令新增dev参数,用于显示设备列表.
+ 4.批处理代码调整,对于(bd)设备%~d0会使用实际的设备.
+
+2011-04-25@156
+ 1.新增两个内置变量@root,@path.
+ @root 当前的root.
+ @path 当前默认外部命令查找路径.
+ 2.修正一个可能导致程序出错的问题.(使用到了临时变量的内存).
+ 3.批处理代码功能增强.
+
+2011-04-16@153
+ 1.md5crypt 支持参数。后面直接跟一个字符串会直接计算这个字符串的md5。
+ 2.菜单支持以变量开头的命令。
+
+2011-03-30@151
+ 1.LZMA格式解压时暂时禁止显示进度(因为显示进度时解压大文件会失败)。
+ 2.添加内置变量?_UUID(使用uuid命令可以把获取到的磁盘uuid保存到变量中).
+
+2011-03-29@150
+ 1.insmod *.mod添加了检测模块文件头是否为GRUBEXEC签名.
+ 注:目前还是兼容旧版本的MOD模块,一段时间后会取消,请使用新的MAKEMOD重新制作模块。
+
+ 2.对批处理路径和文件名的空格进行自动处理。空格前面自动加转义符"\"
+ 注:使用p,n,x参数时有效。即%~1时不会处理,但%~p1时会处理。
+
+2011-03-26@150
+ 1.使用kernel (rd)+1启动时,默认的启动设备改为当前root.
+
+2011-03-25@149
+ 1.修改cat命令替换时显示的信息
+ cat --locate=S -replace=R 除非debug on否则不显示信息.
+ 2.批处理参数新增%*代表所有参数%1 %2 %3 ....
+
+2011-03-24
+ 1.set /p功能增强(可能会和之前的版本不兼容),新增参数set /p:N
+ 主要变动:
+ 1).如果未输入不会清除原来的变量.(之前的版本会清除).
+ 2).新增支持默认时间没有输入自动退出.
+ set /p:N variable=prompt
+ 如果在N秒之内没有任何输入,则返回,并且不改变variable的值.
+
+2011-03-23
+ 1.为了方便使用,修改shift命令为内部命令.并且shift支持参数
+ shift n 或 shift /n
+ 具体用法,可以参考CMD/linux下的shift命令帮助.
+
+2011-02-19
+ 1.修复kernel加载grub2 loader的问题.
+ fixed a bug when load multiboot-image(boot.c).
+ 2.现在可以运行16位程序,和wee的机制一样(直接移植了wee里面的代码)
+
+2011-02-15
+ 1.添加realmode_run函数
+ 2.修改GPT分区检测代码,更加严格的检测。
+
+2011-02-12
+ 1.增加GPT分区检测,检测不通过就使用MBR分区。
+ 2.一些代码微调。
+
+2011-02-10
+ 1.清理UTF8转换UNICODE的代码,不再需要(请同时更新UNIFONT).
+ 2.修复变量字符串截取BUG.Fixed Bug in envi_cmd func.(thanks sratlf@wuyou report).
+ http://bbs.wuyou.com/viewthread.php?tid=180142&page=52#pid2154655
+
+ 注意:从2011-02-10开始,必须使用最新版的UNIFONT才可以正常显示UNICODE字符.
+
+ Note: You must also update unifont to the latest version.new unifont can show unicode char anywhere.
+ Download the latest version of unifont:
+ http://code.google.com/p/grubutils/downloads/list
+
+2011-01-28
+ 1.支持读取GPT分区表。
+ 为了区别MBR分区表和方便编程,所有的GPT分区类型全部使用0xEE表示。
+
+ 2.修正一个bug,现在可以访问大于1T的硬盘.但还不能访问超过2T的内容。
+
+2011-01-26
+ 1.修复run_line的一个BUG,会导致返回值为假。
+ 2.添加IF/SET命令的帮助信息。
+ 3.IF命令增加以下语法,判读一个变量或文件是否存在。
+ if exist variable|filename command.
+ 4.控制pause的输出,debug小于0时不显示倒计时。debug小于1时不显示按键码.
+
+2011-01-22
+ 1.set /A 参数使用16进制数保存变量,set /a 十进制数保存变量。
+ 2.修复goto的一个bug.
+ 3.修复重定向操作符的bug.
+
+2011-01-19
+ 1.set命令不再接受回车换行符。
+ 2.修复获取批处理参数bug.
+ 3.修复fb文件系统bug(可能会导致访问文件出错)。
+
+2011-01-14
+ 1.set命令增强.添加了/l,/u参数
+ set /l a=Abcd
+ 把Abcd转为小写./u是转换大写。
+
+2011-01-13
+ 1.修复utf8菜单编码自动检测的BUG。
+
+2011-01-10
+ 1.修复SET命令的bug,添加/p参数
+ 2.修复启动linux时内存冲突的bug.
+
+2011-01-09
+ 1.菜单支持变量。
+ 2.支持变量截取(和CMD的方法一样),不支持替换。
+
+2011-01-08
+ 1.重写grub_sprintf函数,支持简易的宽度和精度控制符(m.n或*.*)。
+
+2011-01-07
+ 1.SET命令添加一个参数/a可以把=后面的计算结果赋值给变量.
+ 2.新的safe_parse_maxint函数支持一元运算符。"~!-"
+
+2011-01-06
+ 1.修改CAT命令的显示。现在的cat /filen.ext碰到字符结束符'\0'就停止。
+ 2.批处理内部添加一个命令shift(只能在批处理中使用).
+ 3.skip_to函数现在会可以跳过(‘\r’和‘\n’)。
+ 4.set *将清除所有变量。
+
+2011-01-05
+ 1.修正run_line的一个逻辑错误。
+ 2.外部命令command默认的目录改为(bd)/BOOT/GRUB/
+2011-01-03
+ 1.pager命令即实生效。
+ 2.添加简易的if判断命令类似的MSDOS.目前支持的判断如下:
+ added a new command if.
+ if [/I] [NOT] STRING1==STRING2 [COMMAND]
+ 注:判断符号==前后不允许有空格或制表符否则比较会失败。
+ 2.添加SET命令可以设置、修改、删除变量。
+ added a new command set to modify the variable.
+ 3.从现在开始支持变量。用法和MS-DOS一样。
+ From now supports variable.
+ 注:使用了和WENV同样的方案。所以这个功能可以看成是简化版的WENV
+
+2011-01-02
+ 1.pause命令添加一个参数--test-key,可以显示按键扫描码。
+ added --test-key option for pause to display the key scan code.
+ 2.grub_sprintf函数支持字符串精度控制符。
+
+
+2011-01-01
+ 1.修复find命令的bug。当然使用条件查询时可能会出错。
+ 2.批处理参数修改,为了方便使用,%9改成剩余的所有参数。
+ 比如参数: 1 2 3 4 5 6 7 8 9 0 a b c
+ 那%9就是9 0 a b c.
+
+2010-12-31
+ 1.pause命令增强,增加了显示按键码的功能。
+ 2.hiddenmenu命令增强。增加一个--chkpass参数
+ 具体用法请参考: README_GRUB4DOS.TXT对应的更新
+
+2010-12-28
+ 1.一些BUG修复.
+ 2.PAUSE命令增加倒计时显示.
+ 3.fsys_fb.sys代码微调.
+
+2010-12-25
+ 1.现在delmod也是一个内部命令.
+ 2.重写insmod/delmod相关的代码.把加载的模块固定在内存18MB开始的位置.
+
+2010-12-21
+ 1.从command_func中分离出insmod作为一个内部命令存在.
+ 现在允许insmod加载一个命令合集.(扩展名.mod)
+ 例子:
+ insmod grub4dos.mod
+ 这个命令合集使用MAKEMOD程序生成.
+
+2010-12-18
+ 1.代码调整.
+ cat添加一个参数--number=N 在查找替换的时候指定查找次数.
+2010-12-17
+ 1.fixed a bug in checkrange_func.
+
+2010-12-16
+ 1.修正使用批处理运行时可能会出现ERROR 25的错误.
+ 2.重写批处理运行函数.
+
+2010-12-15
+ 1.还原2010-12-10对0000:82A4的改变.
+ 2.为了方便使用当使用fbinst启动时有如下调整
+ boot_drive (bd) 为FB_DRIVE(ud)
+ 默认root(saved_drive) 为可见分区.
+ 3.为了减小压缩包的大小,改成用7z压缩发布.
+
+2010-12-14
+ 1.完善对ud(fbinst创建的分区)支持.现在不需要从fbinst启动也可以随意访问fbinst创建的分区.
+ 2.允许在批处理中执行的外部命令调用goto/call标签.
+
+2010-12-12
+ 1.批处理添加exit命令.直接退出批处理.如果后面有数值则设置为errnum.
+ 如exit 1,退出,并返回一个错误的值.
+ 2.一些代码优化调整.
+ 3.修改pause命令,现在的pause直接返回按键的ascii码值.
+
+2010-12-11
+ 1.完善批处理脚本参数的支持(同CMD下的批处理用法一样).
+ 2.可以在菜单中使用goto命令(即跳到某个菜单项目).
+ 3.delmod 添加参数-l用于显示已经加载的模块.如果-l后面还有参数则是判断该模块是否加载.
+
+2010-12-10
+ 1.改变了以下内存地址的定义(和之前的版本相反)
+ 0000:82A4 4 (DWORD) no_decompression (no auto gunzip)
+ 改成了
+ 0000:82A4 4 (DWORD) do_decompression (do auto gunzip)
+ 2.0x8284的值的bit2如果为1则显示解压进度,否则不显示,默认不显示.
+ 3.完善了goto/call的功能
+
+2010-12-09
+ 1.批处理脚本支持标签(类拟BAT批处理).
+ support goto/call and :label in batch script.
+ CALL :label arguments
+ goto label
+
+2010-12-07
+ 1.添加两个命令用于加载外部命令到内存中,加快运行速度.
+ insmod path-to-program
+ delmod program
+
+2010-12-06
+ 1.批处理脚本支持参数%0 - %9同cmd批处理用法一样。%~n 可以去掉前后的引号
+
+2010-11-24
+ 1.修正一个skip_to函数的bug。
+ fixed a bug in skip_to func,thanks tuxw.
+
+2010-11-21
+ 1.解决在(ud)上使用自动补全功能问题.
+ http://bbs.znpc.net/viewthread.php?tid=5976
+
+2010-11-19 supported pxe_dir list.
+ 1.添加PXE(pd)文件列表的支持.TFTP ROOT 上的每个目录下都需要有dir.txt才支持.
+ 可以使用以下命令生成dir.txt文件
+ for /r %i in (.) do (dir /a/b %i >%i\dir.txt)
+
+2010-11-18
+ 1.Fixed a bug in batch file,thanks Mr.zhaohj.
+ http://bbs.wuyou.com/viewthread.php?tid=180142&page=9#pid2087407
+ 2.Add a new variable at 0000:8278 for grub4dos version by date.
+ e.g. read 0x8278 return 0x132B7FE (20101118)
+ 3.Fixed a bug in find_func,thanks Mr.pseudo.
+2010-11-17
+ 1.重写command_func函数大部份代码。
+ 为了方便外命命令的编写,修改主函数调用为以下格式。
+ int main (char *arg, int flags)
+ 新的版本可以直接使用arg和flags参数,不需要再进行计算了。
+
+2010-11-16
+ 1.改进malloc/free函数。
+ 2.允许执行多个外部命令(之前只允许一个),现在可以在外部命令里面调用其它外部命令。
+ 外部命令调用方法使用builtin_cmd函数:builtin_cmd(char *cmd,char *arg,chat *flags);
+ builtin_cmd(NULL,Command and parameters,flags);
+
+2010-11-15
+ 1.内置echo命令自动回车符改为"\r\n"
+ 2.添加malloc/free函数.
+
+2010-11-04
+ 1.重写run_line(执行一行命令函数)。
+ 支持操作符连用。例:
+  echo a | echo b | echo c | echo
+ echo abcd > (md)0x300+1 && echo def
+ 2.支持新的操作符">>"和">"一样,但这个会附加(附加在输出文件中的第一个字符串结束符'\0'后面)
+  注:目前这个操作符不会改变文件大小。
+
+ 2.内置ECHO函数添加两个参数(默认回车不转义)
+ -n 不自动添加回车符
+     -e 允许转义符
+2010-10-28
+ 1.some bug fixed.
+ 2.find支持查找使用cdrom --init生成的光驱(只找第一个)
+
+2010-10-27
+ 1.修改printf函数,支持显示"%",和C语言的语法一样,使用"%%"来显示一个"%"
+ 2.重写find的查询代码.
+ 3.find新增参数--devices=[DEVICES],指定要查找的设备.
+
+ 说明:DEVICES可以是以下字符的组合:
+ u,p,n,h,c,f -->分别对应 ud,pd,nd,hd,cd,fd,
+
+ 例子:--devices=hcf //只查找hd,cd,fd,从hd开始.
+ 注:优先current root.然后再按上面的顺序.(current root必须在列表中,否则跳过)
+
+ 可以使用这个参数来重新设定查找顺序,默认(find order):ud->pd->nd->hd->cd->fd
+
+ 4.保留--ignore-cd和--ignore-floppies参数(会自动转换).
+
+2010-10-26
+ 1.find支持(fdx,y)的格式.
+ 2.优先查找当前root.
+2010-10-03
+ 1.使用操作符"|"时默认自动添加空格,并解决使用"|"时可能导致死机或重启的问题。
+
+2010-09-30
+ 1.修正操作符号!失效的问题。
+ 2.恢复内置菜单的大写MENU.LST为小写(保持兼容性)。
+ 3.内置echo命令。
+ 用法:
+ echo [-P:[-]XX[-]YY] MESSAGE
+ XX: Line number.
+ YY: Column number.
+
+ XXYY指定后面MESSAGE要显示的位置。
+ XX指定行号,YY指定列号。前导“-”,即倒数.
+
+2010-09-25
+ 1.修正calc计算的一个逻辑错误。
+ 2.使用fbinst启动默认root设为ud
+ set boot_drive to fb_drive(ud) if boot from fbinst.
+ 3.添加一个新的命令initscript,只能用于菜单中。
+ initscript用于初始化菜单,每次返回菜单时在显示完菜单后执行。
+ 有时候会需要这样的功能,比如执行某个菜单失败后返回菜单时重新执行一次初始化。
+ initscript /initscript.g4d
+
+2010-09-25
+ 1.简易计算器调整.如果没有"="则不保存计算结果,但++和--除外.
+ 例子:
+ calc *0x60000 + 4 不保存计算结果,所以内存指向*0x60000的值不会被改变.
+ calc *0x60000++ 会保存计算结果到*0x60000中.
+ calc *0x60000 = 1+2 同上.
+ 2.如果当前已经是图形模式允许graphicsmode直接切换,而不用经过terminal console中转.
+
+2010-09-16
+ 1.修正一个产生Error 27的错误。
+
+2010-09-06
+ 1.添加操作符号"|" ">",输出重定向(有点类似DOS)
+ Implemented two syntactic operators "|" and ">".Like Dos Output redirection.
+ note: 1.use with "&&" and "||" ,the "|" and ">" must be at last.
+ 2."|" and ">" can not use at same time.
+ 例子:
+ 1. pause abcd | pause efg
+ output: efgabcd
+ 2. pause 0x60000 | read #There is a space after the read.
+ run read 0x60000
+ 3.help > (hd0,0)/help.txt or help > (md)0x3000+2
+ help.txt must already exist,grub4dos cann't create file or change file size.
+2010-09-05
+ 1.修改TAB的显示方式,现在使用8个字节对齐显示。
+
+2010-08-10
+ 1.fixed a bug in disk_io.c,it may return error 25 when set root to a cd drive.
+ 修正一个BUG,当设置root为cd设备时可能会提示Error 25的错误.
+ 2.加快colinux下源码在cofs设备时编译的速度.
+
+2010-06-21
+ 1.打上支持新版FB的补丁
+ 来源:http://www.burgloader.com/bbs/index.php?topic=37.30
+2010-05-02
+ 1.PXE启动时首先尝试加载root目录下的menu.lst。
+
+2010-04-17
+ 1.命令行自动完成调整.现在可以直接输入/+TAB显示当前目录下的文件或(hd0,0)/+TAB显示(hd0,0)/下面的文件列表
+ 以前的版本必需要像以下命令才可以。
+ root /+TAB
+ 2.get_cmdline函数调整,以方便外部命令直接调用。
+
+2010-03-29
+ 1.外部命令执行过程调整。
+
+ 例子:默认path (bd)/grub/
+ echo abcd ## 优先使用(bd)/grub/echo 文件,如果没有再找 /echo 文件
+ /echo abcd ## 只查找/echo 文件。
+ (fd0)/echo abcd ## 只找 (fd0)/echo abcd 文件。
+ 2.find 命令添加一个 --ignore-oem 参数。
+ http://code.google.com/p/grub4dos-ireneuszp/
+
+2010-03-10
+ 1.边框位置自动调整。
+
+2010-03-09
+ 1.注释掉karyonix 4G GZIP MAP的部份代码。
+ 2.添加UNIFONT外部命令,可以加载UNIFONT字库。当菜单文件是UTF8格式时可以显示多国语言。
+ Support multi-language menu with UNIFONT.
+
+2010-03-01
+ 1.打上了karyonix的4G map 补丁
+ http://bbs.znpc.net/viewthread.php?tid=5844
+ http://www.boot-land.net/forums/index.php?s=&showtopic=10096&view=findpost&p=91378
+
+ 2.添加fontfile外部命令.
+ 3.添加menuset外部命令.
+
+2010-02-09
+ 1.重写cmp部份代码(注:比较时可能会比较慢,因为只使用了1MB的缓存,之前的版本是完全缓存).
+ 顺便添加了新参数 --skip=
+ 可以指定在比较时跳过几个字节,用于cmp --hex时方便查看差异.
+
+2010-02-05
+ 1.添加calc简单计算器功能.
+ calc [*INTEGER=] [*]INTEGER OPERATOR [[*]INTEGER]
+
+ 具体使用方法参考这里的外部命令calc的用法,是一样的,只是内置了.
+ http://www.chenall.com/blog/2010/02/grub4dos_calc.html
+
+
+2010-01-13
+ 修改设置默认可执行文件搜索路径参数为
+ --set-path=PATH
+ 例子
+ command --set-path=(bd)/grub/
+
+2010-01-09
+ 1.为command参数添加一个参数--set-root用于设置默认可执行文件的搜索路径。
+ add option --set-root for command
+ sets a search PATH for executable files,default is (bd)/grub
+
+2009-12-03 g@chenall.cn
+ 1.修改了cat --hex代码,现在cat --hex会显示ascii>127的字符。
+ 2.修改了cmp --hex代码,现在cmp --hex后面显示的字符同样可以显示中文。
+ 并且添加了颜色控制,不同的地方使用了菜单的高亮色显示。
+
+2009-12-01 g@chenall.cn
+ 1.同步源码到2009-12-01版(修正了NTFS上DD或WRITE的问题)
+ 2.修改调整了cat --replace,当使用--replace=*addr时允许使用--hex来指定读取长度。具体
+ http://bbs.znpc.net/viewthread.php?tid=5784&page=10&fromuid=29#pid42939
+
+2009-11-29 g@chenall.cn
+ 1.调整了chainloader功能,如果chainloader (rd)+1,并且没有指定edx设备,那将把当前设备设为EDX。
+ Changed chainloader_func,if use chainloader (rd)+1 then will set current_root to EDX
+ 从光盘上的BOOTMGR启动硬盘上的VISTA/WIN7系统。
+ Boot VISTA/WIN7 from cdrom or any other device
+ chainloader (cd)/BOOTMGR
+ rootnoverify (hd0,0)
+ dd if=(hd0,0)+1 of=(md)0x3E+1
+ 现在可以直接使用以下方法来启动; You can now use the following commands..
+ map --mem=0xF000 /BOOTMGR
+ find --set-root --ignore-cd --ignore-floppies /BOOT/BCD
+ chainloader (rd)+1
+ http://bbs.znpc.net/viewthread.php?tid=5784&page=7&fromuid=29#pid42684
+ Tips:about EDX,please read README_GRUB4DOS.txt
+ 2.源码同步到官方2009-11-29版。
+2009-11-28 g@chenall.cn
+ 1.修正了当内存>2G时访问可能会出错的问题.
+ fixed a bug when access memory>2G problems.
+ eg.
+ cat --hex (md)0x40002F+1
+ map --mem (md)0x600000+0x19020
+2009-11-26 g@chenall.cn
+ 1.修改cmp_func代码,使用之使用十六进制显示差异偏移(为了方便对比使用)。
+ change cmp_func to show Differ at the offset with HEX
+ 2.为cmp添加了一个参数--hex(直接显示十六进制)
+ add --hex option for cmp
+2009-11-24 g@chenall.cn
+ 1.添加(bd)设备,即启动设备,注:使用configfile命令会改变启动设备。
+ added (bd) support.(bd):the boot drive. note:use configfile to change boot drive
+ eg. boot from (hd0,0)
+ now boot drive is (hd0,0)
+ configfile (hd0,1)/menu.lst
+ now boot drive is (hd0,1) \ No newline at end of file
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS.txt b/client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS.txt
new file mode 100644
index 00000000..03b13d47
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS.txt
@@ -0,0 +1,4138 @@
+Please refer to http://grub4dos.sourceforge.net/wiki/ for DOCs on GRUB4DOS.
+
+Main project page: http://grub4dos-chenall.googlecode.com/
+
+Download site: http://code.google.com/p/grub4dos-chenall/downloads/list
+
+Unused:
+Download site: http://grub4dos.sourceforge.net/
+Download site: http://sarovar.org/projects/grub4dos/
+Download site: http://grub4dos.nufans.net/
+Download site: http://sites.google.com/site/grubdos/
+Download site: ftp://grub4dos.sarovar.org/pub/grub4dos/
+
+Get the latest source code by using anonymous svn in this way:
+
+ svn co http://grub4dos-chenall.googlecode.com/svn/trunk/ grub4dos
+
+or in this way:
+
+ git clone git://github.com/chenall/GRUB4DOS.git
+
+View the source code online with your web browser at:
+
+ http://code.google.com/p/grub4dos-chenall/source/browse/
+
+GRUB4DOS mailing list:
+
+ grub4dos-devel@gna.org
+
+Subscription page:
+
+ https://mail.gna.org/listinfo/grub4dos-devel/
+
+Discussion forum(Official technical support site):
+
+ Chinese:
+ http://bbs.wuyou.com/forumdisplay.php?fid=60
+ http://bbs.znpc.net/forumdisplay.php?fid=4
+ English:
+ http://reboot.pro/forum/66/
+
+------------------------------------------------------------------------------
+
+Usage:
+ GRUB [--bypass] [--time-out=T] [--hot-key=K] [--config-file=FILE]
+
+ The FILE, for example, can be (hd0,0)/menu.lst
+
+ In CONFIG.SYS, the line looks like:
+
+ install=c:\some\where\grub.exe --config-file=FILE
+
+ If no options present, GRUB.EXE simply uses
+
+ (hd0,0)/menu.lst
+
+ as the configure file, if it exists. (Notice! We finally
+ changed the default file from (hd0,0)/boot/grub/menu.lst to
+ (hd0,0)/menu.lst) (Changed 2006-12-23. See Update 3 below.)
+
+ The partition (hd0,0) can be of a Windows partition or a Linux
+ partition, or any other partition type supported by GRUB.
+
+ Only GRUB-style filename is acceptable here for FILE. A DOS
+ filename won't work(it is certain we should use GRUB-style
+ filenames because DOS-filenames won't access a file in a
+ Linux ext2 partition for example).(See Update 2 below)
+
+ Update: FILE can be the contents of a menu. Use semi-colon
+ to delimitate the embedded commands here in FILE. The FILE
+ can be enclosed with a pair of double-quotes. For example:
+
+ GRUB --config-file="root (hd0,0);chainloader +1"
+
+ This command will boot the system in (hd0,0).
+
+ Another example:
+
+ GRUB --config-file="reboot"
+
+ This command will reboot the machine.
+
+ One more example:
+
+ GRUB --config-file="halt"
+
+ This command will halt the machine.
+
+ if --bypass is specified, GRUB will exit to DOS when
+ timeout reached.
+
+ The option `--time-out=T' specifies the timeout value in
+ seconds. T defaults to 5 if --bypass is specified and defaults
+ to 0 if --bypass is not specified.
+
+ The default hot key value is 0x3920(for space bar). If this
+ key is pressed, GRUB will boot normally. If another key is
+ pressed, GRUB will terminate immediately and return back to
+ DOS. See "int 16 keyboard scan codes" below.
+
+ Each option can be specified only once at most.
+
+ Update 2: DOS filenames have been supported(patched by John
+ Cobb). If the beginning two characters of FILE are "#@", then
+ the rest of FILE is taken as a DOS filename. Example:
+
+ GRUB --config-file="#@c:\menu.lst"
+
+ Only the beginning 4KB of the DOS file will be used. The file
+ should be an uncompressed text file.
+
+ Note: You may also use the `direct DOS file access' with the
+ SHELL or INSTALL line in CONFIG.SYS, but should not use it
+ with the DEVICE line. The DOS document said that a DOS device
+ driver should not call the `open file' DOS call.
+
+ Update 3(2006-12-23): By default, GRUB.EXE will locate its
+ config file in the following order:
+
+ (DOS file) .\menu.lst, the MENU.LST in the current dir.
+
+ (DOS file) \menu.lst, the MENU.LST in the root dir of
+ the current drive.
+ (GRUB file) /menu.lst, the MENU.LST in the root dir of
+ the boot device.
+
+ The default boot device is still (hd0,0).
+
+
+--------------------------------------------------------
+
+Update 1: Version 0.2.0 also brings out a new thing, GRUB for NTLDR,
+ which could be used to boot into GRUB from the boot menu
+ of Windows NT/2000/XP. Copy GRLDR to the root directory of
+ drive C: of Windows NT/2000/XP and append to C:\BOOT.INI
+ this line:
+
+ C:\GRLDR="Start GRUB"
+
+ That will be done. The GRLDR should be in the same directory
+ as BOOT.INI and NTLDR. Note that BOOT.INI is usually hidden
+ and you must unhide it before you can see it. The filename
+ GRLDR shouldn't be changed. If GRLDR is in a NTFS partition,
+ it should be copied to the root directory of another non-NTFS
+ partition(and likewise should the menu.lst file be). If GRLDR
+ is compressed, e.g., in a NTFS partition, it will not work.
+
+ Even if the drive letter of this disk has been changed to
+ other than C by the Windows device manager, it seems you still
+ have to use the letter C here in BOOT.INI, otherwise, NTLDR
+ will fail to locate the GRLDR file.
+
+ And what's more, if you are booting NTLDR from a floppy, you
+ will have to write the GRLDR line in A:\BOOT.INI like this:
+
+ C:\GRLDR="Start GRUB"
+
+ and shouldn't use the letter A like this:
+
+ A:\GRLDR="Start GRUB"
+
+ (Note that in the case when BOOT.INI is on floppy A, the
+ notation "C:\GRLDR" actually refer to the file A:\GRLDR).
+
+
+Update 2: GRUB for Linux is also introduced along with 0.2.0. You can
+ boot grub using a linux loader KEXEC, LILO, SYSLINUX or another
+ GRUB. (GRUB4LIN has merged into GRUB.EXE)
+
+ To boot GRUB off Linux, use this pair of commands:
+
+ kexec -l grub.exe
+ kexec -e
+
+ To boot GRUB via GRUB, use commands like the following:
+
+ kernel (hd0,0)/grub.exe
+ boot
+
+ To boot GRUB via LILO, use these lines in lilo.conf:
+
+ image=/boot/grub.exe
+ label=grub.exe
+
+ To boot GRUB via SYSLINUX, use these lines in syslinux.cfg:
+
+ label grub.exe
+ kernel grub.exe
+
+ LOADLIN may encounter problems when loading grub.exe, because
+ grub.exe requires some unchanged original BIOS interrupt
+ vectors, but DOS has destroyed them, and loadlin does not
+ recover them before it transfers control to grub.exe.
+
+Update 3: Beginning at version 0.4.0, GRUB for DOS supports memdrives.
+ Example:
+
+ # boot into a floppy image
+ map --mem (hd0,0)/floppy.img (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ map --floppies=1
+ boot
+
+ Because the image will be copied to a memory area, the image
+ itself can be non-contiguous and even gzipped.
+
+ Another Example:
+
+ map --mem=-2880 (hd0,0)/floppy.img (fd0)
+
+ This memdrive (fd0) will occupy at least 1440 KB of memory.
+ This is useful when the size of a 1.44M-floppy image is less
+ than 1440 KB.
+
+ One more example:
+
+ map --mem --read-only (hd0,0)/hd.img (hd1)
+
+ This memdrive is a hard drive, and read-only. That means you
+ will not be able to write data to the memdrive (hd1).
+
+ You can use many memdrives and many ordinary virtual emulated
+ disk-based drives at the same time.
+
+ If the BIOS does not support int15/EAX=e820h, you will not be
+ able to use any memdrives.
+
+Update 4: For memdrive emulation, a single-partition image can be used
+ instead of a whole-harddrive image. Example:
+
+ map --mem (hd0,7)/win98.img (hd0)
+ map --hook
+ chainloader (hd0)+1
+ rootnoverify (hd0)
+ map --harddrives=1
+ boot
+
+ Here win98.img is a partition image without the leading MBR
+ and partition table in it. Surely GRUB for DOS will build an
+ MBR and partition table for the memdrive (hd0).
+
+Update 5: Now GRLDR can be used as a no-emulation-mode bootable CD-ROM
+ boot image. Example for Linux users:
+
+ mkdir iso_root
+ cp grldr iso_root
+ mkisofs -R -b grldr -no-emul-boot -boot-load-seg 0x1000 -o bootable.iso iso_root
+
+ As an alternative, grldr can also be used the same way as
+ stage2_eltorito. The -boot-info-table option is allowed but you
+ can omit it:
+
+ mkdir iso_root
+ cp grldr iso_root
+ mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o grldr.iso iso_root
+
+ Also note that the bootable.iso above must be created with the
+ -boot-load-seg 0xHHHH option where HHHH is greater than or
+ equal to 1000(hex). If HHHH < 1000(hex), QEMU will hang. This
+ is a bug in QEMU. The grldr.iso can be created with or without
+ -boot-load-seg 0xHHHH option.
+
+ The menu.lst file should be placed in the root dir of the CD.
+
+Update 6: The Chinese special build is in the "chinese" subdirectory.
+ (patched by Gandalf, 2005-06-27)
+
+ The Chinese special build also has scdrom builtin.
+ (update: scdrom has been dropped since 2006-07-20)
+
+Update 7: Added memory drive (md). Like (nd) for network drive and (cd)
+ for CD-ROM drive, a new drive (md) is implemented for accessing
+ the whole memory as a disk drive. (md) only works for systems
+ with BIOS int15/EAX=E820h support.
+
+ The cat command now has a few new options: --hex for hexdump,
+ and --locate=STRING for string search in file.
+
+ Typical examples:
+
+ cat --hex (hd0)+1
+
+ It will display the MBR sector in hex form.
+
+ cat --hex (md)+2
+
+ It will display 1KB of your memory(in fact, it is the real-mode
+ IDT table), also in hexdump form.
+
+ cat --hex (md)0x800+1
+
+ It will display 1 sector of your extended memory.
+
+ cat --hex (hd0,0)+1
+
+ It will display the first sector of partition (hd0,0). Usually
+ this sector contains the boot record of an operating system.
+
+Update 8: Added ram drive (rd). The (md) device accesses the memory
+ starting at physical address 0. But (rd) accesses memory
+ starting at any base address. The base and length of the ram
+ drive can be specified through the map command. "help map" for
+ details. You can even specify the BIOS drive number used for
+ the (rd) drive, e.g., map --ram-drive=0xf0. The default drive
+ number for (rd) is 0x7F which is a floppy. If (rd) is a hard
+ drive image, you should change the drive number to a value
+ greater than or equal to 0x80(but should avoid using 0xffff,
+ because 0xffff is for the (md) device).
+
+ The notation (rd)+1 always represents the file which contains
+ all the bytes stored in (rd).
+
+Update 9: Directly boot NTLDR of WinNT/2K/XP and IO.SYS of Win9x/ME and
+ KERNEL.SYS of FreeDOS. Examples:
+
+ chainloader --edx=0xPPYY (hd0,0)/ntldr
+ boot
+
+ chainloader --edx=0xYY (hd0,0)/io.sys
+ boot
+
+ chainloader --ebx=0xYY (hd0,0)/kernel.sys
+ boot
+
+ Hex YY specifies the boot drive number, and hex PP specifies
+ the boot partition number of NTLDR. If the boot drive is
+ floppy, PP should be the hex value ff, i.e., decimal 255.
+
+ For KERNEL.SYS of FreeDOS, the --edx won't work,
+ use --ebx please.
+
+ The option --edx ( --ebx ) can be omitted if the file is in
+ its normal place. But in some cases, those options are needed.
+
+ If, e.g., the ntldr file is in an ext2 partition called
+ (hd2,8) while you want it to think of the Windows partition
+ (hd0,7) as the boot partition, then --edx is required:
+
+ chainloader --edx=0x0780 (hd2,8)/ntldr
+
+ For DOS kernels(i.e., IO.SYS and KERNEL.SYS), the boot
+ partition number is meaningless, so you only need to specify
+ the correct boot drive number YY(but specifying the boot
+ partition number is harmless).
+
+ The above PPYY can also be specified by using a root or
+ rootnoverify command after the chainloader command. Examples:
+
+ chainloader (hd2,6)/kernel.sys
+ rootnoverify (hd0) <-------- YY=80
+ boot
+
+ chainloader (hd0,0)/ntldr
+ rootnoverify (hd0,5) <-------- YY=80, PP=05
+ boot
+
+ Tip: CMLDR (the ComMand LoaDeR, which is used to load the
+ Windows Fault Recovery Console) can be chainloaded as well
+ as NTLDR.
+
+ Bean has successfully decompressed and booted IO.SYS of WinME.
+ Thanks for the great job!
+
+Update 10: isolinux.bin (version 3.73) can be chainloaded as with build
+ 2009-02-09.
+
+ chainloader (cd)/isolinux.bin
+
+ isolinux.bin must reside in a real or virtual cdrom.
+
+Update 11: stage2 of Grub Legacy can be chainloaded in this way:
+
+ chainloader --force --load-segment=0 --load-offset=0x8000 --boot-cs=0 --boot-ip=0x8200 (...)/.../stage2
+
+--------------------------------------------------------
+
+ There is no full documentation in English at present. Here are some
+ examples showing the usage of disk emulation commands:
+
+1. Emulates HD partition C: as floppy drive A: and boot win98 from C:
+
+ map --read-only (hd0,0)+1 (fd0)
+ chainloader (hd0,0)+1
+ rootnoverify (hd0)
+ boot
+
+ In the above example, (hd0,0) is drive C: with win98 on it. After win98
+ boot complete, you will find that A: contains all files of C:, and if
+ you delete files in A:, the files in C: will also disappear.
+
+ At the map command line, the notation (hdm,n)+1 is interpreted to
+ represent the whole partition (hdm,n), not just the first sector of the
+ partition.
+
+2. Emulates HD partition C: as floppy drive A: and boot win98 from A:
+
+ map --read-only (hd0,0)+1 (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ map --floppies=1
+ boot
+
+ After the "map --hook" command, the emulation takes effect instantly
+ even in the GRUB command line.
+
+ Note that the (fd0) in "chainloader (fd0)+1" is the emulated virtual
+ floppy A:, not the real floppy diskette(because map is hooked now).
+
+
+3. Emulates an image file as floppy drive A: and boot win98 from C:
+
+ map --read-only (hd0,0)/floppy.img (fd0)
+ chainloader (hd0,0)+1
+ rootnoverify (hd0)
+ map --floppies=1
+ map --harddrives=1
+ boot
+
+4. Emulates an HD partition as the first hard disk and boot DOS from it:
+
+ map --read-only (hd2,6)+1 (hd0)
+ map --hook
+ chainloader (hd0,0)+1
+ rootnoverify (hd0)
+ map --harddrives=1
+ boot
+
+ In this example, (hd2,6)+1 represents an extended logical DOS partition
+ of the third BIOS hard disk (hd2).
+
+ If a DOS partition is used to emulate a hard disk, GRUB for DOS will
+ first try to locate the partition table, usually 63 sectors ahead of
+ the DOS partition. GRUB for DOS will refuse the emulation if the
+ partition table is not there.
+
+5. Emulates an image file as the first hard disk and boot DOS from it:
+
+ map --read-only (hd0,0)/harddisk.img (hd0)
+ chainloader --load-length=512 (hd0,0)/harddisk.img
+ rootnoverify (hd0)
+ map --harddrives=1
+ boot
+
+ If an image file is used to emulate a hard disk, the image file must
+ contain an MBR. In other word, the first sector of HARDDISK.IMG must
+ contain the partition table of the emulated virtual hard disk.
+
+Note: Counters for floppies and harddrives in the BIOS Data Area remain
+ unchanged during the mapping. You should manually set them to proper
+ values with `map --floppies=' and/or `map --harddrives=', especially,
+ e.g., when there is no real floppy drive attached to the mother board.
+ If not doing so, DOS might fail to start.
+
+ `map --status' can report the values. Note also that `map --floppies='
+ and `map --harddrives=' can be used independently without the
+ appearance of mappings.
+
+ 0.4.2 has introduced a new variable, memdisk_raw, to simulate the
+ memdisk-like raw mode. If the BIOS has no int15/87h, or if it has
+ buggy int15/87h support, you should set this variable before any
+ memdrives are used. Here is an example:
+
+ map --memdisk-raw=1
+ map --mem (hd0,0)/floppy.img (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ boot
+
+ If you encountered a memdrive failure without using
+ map --memdisk-raw=1, you should have a try with `map --memdisk-raw=1'.
+
+ If you `map --memdisk-raw=0' later, you should afterwards do a
+ `map --unhook'(and followed by a `map --hook' if needed).
+
+ Update: memdisk_raw now defaults to 1. You should `map --memdisk-raw=0'
+ if you want to use int15/87h to access memdrives.
+
+--------------------------------------------------------
+
+ Floppies/harddisks of any size can be emulated with GRUB for DOS 0.2.0.
+
+ Image file must be contiguous, or else GRUB for DOS will refuse it.
+
+ The `blocklist' command can list fragments or pieces of a file.
+
+ Type "help map" at the GRUB prompt to get a brief description of the
+ command.
+
+ The form
+
+ map ... (fd?)
+
+ is a floppy emulation, and the form
+
+ map ... (hd?)
+
+ is a hard disk emulation.
+
+ When a HARD DISK emulation is used, better not start Windows for
+ security reasons. Windows may even destroy all data and all information
+ on all your real hard disks!!!!!!!!
+
+ Update for --mem: when --mem is used, it seems rather safe even after
+ entering Windows. Win98 can operate the memdrive normally.
+
+ Windows NT/2000/XP does not recognize the emulated drives no matter
+ whether the --mem option is present.
+
+
+
+******************************************************************************
+*** Explanation of the grldr-bootable floppies or harddisk partitions ***
+******************************************************************************
+
+1. Ext2 Boot Sector/Boot Record Layout (for loading grldr)
+------------------------------------------------------------------------------
+An EXT2/EXT3 volume can be GRUB-bootable. Copy grldr and an optional menu.lst
+to the root dir of the EXT2/EXT3 volume, and build the boot sector based on the
+fifth sector of grldr(some fields need to be changed as detailed in the
+following table). And then the EXT2/EXT3 volume is GRUB-bootable.
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the first sector of an EXT2/EXT3 volume.
+
+Offset Length Description
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+
+02h 1 LBA indicator. Valid values are 0x02 for CHS mode, or 0x42 for
+ LBA mode.
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x42.
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x42. It seems that
+ (generally) all USB BIOSes have LBA support.
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x42,
+ otherwise, set to 0x02.
+
+ Note that Windows98 uses the value 0x0e as the LBA indicator.
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+
+03h 10 OEM name string (of OS which formatted the disk).
+ Update: this field is now used for error message of "I/O error"
+
+0Dh 1 Sectors per block. Valid values are 2, 4, 8, 16 and 32.
+
+0Eh 2 Bytes per block. Valid values are 0x400, 0x800, 0x1000, 0x2000
+ and 0x4000.
+
+10h 4 Pointers in pointers-per-block blocks, that is, number of
+ blocks covered by a double-indirect block.
+
+ Valid values are 0x10000, 0x40000, 0x100000, 0x400000 and
+ 0x1000000.
+
+14h 4 Pointers per block, that is, number of blocks covered by an
+ indirect block.
+
+ Valid values are 0x100, 0x200, 0x400, 0x800, 0x1000.
+
+18h 2 Sectors per track.
+
+1Ah 2 Number of heads/sides.
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+
+ Also referred to as the starting sector of the partition.
+
+ For floppies, it should be 0.
+
+20h 4 Total number of sectors in the filesystem(or in the partition).
+
+24h 1 BIOS drive number of the boot device.
+
+ Actually this byte is ignored for read. The boot code will
+ write DL onto this byte. The BIOS or the caller should set
+ drive number in DL.
+
+ We assume all BIOSes pass correct drive number in DL.
+ Buggy BIOSes are not supported!!
+
+25h 1 Partition number of this partition on the boot drive.
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+
+26h 2 inode size in bytes. (Notice! We use the formerly reserved
+ word here for inode size!)
+
+28h 4 Number of inodes per group.
+
+ Normally a 1.44M floppy has only one group, and the total
+ number of inodes is 184. So the value should be 184 or
+ greater.
+
+2Ch 4 The block number for group descriptors.
+
+ Valid values are 2 for 1024-byte blocks, and 1 otherwise.
+
+ The value here is equal to (s_first_data_block + 1).
+
+30h 1 code for "cld"(0xFC).
+
+31h 2 code for "xor ax,ax"(0x31, 0xC0).
+
+33h 1 code for "nop"(0x90) or "cwd"(0x99)
+
+34h 458 The rest of the machine code.
+
+1FEh 2 Boot Signature AA55h.
+
+
+2. FAT12/FAT16 Boot Sector/Boot Record Layout (for loading grldr)
+------------------------------------------------------------------------------
+A FAT12/16 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
+the root dir of the FAT12/16 volume, and build the boot sector based on the
+fourth sector of grldr(some fields need to be changed as detailed in the
+following table). And then the FAT12/16 volume is GRUB-bootable.
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the boot sector of an FAT12/16 volume.
+
+Offset Length Description
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+
+02h 1 LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
+ LBA mode.
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x0e.
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x0e. It seems that
+ (generally) all USB BIOSes have LBA support.
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x0e,
+ otherwise, set to 0x90.
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+
+ Update(2006-07-31): Though GRLDR won't use this LBA-indicator
+ byte, Windows 98 uses it. Usually this byte should be 0x90 for
+ CHS mode(especially for floppies). If this byte is not set
+ properly, Windows 98 will not recognize the floppy or
+ partition. This problem was reported by neiljoy. Many thanks!
+
+03h 8 OEM name string (of OS which formatted the disk).
+
+0Bh 2 Bytes per sector. Must be 512.
+
+0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
+ and 128. But a cluster size larger than 32K should not occur.
+
+0Eh 2 Reserved sectors(number of sectors before the first FAT,
+ including the boot sector), usually 1.
+
+10h 1 Number of FATs(nearly always 2).
+
+11h 2 Maximum number of root directory entries.
+
+13h 2 Total number of sectors (for small disks only, if the disk is
+ too big this is set to 0 and offset 20h is used instead).
+
+15h 1 Media descriptor byte, pretty meaningless now (see below).
+
+16h 2 Sectors per FAT.
+
+18h 2 Sectors per track.
+
+1Ah 2 Total number of heads/sides.
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+
+ Also referred to as the starting sector of the partition.
+
+ For floppies, it should be 0.
+
+20h 4 Total number of sectors for large disks.
+
+24h 1 BIOS drive number of the boot device.
+
+ Actually this byte is ignored for read. The boot code will
+ write DL onto this byte. The BIOS or the caller should set
+ drive number in DL.
+
+ We assume all BIOSes pass correct drive number in DL.
+ Buggy BIOSes are not supported!!
+
+25h 1 Partition number of this filesystem in the boot drive.
+
+ This byte is ignored for read. The boot code will write
+ partition number onto this byte. See offset 41h below.
+
+26h 1 Signature (must be 28h or 29h to be recognised by NT).
+
+27h 4 Volume serial number.
+
+2Bh 11 Volume label.
+
+36h 8 File system ID. "FAT12 ", "FAT16 " or "FAT ".
+
+3Eh 1 code for "cli".
+
+3Fh 1 code for "cld".
+
+40h 1 code for "mov dh, imm8".
+
+41h 1 Partition number of this partition on the boot drive.
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+
+42h 442 The rest of the machine code.
+
+1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
+
+
+3. FAT32 Boot Sector/Boot Record Layout (for loading grldr)
+------------------------------------------------------------------------------
+A FAT32 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
+the root dir of the FAT32 volume, and build the boot sector based on the
+third sector of grldr(some fields need to be changed as detailed in the
+following table). And then the FAT32 volume is GRUB-bootable.
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the boot sector of an FAT32 volume.
+
+Offset Length Description
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+
+02h 1 LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
+ LBA mode.
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x0e.
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x0e. It seems that
+ (generally) all USB BIOSes have LBA support.
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x0e,
+ otherwise, set to 0x90.
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+
+ Update(2006-07-31): Though GRLDR won't use this LBA-indicator
+ byte, Windows 98 uses it. Usually this byte should be 0x90 for
+ CHS mode(especially for floppies). If this byte is not set
+ properly, Windows 98 will not recognize the floppy or
+ partition. This problem was reported by neiljoy. Many thanks!
+
+03h 8 OEM name string (of OS which formatted the disk).
+
+0Bh 2 Bytes per sector. Must be 512.
+
+0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
+ and 128. But a cluster size larger than 32K should not occur.
+
+0Eh 2 Reserved sectors(number of sectors before the first FAT,
+ including the boot sector), usually 1.
+
+10h 1 Number of FATs(nearly always 2).
+
+11h 2 (Maximum number of root directory entries)Must be 0.
+
+13h 2 (Total number of sectors for small disks only)Must be 0.
+
+15h 1 Media descriptor byte, pretty meaningless now (see below).
+
+16h 2 (Sectors per FAT)Must be 0.
+
+18h 2 Sectors per track.
+
+1Ah 2 Total number of heads/sides.
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+
+ Also referred to as the starting sector of the partition.
+
+ For floppies, it should be 0.
+
+20h 4 Total number of sectors for large disks.
+
+24h 4 FAT32 sectors per FAT.
+
+28h 2 If bit 7 is clear then all FATs are updated, otherwise bits
+ 0-3 give the current active FAT, all other bits are reserved.
+
+2Ah 2 High byte is major revision number, low byte is minor revision
+ number, currently both are 0.
+
+2Ch 4 Root directory starting cluster.
+
+30h 2 File system information sector.
+
+32h 2 If non-zero this gives the sector which holds a copy of the
+ boot record, usually 6.
+
+34h 12 Reserved, set to 0.
+
+40h 1 BIOS drive number of the boot device.
+
+ 80h is first HDD, 00h is first FDD.
+
+ Actually this byte is ignored for read. The boot code will
+ write DL onto this byte. The BIOS or the caller should set
+ drive number in DL.
+
+ We assume all BIOSes pass correct drive number in DL.
+ Buggy BIOSes are not supported!!
+
+41h 1 Partition number of this filesystem in the boot drive.
+
+ This byte is ignored for read. The boot code will write
+ partition number onto this byte. See offset 5Dh below.
+
+42h 1 Signature (must be 28h or 29h to be recognised by NT).
+
+43h 4 Volume serial number.
+
+47h 11 Volume label.
+
+52h 8 File system ID. "FAT32 ".
+
+5Ah 1 opcode for "cli".
+
+5Bh 1 opcode for "cld".
+
+5Ch 1 opcode for "mov dh, imm8".
+
+5Dh 1 Partition number of this partition on the boot drive.
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+
+5Eh 414 The rest of the machine code.
+
+1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
+
+
+4. NTFS Boot Sector/Boot Record Layout (for loading grldr)
+------------------------------------------------------------------------------
+An NTFS volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
+the root dir of the NTFS volume, and build the boot sector based on the
+6th-9th sectors of grldr(some fields need to be changed as detailed in the
+following table). And then the NTFS volume is GRUB-bootable.
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the leading 4 sectors of an NTFS volume.
+
+Offset Length Description
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+
+02h 1 LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
+ LBA mode.
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x0e.
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x0e. It seems that
+ (generally) all USB BIOSes have LBA support.
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x0e,
+ otherwise, set to 0x90.
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+
+ Update(2006-07-31): Though GRLDR won't use this LBA-indicator
+ byte, Windows 98 uses it. Usually this byte should be 0x90 for
+ CHS mode(especially for floppies). If this byte is not set
+ properly, Windows 98 will not recognize the floppy or
+ partition. This problem was reported by neiljoy. Many thanks!
+
+03h 8 OEM name string (of OS which formatted the disk).
+
+0Bh 2 Bytes per sector. Must be 512.
+
+0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
+ and 128. But a cluster size larger than 32K should not occur.
+
+0Eh 2 (Reserved sectors)Unused.
+
+10h 1 (Number of FATs)Must be 0.
+
+11h 2 (Maximum number of root directory entries)Must be 0.
+
+13h 2 (Total number of sectors for small disks only)Must be 0.
+
+15h 1 Media descriptor byte, pretty meaningless now (see below).
+
+16h 2 (Sectors per FAT)Must be 0.
+
+18h 2 Sectors per track.
+
+1Ah 2 Total number of heads/sides.
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+
+ Also referred to as the starting sector of the partition.
+
+ For floppies, it should be 0.
+
+20h 4 (Total number of sectors for large disks)Must be 0.
+
+24h 4 (FAT32 sectors per FAT) - Usually 80 00 80 00, A value of
+ 80 00 00 00 has been seen on a USB thumb drive which is
+ formatted with NTFS under Windows XP. Note this is removable
+ media and is not partitioned, the drive as a whole is NTFS
+ formatted.
+
+28h 8 Number of sectors in the volume.
+
+30h 8 LCN of VCN 0 of the $MFT.
+
+38h 8 LCN of VCN 0 of the $MFTMirr.
+
+40h 4 Clusters per MFT Record.
+
+44h 4 Clusters per Index Record.
+
+48h 8 Volume serial number.
+
+50h 4 Checksum, usually 0.
+
+54h 1 opcode for "cli".
+
+55h 1 opcode for "cld".
+
+56h 1 opcode for "mov dh, imm8".
+
+57h 1 Partition number of this partition on the boot drive.
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+
+58h 420 The rest of the machine code in the first sector.
+
+1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
+
+200h 1536 The rest of the machine code in the last 3 sectors.
+
+------------------------------------------------------------------------------
+
+Appendix A: File System Information Sector of FAT32(not used by grldr)
+
+Offset Length Description
+====== ====== ==============================================================
+0h 4 Leading Signature 41615252h.
+
+4h 480 Reserved, set to 0.
+
+1E4h 4 FSI structure signature 61417272h.
+
+1E8h 4 Contains the last known count of free clusters, if this is
+ equal to FFFFFFFFh, then the count is unknown.
+
+1ECh 4 Cluster number at which you should begin a search for a free
+ cluster, if this is equal to FFFFFFFFh then the field has not
+ been set.
+
+1F0h 12 Reserved, set to 0.
+
+1FCh 4 Trailing Signature AA550000h.
+
+------------------------------------------------------------------------------
+
+Appendix B: Media Descriptor Byte(not used by grldr)
+
+The Media descriptor byte is meaningless because of the duplications, F0h for
+example.
+
+Byte Type of disk Sectors Heads Tracks Capacity
+---- ------------ ------- ----- ------ --------
+FFh 5 1/4" 8 2 40 320KB
+FEh 5 1/4" 8 1 40 160KB
+FDh 5 1/4" 9 2 40 360KB
+FCh 5 1/4" 9 1 40 180KB
+FBh both 9 2 80 640KB
+FAh both 9 1 80 320KB
+F9h 5 1/4" 15 2 80 1200KB
+F9h 3 1/2" 9 2 80 720KB
+F0h 3 1/2" 18 2 80 1440KB
+F0h 3 1/2" 36 2 80 2880KB
+F8h hard disk NA NA NA NA
+
+******************************************************************************
+*** grldr.mbr - How to write it to Master Boot Track of the hard disk ***
+******************************************************************************
+
+grldr.mbr contains code that can be used as Master Boot Record. The code is
+responsible for searching all partitions for grldr and when found, loading it.
+Currently supported partition types are: FAT12/FAT16/FAT32, NTFS, EXT2/EXT3.
+Logical partitions in the extended partition are supported, provided that the
+extended partition type is Microsoft-compatible. In fact, the Linux extended
+partition type(0x85) is not fully tested for the search mechanism.
+
+How to write GRLDR.MBR to the Master Boot Track of a hard disk?
+
+First, read the Windows disk signature and partition information bytes
+(72 bytes in total, from offset 0x01b8 to 0x01ff of the MBR sector), and put
+them on the same range from offset 0x01b8 to 0x01ff of the beginning sector of
+GRLDR.MBR.
+
+Optionally, if the MBR in the hard disk is a single sector MBR created by
+Microsoft FDISK, it may be copied onto the second sector of GRLDR.MBR.
+
+The second sector of GRLDR.MBR is called "previous MBR". When GRLDR not found,
+"previous MBR" will be started.
+
+No other steps needed, after all necessary changes stated above have been made,
+now simply write GRLDR.MBR on to the Master Boot Track. That's all.
+
+Note: The Master Boot Track means the first track of the hard drive.
+
+Note: The bootstrap code of GRLDR.MBR only finds GRLDR file in the root dir of
+a partition. You'd better place menu.lst file accompanying with GRLDR(i.e., in
+the same root dir of the same partition as GRLDR).
+
+The filename "grldr" in an ext2 partition must be in lower case letters, and
+the file type of grldr must be plain regular. Other types, e.g., a symbolic
+link, won't work.
+
+Update: bootlace.com is a DOS/Linux utility for installing grldr.mbr to MBR.
+The whole grldr.mbr is embedded in the body of the bootlace.com utility, so
+bootlace.com can be used independently. See below.
+
+******************************************************************************
+*** grldr.mbr - Details about the control bytes ***
+******************************************************************************
+
+Six bytes can be used to control the boot process of GRLDR.MBR.
+
+Offset Length Description
+====== ====== ==============================================================
+02h 1 bit0=1: disable the search for GRLDR on floppy
+ bit0=0: enable the search for GRLDR on floppy
+
+ bit1=1: disable the boot of PREVIOUS MBR with invalid
+ partition table(usually an OS boot sector)
+ bit1=0: enable the boot of PREVIOUS MBR with invalid
+ partition table(usually an OS boot sector)
+
+ bit2=1: disable the feature of unconditional entrance to
+ the command-line(See below `--duce')
+ bit2=0: enable the feature of unconditional entrance to
+ the command-line(See below `--duce')
+
+ bit3=1: disable geometry tune(See below `--chs-no-tune')
+ bit3=0: enable geometry tune(See below `--chs-no-tune')
+
+ bit4 - bit6: reserved
+
+ bit7=1: try to boot PREVIOUS MBR after the search for GRLDR
+ bit7=0: try to boot PREVIOUS MBR before the search for GRLDR
+
+03h 1 timeout in seconds to wait for a key press. 0xff stands for
+ waiting all the time(endless).
+
+04h 2 hot-key code. high byte is scan code, low byte is ASCII code.
+ the default value is 0x3920, which stands for the space bar.
+ if this key is pressed, GRUB will be started prior to the boot
+ of previous MBR. See "int 16 keyboard scan codes" below.
+
+06h 1 preferred boot drive number, 0xff for no-drive
+07h 1 preferred partition number, 0xff for whole drive
+
+ if the preferred boot drive number is 0xff, the order of the
+ search for GRLDR will be:
+
+ (hd0,0), (hd0,1), ..., (hd0,L),(L=max partition number)
+ (hd1,0), (hd1,1), ..., (hd1,M),(M=max partition number)
+ ... ... ... ... ... ... ... ...
+ (hdX,0), (hdX,1), ..., (hdX,N),(N=max partition number)
+ (X=max harddrive number)
+ (fd0)
+
+ otherwise, if the preferred boot drive number is Y(not equal to
+ 0xff) and the preferred partition number is K, then the order of
+ the search for GRLDR will be:
+
+ (Y) if K=0xff; or (Y,K) otherwise
+ (hd0,0), (hd0,1), ..., (hd0,L),(L=max partition number)
+ (hd1,0), (hd1,1), ..., (hd1,M),(M=max partition number)
+ ... ... ... ... ... ... ... ...
+ (hdX,0), (hdX,1), ..., (hdX,N),(N=max partition number)
+ (X=max harddrive number)
+ (fd0)
+
+ Note: if Y < 0x80, then (Y) is floppy, else (Y) is harddrive,
+ and (Y,K) is partition number K on harddrive (Y).
+
+
+******************************************************************************
+*** bootlace.com - Install GRLDR.MBR bootstrap code to MBR ***
+******************************************************************************
+
+BOOTLACE.COM installs GRLDR.MBR boot record to the MBR of a harddrive or of a
+harddrive image file, or to the boot sector of a floppy or a floppy image.
+
+Usage:
+
+ bootlace.com [OPTIONS] DEVICE_OR_FILE
+
+OPTIONS:
+
+ --read-only do everything except the actual write to the
+ specified DEVICE_OR_FILE.
+
+ --restore-mbr restore the previous mbr.
+
+ --mbr-no-bpb do not copy BPB in the boot sector of the
+ leading FAT partition to MBR.
+
+ --no-backup-mbr do not copy the old MBR to the second sector of
+ DEVICE_OR_FILE.
+
+ --force-backup-mbr force the copy of old MBR to the second sector
+ of DEVICE_OR_FILE.
+
+ --mbr-enable-floppy enable the search for GRLDR on floppy.
+
+ --mbr-disable-floppy disable the search for GRLDR on floppy.
+
+ --mbr-enable-osbr enable the boot of PREVIOUS MBR with invalid
+ partition table(usually an OS boot sector).
+
+ --mbr-disable-osbr disable the boot of PREVIOUS MBR with invalid
+ partition table(usually an OS boot sector).
+
+ --duce disable the feature of unconditional entrance
+ to the command-line.
+
+ Normally one can unconditionally get the
+ command-line console by a keypress of `C',
+ bypassing all config-files(including the
+ preset-menu). This is a security hole. So we
+ need this option to disable the feature.
+
+ DUCE is for Disable Unconditional Command-line
+ Entrance.
+
+ --chs-no-tune disable the feature of geometry tune.
+
+ --boot-prevmbr-first try to boot PREVIOUS MBR before the search for
+ GRLDR.
+
+ --boot-prevmbr-last try to boot PREVIOUS MBR after the search for
+ GRLDR.
+
+ --preferred-drive=D preferred boot drive number, 0 <= D < 255.
+
+ --preferred-partition=P preferred partition number, 0 <= P < 255.
+
+ --serial-number=SN setup a new serial number for the hard drive.
+ SN must be non-zero.
+
+ --time-out=T wait T seconds before booting PREVIOUS MBR. if
+ T is 0xff, wait forever. The default is 5.
+
+ --hot-key=K if the desired key K is pressed, start GRUB
+ before booting PREVIOUS MBR. K is a word
+ value, just as the value in AX register
+ returned from int16/AH=1. The high byte is the
+ scan code and the low byte is ASCII code. The
+ default is 0x3920 for space bar. See "int 16
+ keyboard scan codes" below.
+
+ --floppy if DEVICE_OR_FILE is floppy, use this option.
+
+ --floppy=N if DEVICE_OR_FILE is a partition on a hard
+ drive, use this option. N is used to specify
+ the partition number: 0,1,2 and 3 for the
+ primary partitions, and 4,5,6,... for the
+ logical partitions.
+
+ --sectors-per-track=S specifies sectors per track for --floppy.
+ 1 <= S <= 63, default is 63.
+
+ --heads=H specifies number of heads for --floppy.
+ 1 <= H <= 256, default is 255.
+
+ --start-sector=B specifies hidden sectors for --floppy=N.
+
+ --total-sectors=C specifies total sectors for --floppy.
+ default is 0.
+
+ --lba use lba mode for --floppy. If the floppy BIOS
+ has LBA support, you can specify --lba here.
+ It is assumed that all floppy BIOSes have CHS
+ support. So you would rather specify --chs.
+ If neither --chs nor --lba is specified, then
+ the LBA indicator(i.e., the third byte of the
+ boot sector) will not be touched.
+
+ --chs use chs mode for --floppy. You should specify
+ --chs if the floppy BIOS does not support LBA.
+ We assume all floppy BIOSes have CHS support.
+ So it is likely you want to specify --chs.
+ If neither --chs nor --lba is specified, then
+ the LBA indicator(i.e., the third byte of the
+ boot sector) will not be touched.
+
+ --fat12 FAT12 is allowed to be installed for --floppy.
+
+ --fat16 FAT16 is allowed to be installed for --floppy.
+
+ --fat32 FAT32 is allowed to be installed for --floppy.
+
+ --vfat FAT12/16/32 are allowed to be installed for
+ --floppy.
+
+ --ntfs NTFS is allowed to be installed for --floppy.
+
+ --ext2 EXT2 is allowed to be installed for --floppy.
+
+ --install-partition=I Install the boot record onto the boot area of
+ partition number I of the specified hard drive
+ or harddrive image DEVICE_OR_FILE.
+
+DEVICE_OR_FILE: Filename of the device or the image file. For DOS, a BIOS drive
+number(hex 0xHH or decimal DDD) can be used to access the drive. BIOS drive
+number 0 is for the first floppy, 1 is for the second floppy; 0x80 is for the
+first hard drive, 0x81 is for the second hard drive, etc.
+
+Note: BOOTLACE.COM writes only the boot code to MBR. The boot code needs to
+load GRLDR as the second(and last) stage of the GRUB boot process. Therefore
+GRLDR should be copied to the root directory of one of the supported
+partitions, either before or after a successful execution of BOOTLACE.COM.
+Currently only partitions with filesystem type of FAT12, FAT16, FAT32, NTFS,
+EXT2 or EXT3 are supported.
+
+Note 2: If DEVICE_OR_FILE is a harddisk device or a harddisk image file, it
+must contain a valid partition table, otherwise, BOOTLACE.COM will fail. If
+DEVICE_OR_FILE is a floppy device or a floppy image file, then it must contain
+a supported filesystem(i.e., either of FAT12/FAT16/FAT32/NTFS/EXT2/EXT3).
+
+Note 3: If DEVICE_OR_FILE is a floppy device or a floppy image file, and it
+was formated EXT2/EXT3, then you should specify --sectors-per-track and
+--heads explicitly.
+
+
+Important!! If you install GRLDR Boot Record to a floppy or a partition, the
+floppy or partition will boot solely grldr, and your original
+IO.SYS(DOS/Win9x/Me) and NTLDR(WinNT/2K/XP) will become unbootable. This is
+because the original boot record of the floppy or partition was overwritten.
+There is no such problem when installing GRLDR Boot Record onto the MBR.
+Update: Some NTLDR/IO.SYS/KERNEL.SYS files can be directly chainloaded in the
+latest GRUB4DOS.
+
+Tip: If the filename begins in a dash(-) or a digit, you may prefix a dirname
+(./) or (.\) to it.
+
+Examples:
+
+ Installing GRLDR boot code to MBR under Linux:
+
+ bootlace.com /dev/hda
+
+ Installing GRLDR boot code to MBR under DOS:
+
+ bootlace.com 0x80
+
+ Installing GRLDR boot code to a harddisk image under DOS or Linux:
+
+ bootlace.com hd.img
+
+ Installing GRLDR boot code to floppy under Linux:
+
+ bootlace.com --floppy --chs /dev/fd0
+
+ Installing GRLDR boot code to floppy under DOS:
+
+ bootlace.com --floppy --chs 0x00
+
+ Installing GRLDR boot code to a floppy image under DOS or Linux:
+
+ bootlace.com --floppy --chs floppy.img
+
+BOOTLACE.COM cannot function well under Windows NT/2000/XP/2003. It is expected
+(and designed) to run under DOS/Win9x and Linux. Update: For image FILES,
+bootlace.com function well under Windows NT/2000/XP/2003. For devices,
+bootlace.com will not work under Windows NT/2000/XP/2003 because bootlace.com
+is a DOS utility and Windows NT/2000/XP/2003 does not allow bootlace.com to
+access devices.
+
+******************************************************************************
+*** kexec-tools should be patched for the 1.101 release ***
+******************************************************************************
+
+The file kexec-tools-1.101-patch is a patch to the kexec-tools-1.101 release.
+Kexec might fail to load grub.exe without this patch.
+
+The home page of kexec-tools is:
+
+ http://www.xmission.com/~ebiederm/files/kexec/
+
+Note: The Linux kernel should be KEXEC enabled before kexec can be run.
+
+ !! Important Update !!
+
+The patch `kexec-tools-1.101-patch' is not needed now and has been deleted.
+Even worse, it fails in `kexec -l grub.exe --initrd=imgfile'. So please
+do not use it any more.
+
+******************************************************************************
+*** Direct transition to DOS/Win9x from within Linux ***
+******************************************************************************
+
+By using kexec, we can easily boot into DOS/Win9x from a running Linux system.
+
+If WIN98.IMG is a bootable hard-disk image, do as follows:
+
+kexec -l grub.exe --initrd=WIN98.IMG --command-line="--config-file=map (rd) (hd0); map --hook; chainloader (hd0)+1; rootnoverify (hd0)"
+
+kexec -e
+
+If DOS.IMG is a bootable floppy image, do this way:
+
+kexec -l grub.exe --initrd=DOS.IMG --command-line="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+
+kexec -e
+
+Note that in this manner, we can boot DOS/Win9x without using a real DOS/Win9x
+disk. We need no FAT partition but an image file.
+
+We have noticed that Linux itself can act as a big boot manager by using kexec
+and grub.exe. This may be convenient to developers who write installation or
+bootstrap or initialization programs.
+
+Certainly, grub.exe and the bootable disk image can also be loaded by a running
+GRUB or LILO or syslinux. Examples:
+
+1. Loaded by GRUB:
+
+ kernel (hd0,0)/grub.exe --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+ initrd (hd0,0)/DOS.IMG
+ boot
+
+2. Loaded by LILO:
+
+ image=/boot/grub.exe
+ label=grub.exe
+ initrd=/boot/DOS.IMG
+ append="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+
+3. Loaded by SYSLINUX:
+
+ label grub.exe
+ kernel grub.exe
+ append initrd=DOS.IMG --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+
+Note: If the above `map (rd) (...)' failed, you may use `map (rd)+1 (...)'
+instead and try again.
+
+******************************************************************************
+*** Keyboard BIOS Scan Code/ASCII code tables ***
+******************************************************************************
+
+Keyboard bios scan code and ascii character code tables can be obtained from
+the web by, for example, googling for "3920 372A 4A2D 4E2B 352F". Here are 2
+main results:
+
+1. From "http://heim.ifi.uio.no/~stanisls/helppc/scan_codes.html":
+
+INT 16 - Keyboard Scan Codes
+
+ Key Normal Shifted w/Ctrl w/Alt
+
+ A 1E61 1E41 1E01 1E00
+ B 3062 3042 3002 3000
+ C 2E63 2E43 2E03 2E00
+ D 2064 2044 2004 2000
+ E 1265 1245 1205 1200
+ F 2166 2146 2106 2100
+ G 2267 2247 2207 2200
+ H 2368 2348 2308 2300
+ I 1769 1749 1709 1700
+ J 246A 244A 240A 2400
+ K 256B 254B 250B 2500
+ L 266C 264C 260C 2600
+ M 326D 324D 320D 3200
+ N 316E 314E 310E 3100
+ O 186F 184F 180F 1800
+ P 1970 1950 1910 1900
+ Q 1071 1051 1011 1000
+ R 1372 1352 1312 1300
+ S 1F73 1F53 1F13 1F00
+ T 1474 1454 1414 1400
+ U 1675 1655 1615 1600
+ V 2F76 2F56 2F16 2F00
+ W 1177 1157 1117 1100
+ X 2D78 2D58 2D18 2D00
+ Y 1579 1559 1519 1500
+ Z 2C7A 2C5A 2C1A 2C00
+
+ Key Normal Shifted w/Ctrl w/Alt
+
+ 1 0231 0221 7800
+ 2 0332 0340 0300 7900
+ 3 0433 0423 7A00
+ 4 0534 0524 7B00
+ 5 0635 0625 7C00
+ 6 0736 075E 071E 7D00
+ 7 0837 0826 7E00
+ 8 0938 092A 7F00
+ 9 0A39 0A28 8000
+ 0 0B30 0B29 8100
+
+ Key Normal Shifted w/Ctrl w/Alt
+
+ - 0C2D 0C5F 0C1F 8200
+ = 0D3D 0D2B 8300
+ [ 1A5B 1A7B 1A1B 1A00
+ ] 1B5D 1B7D 1B1D 1B00
+ ; 273B 273A 2700
+ ' 2827 2822
+ ` 2960 297E
+ \ 2B5C 2B7C 2B1C 2600 (same as Alt L)
+ , 332C 333C
+ . 342E 343E
+ / 352F 353F
+
+ Key Normal Shifted w/Ctrl w/Alt
+
+ F1 3B00 5400 5E00 6800
+ F2 3C00 5500 5F00 6900
+ F3 3D00 5600 6000 6A00
+ F4 3E00 5700 6100 6B00
+ F5 3F00 5800 6200 6C00
+ F6 4000 5900 6300 6D00
+ F7 4100 5A00 6400 6E00
+ F8 4200 5B00 6500 6F00
+ F9 4300 5C00 6600 7000
+ F10 4400 5D00 6700 7100
+ F11 8500 8700 8900 8B00
+ F12 8600 8800 8A00 8C00
+
+ Key Normal Shifted w/Ctrl w/Alt
+
+ BackSpace 0E08 0E08 0E7F 0E00
+ Del 5300 532E 9300 A300
+ Down Arrow 5000 5032 9100 A000
+ End 4F00 4F31 7500 9F00
+ Enter 1C0D 1C0D 1C0A A600
+ Esc 011B 011B 011B 0100
+ Home 4700 4737 7700 9700
+ Ins 5200 5230 9200 A200
+ Keypad 5 4C35 8F00
+ Keypad * 372A 9600 3700
+ Keypad - 4A2D 4A2D 8E00 4A00
+ Keypad + 4E2B 4E2B 4E00
+ Keypad / 352F 352F 9500 A400
+ Left Arrow 4B00 4B34 7300 9B00
+ PgDn 5100 5133 7600 A100
+ PgUp 4900 4939 8400 9900
+ PrtSc 7200
+ Right Arrow 4D00 4D36 7400 9D00
+ SpaceBar 3920 3920 3920 3920
+ Tab 0F09 0F00 9400 A500
+ Up Arrow 4800 4838 8D00 9800
+
+
+- Some key combinations are not available on all systems. The PS/2
+ includes many that aren't available on the PC, XT and AT.
+- To retrieve the character from a scan code logical AND the word
+ with 0x00FF.
+- see INT 16 MAKE CODES
+
+
+
+2. From "http://www.hoppie.nl/ivan/keycodes.txt":
+
+
+
+ Keystroke Keypress code
+--------------------------------------------------
+ Esc 011B
+ 1 0231
+ 2 0332
+ 3 0433
+ 4 0534
+ 5 0635
+ 6 0736
+ 7 0837
+ 8 0938
+ 9 0A39
+ 0 0B30
+ - 0C2D
+ = 0D3D
+ Backspace 0E08
+ Tab 0F09
+ q 1071
+ w 1177
+ e 1265
+ r 1372
+ t 1474
+ y 1579
+ u 1675
+ i 1769
+ o 186F
+ p 1970
+ [ 1A5B
+ ] 1B5D
+ Enter 1C0D
+ Ctrl **
+ a 1E61
+ s 1F73
+ d 2064
+ f 2166
+ g 2267
+ h 2368
+ j 246A
+ k 256B
+ l 266C
+ ; 273B
+ ' 2827
+ ` 2960
+ Shift **
+ \ 2B5C
+ z 2C7A
+ x 2D78
+ c 2E63
+ v 2F76
+ b 3062
+ n 316E
+ m 326D
+ , 332C
+ . 342E
+ / 352F
+ Gray * 372A
+ Alt **
+ Space 3920
+ Caps Lock **
+ F1 3B00
+ F2 3C00
+ F3 3D00
+ F4 3E00
+ F5 3F00
+ F6 4000
+ F7 4100
+ F8 4200
+ F9 4300
+ F10 4400
+ F11 8500
+ F12 8600
+ Num Lock **
+ Scroll Lock **
+ White Home 4700
+ White Up Arrow 4800
+ White PgUp 4900
+ Gray - 4A2D
+ White Left Arrow 4B00
+ Center Key 4C00
+ White Right Arrow 4D00
+ Gray + 4E2B
+ White End 4F00
+ White Down Arrow 5000
+ White PgDn 5100
+ White Ins 5200
+ White Del 5300
+ SysReq **
+ Key 45 [1] 565C
+ Enter (number keypad) 1C0D
+ Gray / 352F
+ PrtSc **
+ Pause **
+ Gray Home 4700
+ Gray Up Arrow 4800
+ Gray Page Up 4900
+ Gray Left Arrow 4B00
+ Gray Right Arrow 4D00
+ Gray End 4F00
+ Gray Down Arrow 5000
+ Gray Page Down 5100
+ Gray Insert 5200
+ Gray Delete 5300
+
+ Shift Esc 011B
+ ! 0221
+ @ 0340
+ # 0423
+ $ 0524
+ % 0625
+ ^ 075E
+ & 0826
+ * (white) 092A
+ ( 0A28
+ ) 0B29
+ _ 0C5F
+ + (white) 0D2B
+ Shift Backspace 0E08
+ Shift Tab (Backtab) 0F00
+ Q 1051
+ W 1157
+ E 1245
+ R 1352
+ T 1454
+ Y 1559
+ U 1655
+ I 1749
+ O 184F
+ P 1950
+ { 1A7B
+ } 1B7D
+ Shift Enter 1C0D
+ Shift Ctrl **
+ A 1E41
+ S 1F53
+ D 2044
+ F 2146
+ G 2247
+ H 2348
+ J 244A
+ K 254B
+ L 264C
+ : 273A
+ " 2822
+ ~ 297E
+ | 2B7C
+ Z 2C5A
+ X 2D58
+ C 2E43
+ V 2F56
+ B 3042
+ N 314E
+ M 324D
+ < 333C
+ > 343E
+ ? 353F
+ Shift Gray * 372A
+ Shift Alt **
+ Shift Space 3920
+ Shift Caps Lock **
+ Shift F1 5400
+ Shift F2 5500
+ Shift F3 5600
+ Shift F4 5700
+ Shift F5 5800
+ Shift F6 5900
+ Shift F7 5A00
+ Shift F8 5B00
+ Shift F9 5C00
+ Shift F10 5D00
+ Shift F11 8700
+ Shift F12 8800
+ Shift Num Lock **
+ Shift Scroll Lock **
+ Shift 7 (number pad) 4737
+ Shift 8 (number pad) 4838
+ Shift 9 (number pad) 4939
+ Shift Gray - 4A2D
+ Shift 4 (number pad) 4B34
+ Shift 5 (number pad) 4C35
+ Shift 6 (number pad) 4D36
+ Shift Gray + 4E2B
+ Shift 1 (number pad) 4F31
+ Shift 2 (number pad) 5032
+ Shift 3 (number pad) 5133
+ Shift 0 (number pad) 5230
+ Shift . (number pad) 532E
+ Shift SysReq **
+ Shift Key 45 [1] 567C
+ Shift Enter (number pad) 1C0D
+ Shift Gray / 352F
+ Shift PrtSc **
+ Shift Pause **
+ Shift Gray Home 4700
+ Shift Gray Up Arrow 4800
+ Shift Gray Page Up 4900
+ Shift Gray Left Arrow 4B00
+ Shift Gray Right Arrow 4D00
+ Shift Gray End 4F00
+ Shift Gray Down Arrow 5000
+ Shift Gray Page Down 5100
+ Shift Gray Insert 5200
+ Shift Gray Delete 5300
+
+ Ctrl Esc 011B
+ Ctrl 1 --
+ Ctrl 2 (NUL) 0300
+ Ctrl 3 --
+ Ctrl 4 --
+ Ctrl 5 --
+ Ctrl 6 (RS) 071E
+ Ctrl 7 --
+ Ctrl 8 --
+ Ctrl 9 --
+ Ctrl 0 --
+ Ctrl - 0C1F
+ Ctrl = --
+ Ctrl Backspace (DEL) 0E7F
+ Ctrl Tab 9400
+ Ctrl q (DC1) 1011
+ Ctrl w (ETB) 1117
+ Ctrl e (ENQ) 1205
+ Ctrl r (DC2) 1312
+ Ctrl t (DC4) 1414
+ Ctrl y (EM) 1519
+ Ctrl u (NAK) 1615
+ Ctrl i (HT) 1709
+ Ctrl o (SI) 180F
+ Ctrl p (DEL) 1910
+ Ctrl [ (ESC) 1A1B
+ Ctrl ] (GS) 1B1D
+ Ctrl Enter (LF) 1C0A
+ Ctrl a (SOH) 1E01
+ Ctrl s (DC3) 1F13
+ Ctrl d (EOT) 2004
+ Ctrl f (ACK) 2106
+ Ctrl g (BEL) 2207
+ Ctrl h (Backspace) 2308
+ Ctrl j (LF) 240A
+ Ctrl k (VT) 250B
+ Ctrl l (FF) 260C
+ Ctrl ; --
+ Ctrl ' --
+ Ctrl ` --
+ Ctrl Shift **
+ Ctrl \ (FS) 2B1C
+ Ctrl z (SUB) 2C1A
+ Ctrl x (CAN) 2D18
+ Ctrl c (ETX) 2E03
+ Ctrl v (SYN) 2F16
+ Ctrl b (STX) 3002
+ Ctrl n (SO) 310E
+ Ctrl m (CR) 320D
+ Ctrl , --
+ Ctrl . --
+ Ctrl / --
+ Ctrl Gray * 9600
+ Ctrl Alt **
+ Ctrl Space 3920
+ Ctrl Caps Lock --
+ Ctrl F1 5E00
+ Ctrl F2 5F00
+ Ctrl F3 6000
+ Ctrl F4 6100
+ Ctrl F5 6200
+ Ctrl F6 6300
+ Ctrl F7 6400
+ Ctrl F8 6500
+ Ctrl F9 6600
+ Ctrl F10 6700
+ Ctrl F11 8900
+ Ctrl F12 8A00
+ Ctrl Num Lock --
+ Ctrl Scroll Lock --
+ Ctrl White Home 7700
+ Ctrl White Up Arrow 8D00
+ Ctrl White PgUp 8400
+ Ctrl Gray - 8E00
+ Ctrl White Left Arrow 7300
+ Ctrl 5 (number pad) 8F00
+ Ctrl White Right Arrow 7400
+ Ctrl Gray + 9000
+ Ctrl White End 7500
+ Ctrl White Down Arrow 9100
+ Ctrl White PgDn 7600
+ Ctrl White Ins 9200
+ Ctrl White Del 9300
+ Ctrl SysReq **
+ Ctrl Key 45 [1] --
+ Ctrl Enter (number pad) 1C0A
+ Ctrl / (number pad) 9500
+ Ctrl PrtSc 7200
+ Ctrl Break 0000
+ Ctrl Gray Home 7700
+ Ctrl Gray Up Arrow 8DE0
+ Ctrl Gray Page Up 8400
+ Ctrl Gray Left Arrow 7300
+ Ctrl Gray Right Arrow 7400
+ Ctrl Gray End 7500
+ Ctrl Gray Down Arrow 91E0
+ Ctrl Gray Page Down 7600
+ Ctrl Gray Insert 92E0
+ Ctrl Gray Delete 93E0
+
+ Alt Esc 0100
+ Alt 1 7800
+ Alt 2 7900
+ Alt 3 7A00
+ Alt 4 7B00
+ Alt 5 7C00
+ Alt 6 7D00
+ Alt 7 7E00
+ Alt 8 7F00
+ Alt 9 8000
+ Alt 0 8100
+ Alt - 8200
+ Alt = 8300
+ Alt Backspace 0E00
+ Alt Tab A500
+ Alt q 1000
+ Alt w 1100
+ Alt e 1200
+ Alt r 1300
+ Alt t 1400
+ Alt y 1500
+ Alt u 1600
+ Alt i 1700
+ Alt o 1800
+ Alt p 1900
+ Alt [ 1A00
+ Alt ] 1B00
+ Alt Enter 1C00
+ Alt Ctrl **
+ Alt a 1E00
+ Alt s 1F00
+ Alt d 2000
+ Alt f 2100
+ Alt g 2200
+ Alt h 2300
+ Alt j 2400
+ Alt k 2500
+ Alt l 2600
+ Alt ; 2700
+ Alt ' 2800
+ Alt ` 2900
+ Alt Shift **
+ Alt \ 2B00
+ Alt z 2C00
+ Alt x 2D00
+ Alt c 2E00
+ Alt v 2F00
+ Alt b 3000
+ Alt n 3100
+ Alt m 3200
+ Alt , 3300
+ Alt . 3400
+ Alt / 3500
+ Alt Gray * 3700
+ Alt Space 3920
+ Alt Caps Lock **
+ Alt F1 6800
+ Alt F2 6900
+ Alt F3 6A00
+ Alt F4 6B00
+ Alt F5 6C00
+ Alt F6 6D00
+ Alt F7 6E00
+ Alt F8 6F00
+ Alt F9 7000
+ Alt F10 7100
+ Alt F11 8B00
+ Alt F12 8C00
+ Alt Num Lock **
+ Alt Scroll Lock **
+ Alt Gray - 4A00
+ Alt Gray + 4E00
+ Alt 7 (number pad) #
+ Alt 8 (number pad) #
+ Alt 9 (number pad) #
+ Alt 4 (number pad) #
+ Alt 5 (number pad) #
+ Alt 6 (number pad) #
+ Alt 1 (number pad) #
+ Alt 2 (number pad) #
+ Alt 3 (number pad) #
+ Alt Del --
+ Alt SysReq **
+ Alt Key 45 [1] --
+ Alt Enter (number pad) A600
+ Alt / (number pad) A400
+ Alt PrtSc **
+ Alt Pause **
+ Alt Gray Home 9700
+ Alt Gray Up Arrow 9800
+ Alt Gray Page Up 9900
+ Alt Gray Left Arrow 9B00
+ Alt Gray Right Arrow 9D00
+ Alt Gray End 9F00
+ Alt Gray Down Arrow A000
+ Alt Gray Page Down A100
+ Alt Gray Insert A200
+ Alt Gray Delete A300
+
+ -------------------------------------------------------------------------
+
+Footnotes
+
+ [1] In the United States, the 101/102-key keyboard is shipped
+ with 101 keys. Overseas versions have an additional key
+ sandwiched between the left Shift key and the Z key. This
+ additional key is identified by IBM (and in this table) as
+ "Key 45."
+
+ [**] Keys and key combinations marked ** are used by the ROM BIOS
+ but do not put values into the keyboard buffer.
+
+ [--] Keys and key combinations marked -- are ignored by the ROM
+ BIOS.
+
+
+
+
+3. From "http://heim.ifi.uio.no/~stanisls/helppc/make_codes.html":
+
+
+INT 9 - Hardware Keyboard Make/Break Codes
+
+ Key Make Break Key Make Break
+
+ Backspace 0E 8E F1 3B BB
+ Caps Lock 3A BA F2 3C BC
+ Enter 1C 9C F3 3D BD
+ Esc 01 81 F4 3E BE
+ Left Alt 38 B8 F7 41 C1
+ Left Ctrl 1D 9D F5 3F BF
+ Left Shift 2A AA F6 40 C0
+ Num Lock 45 C5 F8 42 C2
+ Right Shift 36 B6 F9 43 C3
+ Scroll Lock 46 C6 F10 44 C4
+ Space 39 B9 F11 57 D7
+ Sys Req (AT) 54 D4 F12 58 D8
+ Tab 0F 8F
+
+ Keypad Keys Make Break
+
+ Keypad 0 (Ins) 52 D2
+ Keypad 1 (End) 4F CF
+ Keypad 2 (Down arrow) 50 D0
+ Keypad 3 (PgDn) 51 D1
+ Keypad 4 (Left arrow) 4B CB
+ Keypad 5 4C CC
+ Keypad 6 (Right arrow) 4D CD
+ Keypad 7 (Home) 47 C7
+ Keypad 8 (Up arrow) 48 C8
+ Keypad 9 (PgUp) 49 C9
+ Keypad . (Del) 53 D3
+ Keypad * (PrtSc) 37 B7
+ Keypad - 4A CA
+ Keypad + 4E CE
+
+ Key Make Break Key Make Break
+
+ A 1E 9E N 31 B1
+ B 30 B0 O 18 98
+ C 2E AE P 19 99
+ D 20 A0 Q 10 90
+ E 12 92 R 13 93
+ F 21 A1 S 1F 9F
+ G 22 A2 T 14 94
+ H 23 A3 U 16 96
+ I 17 97 V 2F AF
+ J 24 A4 W 11 91
+ K 25 A5 X 2D AD
+ L 26 A6 Y 15 95
+ M 32 B2 Z 2C AC
+
+ Key Make Break Key Make Break
+
+ 1 02 82 - 0C 8C
+ 2 03 83 = 0D 8D
+ 3 04 84 [ 1A 9A
+ 4 05 85 ] 1B 9B
+ 5 06 86 ; 27 A7
+ 6 07 87 ' 28 A8
+ 7 08 88 ` 29 A9
+ 8 09 89 \ 2B AB
+ 9 0A 8A , 33 B3
+ 0 0B 8B . 34 B4
+ / 35 B5
+
+
+Enhanced Keyboard Keys (101/102 keys)
+
+ Control Keys Make Break
+
+ Alt-PrtSc (SysReq) 54 D4
+ Ctrl-PrtSc E0 37 E0 B7
+ Enter E0 1C E0 9C
+ PrtSc E0 2A E0 37 E0 B7 E0 AA
+ Right Alt E0 38 E0 B8
+ Right Ctrl E0 1D E0 9D
+ Shift-PrtSc E0 37 E0 B7
+ / E0 35 E0 B5
+ Pause E1 1D 45 E1 9D C5 (not typematic)
+ Ctrl-Pause (Ctrl-Break) E0 46 E0 C6 (not typematic)
+
+ - Keys marked as "not typematic" generate one stream of bytes
+ without corresponding break scan code bytes (actually the
+ break codes are part of the make code).
+
+
+ Normal Mode or
+ Shift w/Numlock
+ Key Make Break |----- Numlock on ------.
+ Make Break
+ Del E0 53 E0 D3 E0 2A E0 53 E0 D3 E0 AA
+ Down arrow E0 50 E0 D0 E0 2A E0 50 E0 D0 E0 AA
+ End E0 4F E0 CF E0 2A E0 4F E0 CF E0 AA
+ Home E0 47 E0 C7 E0 2A E0 47 E0 C7 E0 AA
+ Ins E0 52 E0 D2 E0 2A E0 52 E0 D2 E0 AA
+ Left arrow E0 4B E0 CB E0 2A E0 4B E0 CB E0 AA
+ PgDn E0 51 E0 D1 E0 2A E0 51 E0 D1 E0 AA
+ PgUp E0 49 E0 C9 E0 2A E0 49 E0 C9 E0 AA
+ Right arrow E0 4D E0 CD E0 2A E0 4D E0 CD E0 AA
+ Up arrow E0 48 E0 C8 E0 2A E0 48 E0 C8 E0 AA
+
+ Key |--Left Shift Pressed--. |--Right Shift Pressed--.
+ Make Break Make Break
+ Del E0 AA E0 53 E0 D3 E0 2A E0 B6 E0 53 E0 D3 E0 36
+ Down arrow E0 AA E0 50 E0 D0 E0 2A E0 B6 E0 50 E0 D0 E0 36
+ End E0 AA E0 4F E0 CF E0 2A E0 B6 E0 4F E0 CF E0 36
+ Home E0 AA E0 47 E0 C7 E0 2A E0 B6 E0 47 E0 C7 E0 36
+ Ins E0 AA E0 52 E0 D2 E0 2A E0 B6 E0 52 E0 D2 E0 36
+ Left arrow E0 AA E0 4B E0 CB E0 2A E0 B6 E0 4B E0 CB E0 36
+ PgDn E0 AA E0 51 E0 D1 E0 2A E0 B6 E0 51 E0 D1 E0 36
+ PgUp E0 AA E0 49 E0 C9 E0 2A E0 B6 E0 49 E0 C9 E0 36
+ Right arrow E0 AA E0 4D E0 CD E0 2A E0 B6 E0 4D E0 CD E0 36
+ Up arrow E0 AA E0 48 E0 C8 E0 2A E0 B6 E0 48 E0 C8 E0 36
+ / E0 AA E0 35 E0 B5 E0 2A E0 B6 E0 35 E0 B5 E0 36
+
+
+ - The PS/2 models have three make/break scan code sets. The first
+ set matches the PC & XT make/break scan code set and is the one
+ listed here. Scan code sets are selected by writing the value F0
+ to the keyboard via the 8042 (port 60h). The following is a brief
+ description of the scan code sets (see the PS/2 Technical Reference
+ manuals for more information on scan code sets 2 and 3):
+
+ / set 1, each key has a base scan code. Some keys generate
+ extra scan codes to generate artificial shift states. This
+ is similar to the standard scan code set used on the PC and XT.
+ / set 2, each key sends one make scan code and two break scan
+ codes bytes (F0 followed by the make code). This scan code
+ set is available on the IBM AT also.
+ / set 3, each key sends one make scan code and two break scan
+ codes bytes (F0 followed by the make code) and no keys are
+ altered by Shift/Alt/Ctrl keys.
+ / typematic scan codes are the same as the make scan code
+
+ - Some Tandy 1000's do not handle Alt key combinations when multiple
+ shift keys are pressed. The Alt-Shift-H combination loses the Alt.
+ - extended keys like (F11, F12) can only be read with systems that
+ have extended keyboard BIOS support (or INT 9 extensions); to
+ read these special keys on these systems INT 16,10 must be used
+
+
+******************************************************************************
+*** GRLDR Error messages ***
+******************************************************************************
+
+1. Missing MBR-helper.
+
+ The helper function in the sectors that immediately follow the MBR is
+ not present, or it has been erased by a virus or by Windows XP/Vista.
+
+ Run the bootlace.com utility to fix the problem.
+
+2. Buggy BIOS!
+
+ Your BIOS is too buggy. It even has no support for INT13/AH=8.
+
+ No solution except flashing your BIOS. Buggy BIOSes will encounter
+ more and more problems with grub4dos in the future.
+
+3. This partition is NTFS but with unknown boot record. Please install
+Microsoft NTFS boot sectors to this partition correctly, or create an
+FAT12/16/32 partition and place the same copy of GRLDR and MENU.LST there.
+
+ The boot record was changed or erased by Microsoft Windows XP Service
+ Pack 2.
+
+ You may install the old boot record introduced with the original clean
+ Windows 2K/XP. As another solution, you may create an FAT partition
+ for your system, and copy GRLDR and your MENU.LST to its root dir.
+
+ While the startup code of grldr might fail to load GRLDR in NTFS
+ partitions, it always successfully loads GRLDR in FAT partitions(and
+ even in ext2/ext3 partitions).
+
+ Note that NTLDR only loads the startup code of grldr(i.e., the leading
+ 16 sectors of grldr), not the whole grldr file.
+
+ Thus, C:\GRLDR must exist(here C: can be NTFS), since it is used for
+ BOOT.INI and NTLDR. If C: is NTFS, X:\GRLDR should exist as well,
+ where X: stands for a certain FAT partition.
+
+
+******************************************************************************
+*** Known BIOS bugs ***
+******************************************************************************
+
+1. Some newer Dell machines have no int13/AH=43h support. You may encounter
+ failure when trying to write-access an emulated disk.
+
+ Note: This bug is serious! The old "root+setup" installation method
+ (in real mode grub environment) uses INT13 to write the first sector
+ of stage2. It will fail for the buggy DELL machine when stage2 is
+ accessed with LBA mode.
+
+2. Some buggy BIOSes won't boot bootable.iso(See above).(qemu can boot it fine)
+
+3. Some newer Dell machines violently destroyed the interrupt vectors for
+ hardware IRQs and will hang the machine when running GRUB.EXE
+ from DOS. You may try again with BADGRUB.EXE.
+
+4. Reports say some BIOSes will function abnormally after GRUB.EXE is started
+ by kexec of Linux. Some machines reportedly hang. Some others
+ reportedly cannot access USB drives.
+
+
+******************************************************************************
+*** Known Problems ***
+******************************************************************************
+
+1. Running GRUB.EXE from a DOS box of Windows 9x/Me could hang the
+ machine, especially for some systems with USB support. You may
+ encounter the same problem when running GRUB.EXE through KEXEC under
+ Linux.
+
+Note: You don't have to run GRUB.EXE from protected mode of Win9x, which
+ could hang the machine; Instead, you usually want to run GRUB.EXE
+ after you have done a "Restart the computer in MS-DOS mode", which
+ is safe enough.
+
+2. The default chainloader action will keep A20 on. Some buggy DOS XMS
+ memory managers could hang the machine. You may use the --disable-a20
+ option in the chainloader line and try again. Anyway, you should avoid
+ using those buggy memory managers.
+
+3. THTF BIOS L4S5M Ver 1.1a(dated 2002-1-10) has a buggy int15 which
+ causes hang at the boot of a multi boot kernel(memdisk for example).
+
+4. A Chinese DOS system software, the TechWay SCS, will not work with
+ newer versions of GRUB.EXE. In general, TSRs that take antitracking
+ measures will not work with GRUB.EXE any more.
+
+
+******************************************************************************
+*** List of binary files and their corresponding source files ***
+******************************************************************************
+
+binary file main source file other included source or binary files
+------------- ---------------- -------------------------------------
+
+bootlace.com bootlacestart.S bootlace.inc, grldrstart.S
+
+grldr grldrstart.S pre_stage2(binary, See note below)
+
+grldr.mbr mbrstart.S grldrstart.S
+
+grub.exe dosstart.S pre_stage2(binary, See note below)
+
+hmload.com hmloadstart.S
+
+-----------------------------------------------------------------------------
+
+Note: pre_stage2 is the main body of GNU GRUB and it is simply appended to
+grldrstart/dosstart in binary format to form our grldr/grub.exe.
+
+Note: The GRUB file(WITHOUT .EXE suffix) is a static-linked ELF executable
+program for Linux, normally called the GRUB Shell. The GRUB Shell is a boot-
+manager, but not a boot-loader(the "boot" command won't work in GRUB Shell).
+GRUB.EXE(with KEXEC) can be used as a bootloader running directly under Linux.
+
+******************************************************************************
+*** Memory Layout for Quiting to DOS from GRUB.EXE ***
+******************************************************************************
+
+The quit command is implemented to return to DOS in the instance that GRUB.EXE
+is started off DOS.
+
+1. Before GRUB.EXE transfers control to pre_stage2, it will copy 640KB of
+conventional memory to physical address 0x200000(i.e., 2MB), and write 4 long
+integers immediately follows the backup copy of the conventional memory:
+ At 0x2A0000: 0x50554B42, it is the "BKUP" signature.
+
+ At 0x2A0004: Gate A20 status under DOS: non-zero means A20 on;
+ zero means A20 off. Update: A20 always on, see below.
+
+ At 0x2A0008: high word is boot-CS, low word is boot-IP. The quit
+ command uses this entry point to return to DOS.
+
+ At 0x2A000C: CheckSum: the sum of all long integers in the memory
+ range from 0x200000 to 0x2A000F is 0.
+
+2. If the above memory structure is corrupted by a grub command, the quit
+command will issue an error message and refuse to exit from grub.
+
+3. Because GRUB may corrupt extended memory, you should better avoid using
+extended memory under DOS before running GRUB.EXE.
+
+4. Gate A20 will be enabled by GRUB.EXE. Hopefully this would hurt nothing.
+
+
+******************************************************************************
+*** Memory usage in conventional/low memory area ***
+******************************************************************************
+
+1. boot.c, fsys_reiserfs.c: 8K below 0x68000.
+
+2. fsys_ext2fs.c, fsys_minix.c: 1K below 0x68000.
+
+3. fsys_jfs.c: 4K + 256 bytes below 0x68000.
+
+4. fsys_reiserfs.c: 202 bytes at 0x600.
+
+5. fsys_xfs.c: 188 bytes at 0x600.
+
+6. fsys_xfs.c: (logical block size) bytes below 0x68000.
+
+7. geometry tune: 0x50000 - 0x5ffff.
+
+******************************************************************************
+*** Command-line Length about GRUB.EXE ***
+******************************************************************************
+
+GRUB.EXE now can be started in CONFIG.SYS with the **DEVICE** command:
+
+ DEVICE=grub.exe [--config-file="FILENAME_OR_COMMANDS"]
+
+1. If GRUB.EXE is invoked with DEVICE command and FILENAME_OR_COMMANDS is a
+collection of some GRUB commands separated by semi-colon, then the length of
+FILENAME_OR_COMMANDS can be nearly 4KB ----Supprise? But true! MS-DOS 7+
+even allows a much longer line, but 4KB seems enough for our use of GRUB.EXE.
+This is very useful when we want to embed a big menu into the command line.
+Note that GRLDR hasn't yet supported any command-line arguments.
+
+2. If GRUB.EXE is invoked with INSTALL command, the option length has a limit
+of 80 characters(including the leading "--config-file=" part). An overflow may
+hang up MS-DOS immediately.
+
+3. If GRUB.EXE is invoked with SHELL command, the option length has a limit of
+126 characters(including the leading "--config-file=" part). Overflow won't
+hang up MS-DOS, but the line will be cut short. This limit is the same as that
+in the console-DOS-prompt or in a BAT file.
+
+4. The DOS editor EDIT does not allow to create a line of 4KB long. So use
+another editor, for example, vi for Linux, please.
+
+5. The DEVICE=GRUB.EXE line can be used together with other DEVICE commands
+such as DEVICE=HIMEM.SYS and DEVICE=EMM386.EXE. The GRUB.EXE line should
+occur before the EMM386.EXE line in order to avoid the rejection by EMM386.
+Update: Since 0.4.2, GRUB.EXE works well even after EMM386.EXE is loaded.
+
+6. In any case mentioned above, you can return back to DOS by quit command.
+
+7. Memory usage about command-line menu: The 4KB command-line menu starts at
+physical address 0x0800 and ends at 0x17FF.
+
+******************************************************************************
+*** New Syntax for the DEFAULT/SAVEDEFAULT Commands ***
+******************************************************************************
+
+In addition to the original usage of "default NUM" and "default saved", now
+there is a new usage of "default FILE", like this:
+
+ default (hd0,0)/default
+
+Note that FILE must have a valid DEFAULT file format. A sample DEFAULT file
+is included in the release. You may copy it to wherever you like, but you
+should avoid modifying its content manually. The DEFAULT file may be used
+in this way:
+
+(1) First, you should copy a default file with valid format to somewhere in
+your operating system.
+
+(2) Secondly, you should use the "default FILE" command of GRUB to announce
+the use of FILE as our new default file for being written by "savedefault".
+
+(3) Then, you may use "savedefault" command to save the desired entry number
+into this new default file.
+
+(4) OK, at next boot, you may read the saved entry number by using the same
+"default FILE" command as mentioned in above (2).
+
+And the SAVEDEFAULT command now accept an options `--wait=T', like this:
+
+ savedefault --wait=5
+
+If `--wait=T' is specified and T is non-zero, savedefault will prompt
+the user with a message just before it writes to disk. The write operation
+will be cancelled in T seconds if the `Y' key was not pressed.
+
+Here is a sample menu.lst file:
+
+#--------------------begin menu.lst---------------------------------------
+color black/cyan yellow/cyan
+timeout 30
+default /default
+
+title find and load NTLDR of Windows NT/2K/XP
+find --set-root /ntldr
+chainloader /ntldr
+savedefault --wait=2
+
+title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
+fallback 2
+find --set-root /cmldr
+chainloader /cmldr
+#####################################################################
+# write string "cmdcons" to memory 0000:7C03 in 2 steps:
+#####################################################################
+# step 1. Write 4 chars "cmdc" at 0000:7C03
+write 0x7C03 0x63646D63
+# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
+write 0x7C07 0x00736E6F
+savedefault --wait=2
+
+title find and load IO.SYS of Windows 9x/Me
+find --set-root /io.sys
+chainloader /io.sys
+savedefault --wait=2
+
+title floppy (fd0)
+chainloader (fd0)+1
+rootnoverify (fd0)
+savedefault --wait=2
+
+title find and boot Linux with menu.lst already installed
+find --set-root /sbin/init
+savedefault --wait=2
+configfile /boot/grub/menu.lst
+
+title find and boot Mandriva with menu.lst already installed
+find --set-root /etc/mandriva-release
+savedefault --wait=2
+configfile /boot/grub/menu.lst
+
+title back to dos
+savedefault --wait=2
+quit
+
+title commandline
+savedefault --wait=2
+commandline
+
+title reboot
+savedefault --wait=2
+reboot
+
+title halt
+savedefault --wait=2
+halt
+#--------------------end menu.lst---------------------------------------
+
+Note 1: The file DEFAULT must exist and have a proper format as stated above.
+ Or else, the default/savedefault commands won't function well.
+
+Note 2: The file DEFAULT which is in the same dir as a certain MENU.LST file
+ is called associated with the MENU.LST file.
+
+Note 3: The associated DEFAULT file will take effect automatically if there
+ are no `default' commands present.
+
+Note 4: Just before a menu file gains control(e.g., it is the associated
+ MENU.LST of a GRLDR file, or it was specified via
+ `grub.exe --config-file=(DEVICE)/PATH/YOUR_MENU_FILE', or it was
+ specified by the `configfile' command of grub), its associated
+ DEFAULT file will be used if present, until an explicit `default'
+ command is encountered.
+
+******************************************************************************
+*** The New `cdrom' Command Syntax ***
+******************************************************************************
+
+1. Initialize the ATAPI CDROM devices:
+
+ grub> cdrom --init
+
+ This will display the number of atapi cdroms found: atapi_dev_count
+
+2. Stop the ATAPI CDROM devices:
+
+ grub> cdrom --stop
+
+ This will set atapi_dev_count to 0.
+
+3. Add IO ports for searching the atapi cdrom devices. For example:
+
+ grub> cdrom --add-io-ports=0x03F601F0
+
+After running `cdrom --init' and `map --hook', the cdroms can be accessed
+through devices (cd0), (cd1), ...
+
+Note 1: If the system does not fully support the ATAPI CD-ROM specifications,
+ you will encounter failure when trying to access the (cdX) devices.
+
+Note 2: After doing a `cdrom --stop', you should do a `map --unhook'. Of
+ course you may `map --hook' again if there are mapped drives.
+
+Note 3: After adding IO ports, you should do a `map --unhook' followed by a
+ `cdrom --init' and then followed by a `map --hook'.
+
+ By default, these ports are used for searching cdroms(so they needn't
+ be added):
+
+ 0x03F601F0, 0x03760170, 0x02F600F0,
+ 0x03860180, 0x6F006B00, 0x77007300.
+
+Note 4: The BIOS might have offered a cdrom interface. It would be (cd). After
+ `cdrom --init' and `map --hook', we might have our (cd0), (cd1), ...
+ available. It is likely that one of them could access the same media
+ as the BIOS-offered (cd).
+
+Note 5: You may access the (cd) and (cdX)'es in the blocklist way. Example:
+
+ cat --hex (cd0)16+2
+
+ The cdrom sectors are big sectors with a size of 2048 bytes.
+
+Note 6: The iso9660 filesystem driver has Rock-Ridge extension support, but
+ has no Joliet extension support. So you may encounter failure when
+ you attempt to read files on a Joliet CD.
+
+Note 7: The (cd) or (cdX)'es can be booted now. Examples:
+
+ chainloader (cd)
+ boot
+
+ chainloader (cd0)
+ boot
+
+ chainloader (cd1)
+ boot
+
+ You should already have access to the CD sectors before you can
+ chainload it.
+
+******************************************************************************
+*** About the New `setvbe' Command ***
+******************************************************************************
+
+Gerardo Richarte contributed the `setvbe' code and the following comment:
+
+ New command is `setvbe', and can be used to change the video mode
+ before executing the kernel.
+
+ For example, you can do
+
+ setvbe 1024x768x32
+
+ this will scan the list of available modes and set it, and
+ automatically append a `video=' option to each subsequent kernel
+ command-line. The appended `video=' option is like this:
+
+ video=1024x768x32@0xf0000000,4096
+
+ where 0xf0000000 is the video framebuffer address as reported by vbe,
+ and 4096 is the size of a scanline in bytes (also as reported by vbe).
+
+ This is really useful if you want to give some graphics support to your
+ OS, but you don't want to implement any video functionality other than
+ writing a pixel to video memory.
+
+
+******************************************************************************
+*** About the DOS utility `hmload' ***
+******************************************************************************
+
+This program was written by John Cobb (Queen Mary, University of London).
+
+John Cobb's note:
+
+ To make use of the ram drive feature I wrote a program `hmload' to load
+ an arbitrary file to an arbitrary address in high memory. The program
+ is not very sophisticated and relies on XMS to turn on the A20 line.
+ (Also one must be very careful to steer clear of any areas of memory
+ already in use).
+
+ Under Linux we generated a disk image `dskimg' (with the kernel and
+ Initrd and a partition table).
+
+ Using this our boot procedure looked something like this:
+
+ hmload -fdskimg -a128
+ fixrb
+ <unload network drivers>
+ grub
+
+ map --ram-drive=0x81
+ map --rd-base=0x8000000
+ map --rd-size=0x400000
+ root (rd,0)
+ kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
+ initrd /initrd
+ boot
+
+See http://sysdocs.stu.qmul.ac.uk/sysdocs/Comment/GrubForDOS/ for details.
+
+Update 2007-12-05:
+
+ Now the MAP command can handle gzipped (rd) image. One can use this
+ feature with the hmload utility. For example,
+
+ step 1. Load the gzipped image under DOS at a relatively low address:
+
+ hmload -fdskimg.gz -a16
+
+ step 2. Unload network drivers.
+
+ step 3. Run GRUB.EXE.
+
+ step 4. At the grub prompt, run these commands:
+
+ map --rd-base=0x1000000 # set rd-base address to be 16M
+ map --rd-size=<the accurate size of dskimg.gz in bytes>
+ map (rd)+1 (hd0) # This will decompress (rd) and place
+ # the decompressed image at the top end
+ # of the extended memory. The (rd)+1
+ # here has special meaning and stands
+ # for the whole (rd) device. You must
+ # use (rd)+1 instead of (rd).
+ map --hook
+ root (hd0,0)
+ kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
+ initrd /initrd
+ map --unhook
+ map (hd0) (hd0) # Delete the map; this is needed.
+ boot
+
+
+******************************************************************************
+*** Notes on the use of stack ***
+******************************************************************************
+
+The protected-mode and real-mode stack are merged at physical address 0x2000.
+
+All functions should use at most 2K stack space(0x1800-0x2000). So each
+subfunction should use as little stack as possible to avoid stack-overflow.
+
+Don't use recursive functions because they could expend too much stack space.
+
+The original protected mode stack at 0x68000(expand-down) is free now and can
+be reused for any purposes.
+
+
+******************************************************************************
+*** A bug was found in the CDROM driver ***
+******************************************************************************
+
+It seems the cdrom must be connected as the master device of an IDE controller.
+
+If cdrom is slave, the driver will fail to read the cdrom sectors. Hope someone
+
+could fix this problem.
+
+
+******************************************************************************
+*** BIOS and the (cd) drive ***
+******************************************************************************
+
+When BIOS boots a no-emulation-mode bootable CD-ROM, it allocates a BIOS drive
+number to the CD. If the boot image of the CD-ROM is grldr or stage2_eltorito,
+then GRUB can access the CD-ROM media through the drive number allocated by
+BIOS. The device name of the CD-ROM is (cd).
+
+BIOS can allocate a BIOS drive number to a no-emulation-mode CDROM even when
+the CDROM is not bootable. QEMU has done so. At boot time, GRUB4DOS will
+search drives 0x80-0xFF for a possible no-emulation-mode CDROM drive allocated
+by BIOS. So if BIOS offered a CDROM interface of int13 EBIOS functions 41h-4Eh,
+then the (cd) device will be automatically available in GRUB4DOS.
+
+
+******************************************************************************
+*** The way of disk emulation changed greatly ***
+******************************************************************************
+
+The way of disk emulation has changed greatly since 0.4.2 final. Please don't
+mix newer versions with older versions when disk emulation features are used.
+
+The newer versions won't automatically unhook emulations established in a
+previous grub4dos environment. The GRUB.EXE of an older version will
+automatically dismiss emulations established earlier, before transferring
+control to the main grub program(i.e., pre_stage2).
+
+
+******************************************************************************
+*** FreeDOS EMM386 v2.26 (2006-08-27) VCPI problem ***
+******************************************************************************
+
+The VCPI function "AX=DE0Ch - Switch From Protected Mode to V86 Mode" of
+FreeDOS EMM386 v2.26 was not implemented properly(it always hangs). As an
+alternative, you can use Microsoft's EMM386 instead.
+
+Even while emm386 is running, grub.exe can be started. But if you try to quit
+to DOS from grub4dos by using the `quit' command, the VCPI function DE0C will
+be called. If EMM386 is of Microsoft, everything goes ok. If EMM386 is of
+FreeDOS, the machine will hang.
+
+
+******************************************************************************
+*** New options for map were added ***
+******************************************************************************
+
+Along with 0.4.2 final, there are two new options for the map command. They
+are --safe-mbr-hook=SMH and --int13-scheme=SCH. Both are related with disk
+emulation for use(as smoothly as possible) in the Win9x environment.
+
+SMH can take either of the two values 0 and 1. By default, SMH is 1. If you
+encountered problems of disk emulation under Win9x, you may insert a line of
+
+ map --safe-mbr-hook=0
+
+before the `boot' command and try again.
+
+Also SCH may take either 0 or 1 at present. By default, SCH is 1. If you
+encountered disk emulation problems under Win9x, you may insert a line of
+
+ map --int13-scheme=0
+
+before the `boot' command and try again.
+
+Note by the way. Like --safe-mbr-hook and --int13-scheme, the MAP command has
+a few other options that are used for setting global variables. They are here:
+
+ map --floppies=M
+
+M can be 0, 1, or 2. MAP will set a proper value at 0040:0010 by using M.
+
+ map --harddrives=N
+
+N can be between 0 and 127(inclusive). MAP will set 0040:0075 to N.
+
+ map --memdisk-raw=RAW
+
+RAW default to 1. If RAW=0, `int15/ah=87h' will be used to access memdrives.
+
+ map --ram-drive=RD
+
+RD default to 0x7F which is a floppy. If the RAM DRIVE is a hard drive image
+(with partition table in the first sector), you should set RD >= 0x80 and RD
+< 0xA0.If the RAM DRIVE is a cdrom image, you should set 0xA0<= RD <= 0xff.
+
+ map --rd-base=ADDR
+
+ map --rd-size=SIZE
+
+ADDR specifies the physical base address of the ramdisk image. SIZE specifies
+the size in bytes of the ramdisk image. ADDR default to 0. SIZE is also default
+to 0, but a size of 0 means 4GB, not a zero-long disk. The RAM DRIVE can be
+accessed in the GRUB environment using the (rd) device.
+
+
+******************************************************************************
+*** About the new map option --in-situ ***
+******************************************************************************
+
+--in-situ is used with hard drive images or hardrive partitions. With an
+in-situ map, we can typically use a logical partition as a primary partition.
+
+In-situ map is a whole drive map. It only virtualize the partition table and
+the number of hidden sectors in the BPB of the DOS Boot Record.
+
+While disk emulation may encounter various problems with win9x, the in-situ map
+works fine with win9x.
+
+Note that --in-situ will not change the real partition table.
+
+Example:
+
+ map --in-situ (hd0,4)+1 (hd0)
+
+
+******************************************************************************
+*** The PARTNEW Command Syntax ***
+******************************************************************************
+
+Besides the mappings in the above section, you may instead choose to create a
+new primary partition with the PARTNEW command. PARTNEW can generate a primary
+partition entry (in the partition table) for a logical partition.
+
+For example,
+
+ partnew (hd0,3) 0x07 (hd0,4)+1
+
+where the file (hd0,4)+1 stands for the whole partition (hd0,4). This command
+will create a new primary partition (hd0,3) whose type is 0x07 and whose
+contents/data is the same as that of the logical partition (hd0,4).
+
+Just like a whole logical partition, a contiguous partition image file can
+also be used with PARTNEW:
+
+ partnew (hd0,3) 0x00 (hd0,0)/my_partition.img
+
+The type 0x00 indicates a type-auto-detection of the image MY_PARTITION.IMG.
+The above command will create a new primary partition (hd0,3) with a proper
+type and with contents/data being exactly that of the contiguous file
+(hd0,0)/my_partition.img.
+
+PARTNEW will automatically correct the "hidden sectors" in the BPB and the
+modification will be permanent. And PARTNEW modifies the partition table
+permanently.
+
+In addition to creating new partition entries, PARTNEW can also be used to
+delete(erase, or wipe) a primary partition entry. For example,
+
+ partnew (hd0,3) 0 0 0
+
+which will empty the last entry in the partition table in MBR. Generally,
+you should use the form of "partnew PARTITION 0 0 0" to erase the entry.
+Note that only the entry would be erased, and the data stored in the partition
+will not be touched.
+
+******************************************************************************
+*** Newly implemented operators `&&' and `||' ***
+******************************************************************************
+
+This implementation is very simple. It does not handle operator nesting.
+
+Usage of `&&':
+
+ command1 && command2
+
+Description:
+
+ If command1 returns true, then command2 will be executed.
+
+Usage of `||':
+
+ command1 || command2
+
+Description:
+
+ If command1 returns false, then command2 will be executed.
+
+Examples:
+
+ is64bit && default 0
+ is64bit || default 1
+
+2010-11-04
+ Add new operators "|", ">" , ">>"
+Usage:
+ command1 | command2
+
+ command > file
+ or
+ command >> file
+
+Node: The file must already exist, GRUB4DOS can not create file or change the file size.
+Examples:
+ cat /test.txt > /abcd.txt
+
+
+******************************************************************************
+*** Three new commands is64bit, errnum and errorcheck ***
+******************************************************************************
+
+is64bit and errnum retrieve the value of is64bit and errnum respectively.
+
+errorcheck controls whether or not the error will be handled. By default,
+errorcheck is on, and menu script execution will stop on error. If errorcheck
+is off, the script will continue to execute upto a boot command. A boot command
+will turn the errorcheck on.
+
+
+******************************************************************************
+*** Use numeric keys to select a menu entry ***
+******************************************************************************
+
+If, for example, you intend to goto entry #25, you may press 2 followed by 5.
+
+
+******************************************************************************
+*** Use the INSERT key to debug step by step at startup ***
+******************************************************************************
+
+Some buggy machines could fail to enter grub4dos environment. They might hang
+or reboot unexpectedly. Press INSERT as quickly as possible on startup, and
+you can get a chance to single-step the boot process and see how far it can
+go, and then report bugs.
+
+
+******************************************************************************
+*** The debug command syntax has been changed ***
+******************************************************************************
+
+The DEBUG command now can be used to control the verbosity of command output:
+
+ debug [ on | off | normal | status | INTEGER ]
+
+0 or off for silent
+1 or normal for normal
+2 to 0x7FFFFFFF or on for verbose
+
+
+******************************************************************************
+*** GRUB4DOS and Windows Vista ***
+******************************************************************************
+
+First, use the following command to create a boot entry:
+
+ bcdedit /create /d "GRUB for DOS" /application bootsector
+
+The result will look like this:
+
+The entry {05d33150-3fde-11dc-a457-00021cf82fb0} was successfully created.
+
+The long string {05d33150-3fde-11dc-a457-00021cf82fb0} is the id for this
+entry.
+
+Then, use the following commands to set boot parameters:
+
+ bcdedit /set {id} device boot
+ bcdedit /set {id} path \grldr.mbr
+ bcdedit /displayorder {id} /addlast
+
+Please replace {id} with the actual id returned from the previous command.
+
+Finally, copy GRLDR.MBR to C:\ or wherever your boot drive is, and copy GRLDR
+and menu.lst to the root directory of any FAT16/FAT32/EXT2/NTFS partition.
+
+Note: A boot partition should be the active primary partition with BOOTMGR
+ inside. The `device boot' indicates grldr.mbr should be in the boot
+ partition.
+
+Lianjiang has written down a script to automate the tasks:
+
+ @echo off
+ rem by lianjiang
+ cls
+ echo.
+ echo Please run as administrator
+ echo.
+ pause
+ set gname=GRUB for DOS
+ set vid=
+ set timeout=5
+ bcdedit >bcdtemp.txt
+ type bcdtemp.txt | find "\grldr.mbr" >nul && echo. && echo BCD entry existing, no need to install. && pause && goto exit
+ bcdedit /export "Bcd_Backup" >nul
+ bcdedit /create /d "%gname%" /application bootsector >vid.ini
+ for,/f,"tokens=2 delims={",%%i,In (vid.ini) Do (
+ set vida=%%i
+ )
+ for,/f,"tokens=1 delims=}",%%i,In ("%vida%") Do (
+ set vid={%%i}
+ )
+ echo %vid%>vid.ini
+ bcdedit /set %vid% device boot >nul
+ bcdedit /set %vid% path \grldr.mbr >nul
+ bcdedit /displayorder %vid% /addlast >nul
+ bcdedit /timeout %timeout% >nul
+ if exist grldr.mbr copy grldr.mbr %systemdrive%\ /y && goto exit
+ echo.
+ echo Please copy grldr.mbr to %systemdrive%\
+ echo.
+ pause
+ :exit
+ del bcdtemp.txt >nul
+-------------------------------------------------------------------
+Update: Fujianabc pointed out that
+
+ bcdedit /set %vid% device boot >nul
+
+should be changed to
+
+ bcdedit /set %vid% device partition=%SystemDrive% >nul
+-------------------------------------------------------------------
+
+You still need to copy grldr yourself.
+
+Notice: It's possible to modify the BCD entry from a different OS, you just
+need to specify the location of BCD:
+
+ bcdedit /store D:\boot\BCD ...
+
+Notice: These commands need elevated privileges, they should be used inside
+cmd.exe which is started with "Run as administrator".
+
+Notice: People has reported that some version of Vista doesn't support
+creating file in C:\ with no extension, even with administrator privileges.
+This means grldr can't be placed in C:\. You can solve this by either copy
+grldr to another partition, or rename grldr to something like grub.bin. Please
+see the following section on how to do this.
+
+
+******************************************************************************
+*** How to rename grldr ***
+******************************************************************************
+
+grldr and grldr.mbr use internal boot file name to decide which file to load,
+so if you want to change the name, you must also change the embeded setting.
+You can do this with the help of grubinst, which can be downloaded at:
+
+http://download.gna.org/grubutil/
+
+grubinst can generate customized grldr.mbr:
+
+ grubinst -o -b=mygrldr C:\mygrldr.mbr
+
+grubinst can also edit existing grldr/grldr.mbr:
+
+ grubinst -e -b=mygrldr C:\mygrldr
+
+ grubinst -e -b=mygrldr C:\mygrldr.mbr
+
+In this case, you must use a grubinst that is compatible with the version of
+grub4dos, otherwise the edit will fail.
+
+So, in order to load mygrldr instead of grldr, you can use one of the
+following methods:
+
+1. Use customized grldr.mbr to load mygrldr. In this case, you need to change
+the embeded boot file name in grldr.mbr. The name of grldr.mbr can be changed
+at will.
+
+2. Use mygrldr directly. In this case, you need to change the embeded boot
+file name in mygrldr to match its new name.
+
+Notice: The boot file name must conform to the 8.3 naming convention.
+
+
+******************************************************************************
+*** PXE device ***
+******************************************************************************
+
+If PXE service is found at startup, GRUB4DOS will create a virtual device
+(pd), through which files from the tftp server can be accessed. You can setup
+a diskless boot environment using the following steps:
+
+Client side
+
+You need to boot from PXE ROM.
+
+Server side
+
+You need to configure a dhcp server and a tftp server. In the dhcp server, use
+grldr as boot file.
+
+You may also want to load a different menu.lst for different client. GRUB4DOS
+will scan the following location for configuration file:
+
+ [/mybootdir]/menu.lst
+ [/mybootdir]/menu.lst/01-88-99-AA-BB-CC-DD
+ [/mybootdir]/menu.lst/C000025B
+ [/mybootdir]/menu.lst/C000025
+ [/mybootdir]/menu.lst/C00002
+ [/mybootdir]/menu.lst/C0000
+ [/mybootdir]/menu.lst/C000
+ [/mybootdir]/menu.lst/C00
+ [/mybootdir]/menu.lst/C0
+ [/mybootdir]/menu.lst/C
+ [/mybootdir]/menu.lst/default
+
+Here, we assume the network card mac for the client machine is
+88:99:AA:BB:CC:DD, and the ip address is 192.0.2.91 (C000025B). /mybootdir is
+the directory of the boot file, for example, if boot file is /tftp/grldr, then
+mybootdir=tftp.
+
+If none of the above files is present, grldr will use its embeded menu.lst.
+
+This is a menu.lst to illustrate how to use files from the tftp server.
+
+ title Create ramdisk using map
+ map --mem (pd)/floppy.img (fd0)
+ map --hook
+ rootnoverify (fd0)
+ chainloader (fd0)+1
+
+ title Create ramdisk using memdisk
+ kernel (pd)/memdisk
+ initrd (pd)/floppy.img
+
+You can see that the menu.lst is very similar to normal disk boot, you just
+need to replace device like (hd0,0) with (pd).
+
+There are some differences between disk device and pxe device:
+
+1. You can't list files in the pxe device.
+
+2. The blocklist command will not work with a file in the pxe device.
+
+3. You must use --mem option if you want to map a file in the pxe device.
+
+When you use chainloader to load file from the pxe device, there is a option
+you can use:
+
+ chainloader --raw (pd)/BOOT_FILE
+
+Option --raw works just like --force, but it load file in one go. This can
+improve performance in some situation.
+
+You can use the pxe command to control the pxe device.
+
+1. pxe
+
+ If used without any parameter, pxe command will display current
+ settings.
+
+2. pxe blksize N
+
+ Set the packet size for tftp transmission. Minimum value is 512,
+ maximum value is 1432. This parameter is used primarily for very old
+ tftp server where packet larger than 512 byte is not supported.
+
+3. pxe basedir /dir
+
+ Set the base directory for files in the tftp server. If
+
+ pxe basedir /tftp
+
+ then all files in the pxe device is related to directory /tftp, for
+ example, (pd)/aa.img correspond to /tftp/aa.img in the server.
+
+ The default value of base directory is the directory of the boot file,
+ for example, if boot file is /tftp/grldr, then default base directory
+ is /tftp.
+
+4. pxe keep
+
+ Keep the PXE stack. The default behaviour of GRUB4DOS is to unload
+ the PXE stack just before it exits.
+
+5. pxe unload
+
+ Unload the PXE stack immediately.
+
+
+
+******************************************************************************
+*** New Feature of Relative Path Support ***
+******************************************************************************
+
+Use the `root' or `rootnoverify' command to specify the `working directory'.
+
+For example:
+
+ root (hd0,0)/boot/grub
+
+This specifies that the working dir is (hd0,0)/boot/grub. So all subsequent
+filenames of the form "/..." will actually refer to (hd0,0)/boot/grub/...
+
+That is to say:
+
+ cat /menu.lst
+
+will be equivalent to
+
+ cat (hd0,0)/boot/grub/menu.lst
+
+
+
+******************************************************************************
+*** Notation For The Current Root Device ***
+******************************************************************************
+
+
+The notation `()' can be used to access the current root device. You may use
+`find --set-root ...' to set the current root device, but the find command
+does not set the `working dir' of the root device. In this case you should
+use `()' to set the working dir after the find command:
+
+ root ()/boot/grub
+
+Update 2008-05-01:
+
+ FIND can also set the `working directory' now. For example:
+
+ find --set-root=/tmp /boot/grub/menu.lst
+
+ It is equivalent to this pair of commands:
+
+ find --set-root /boot/grub/menu.lst
+ root ()/tmp
+
+
+******************************************************************************
+*** The new map option --a20-keep-on ***
+******************************************************************************
+
+
+Along with 0.4.3 final, map has a new option --a20-keep-on which is related to
+A20 control after a memdrive sector access. Usage:
+
+ map --a20-keep-on=0
+
+It should be used before the "map --hook" command.
+
+By default, A20 will be always on after an RAM INT13 sector access. If
+"map --a20-keep-on=0" is used, the A20 status after the INT13 call will be the
+same as that before the INT13 call.
+
+
+******************************************************************************
+*** The CDROM emulation (virtualization) ***
+******************************************************************************
+
+The CDROM emulation is sometimes called ISO emulation. Here is an example:
+
+ map (hd0,0)/myiso.iso (hd32)
+ map --hook
+ chainloader (hd32)
+ boot
+
+if myiso.iso is not contiguous and you have enough memory, add a --mem option:
+
+ map --mem (hd0,0)/myiso.iso (hd32)
+ map --hook
+ chainloader (hd32)
+ boot
+
+Note: (hd32) is a grub drive number equivalent to (0xA0). If a virtual drive is
+specified with a drive number greater than or equal to 0xA0, then it will be
+treated as a cdrom (i.e., with 2048-byte big sectors).
+
+Like normal disk emulations, the CDROM emulation also (mainly) works with
+real-mode OSes. After a protected-mode OS kernel (such as
+WinNT/2K/XP/VISTA/LINUX) gains control, the OS would have no ability to access
+the virtual CDROM through BIOS int13.
+
+DOS/Win9x users may google for ELTORITO.SYS and use it in CONFIG.SYS as a
+device driver for the virtual cdrom.
+
+Example usage of eltorito.sys in CONFIG.SYS:
+
+ device=eltorito.sys /D:oemcd001
+
+Corresponding MSCDEX command which can be placed in AUTOEXEC.BAT:
+
+ MSCDEX /D:oemcd001 /L:D
+
+
+Due to some bugs found in eltorito.sys, the driver could fail to load. If you
+encounter such problems, then you may replace (hd32) with (0xFF) for the
+virtual cdrom drive number and try again.
+
+
+******************************************************************************
+*** The New Command CHECKRANGE ***
+******************************************************************************
+
+Checkrange checks whether or not the return value of a command is in the
+specified range or ranges.
+
+Usage: checkrange RANGE COMMAND
+
+Here are some examples for RANGE:
+
+ 3 is a range containing only the number 3
+ 3:3 is equivalent to 3
+ 3:8 is a range containing the numbers 3, 4, 5, 6, 7, 8
+ 3,4,5,6,7,8 is equivalent to 3:8
+ 3:5,6:8 is also equivalent to 3:8
+ 3,4:7,8 is also equivalent to 3:8
+
+Note: You should not insert spaces into a range.
+
+Here is an example showing where the checkrange can be used:
+
+ checkrange 0x05,0x0F,0x85 parttype (hd0,1) || hide (hd0,1)
+
+which means: if (hd0,1) is not an extended partition, then hide it.
+
+
+******************************************************************************
+*** The New Command TPM ***
+******************************************************************************
+
+The "tpm --init" uses 512-byte data at 0000:7C00 as buffer to initialise TPM.
+
+Before you boot VISTA's BOOTMGR, you might have to use the "tpm --init"
+command on some machines. Normally you want to issue the "tpm --init" command
+after a CHAINLOADER command.
+
+
+******************************************************************************
+*** Delimitors or comments between titles ***
+******************************************************************************
+
+It is possible to use titles as delimitors or comments. A title(or menu item)
+is called unbootable if all of its menu commands are not boot-sensitive.
+
+The following commands are boot-sensitive(and others are not boot-sensitive):
+
+ boot
+ bootp
+ chainloader
+ configfile
+ embed
+ commandline
+ halt
+ install
+ kernel
+ pxe
+ quit
+ reboot
+ setup
+
+An unbootable title will be skipped when the user presses the Up Arrow or Down
+Arrow keys. Even the unbootable menu item can get accessed(and executed) by
+using the Left Arrow and/or Right Arrow keys. Examples:
+
+ title This is an UNBOOTABLE entry(so this line is also a comment)
+ pause --wait=0 This title is a comment. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ help
+ help root
+ help chainloader
+ help parttype
+ clear
+ title ------------------------------------------------------------
+ pause --wait=0 This title is a delimitor. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ clear
+ help
+ help boot
+ title ============================================================
+ pause --wait=0 This title is a delimitor. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ help
+ clear
+ help pause
+ title ************************************************************
+ pause --wait=0 This title is a delimitor. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ help kernel
+ help
+ clear
+
+Note: An unbootable menu item must contain at least one command. If there
+are no commands for a title, the title will be simply discarded and disappear.
+
+
+******************************************************************************
+*** Bifurcate drives ***
+******************************************************************************
+
+Some machines apply different actions to a drive between CHS and LBA mode.
+When you read sectors using standard BIOS call int13/AH=02h, you might find
+out the drive is a floppy. But when you read sectors using extended BIOS
+call(EBIOS) int13/AH=42h, you could know the drive is a cdrom. Such a drive
+is called bifurcate.
+
+A bifurcate drive can have two drive numbers: one is the normal BIOS drive
+number between 00 and FF in hexa, and this drive uses only CHS mode disk
+access(standard BIOS int13/AH=02h); the other is the normal BIOS drive number
+(Bitwise) OR'ed by 0x100(i.e., 256 in decimal), and this drive uses only
+LBA mode disk access(EBIOS int13/AH=42h). For example, if the drive 0x00
+(i.e., the first floppy) is bifurcate, then the drive (0x00) uses CHS mode
+to access its sectors, and the drive (0x100) uses LBA (meaning EBIOS) mode
+to access its sectors.
+
+The geometry command can report the disk access mode for bifurcate drives as
+BIF instead of the conventional CHS or LBA.
+
+Known bifurcate drives. Virtual PC and some real machines are found to create
+a bifurcate floppy drive when they boot from a floppy-emulation mode bootable
+cdrom. The "geometry (fd0)" will show
+
+ drive 0x00(BIF): C/H/S=...Sector Count/Size=.../512
+
+and "geometry (0x100)" will show
+
+ drive 0x100(BIF): C/H/S=...Sector Count/Size=.../2048
+
+Actually (0x100) can access the whole cdrom, you may "ls (0x100)/" and find
+your files on the cdrom(not the files inside the booted floppy image). Of
+course "ls (fd0)/" will list the files inside the booted floppy image.
+
+Note that only some (real or virtual) machines have this action, others
+will not produce bifurcate drives.
+
+
+******************************************************************************
+*** GRLDR as PXE boot file ***
+******************************************************************************
+
+GRLDR can be used as the PXE boot file on a remote/network server. The (pd)
+device is used to access files on the server. When GRLDR is booted through
+network, it will use its preset menu as the config file. However, you may use
+a "pxe detect" command, which acts this way:
+
+ * First, it will search for the config file "menu.lst" in the same dir as
+ grldr.
+
+ * Second, it will search for the config file using the hardware type (using
+ its ARP type code) and address, all in hexadecimal with dash separators;
+ for example, for an Ethernet (ARP type 1) with address 88:99:AA:BB:CC:DD
+ it would search for the filename 01-88-99-AA-BB-CC-DD.
+
+ * Next, it will search for the config file using its own IP address in
+ upper case hexadecimal, e.g. 192.0.2.91 -> C000025B. If that file is not
+ found, it will remove one hex digit and try again. At last, it will try
+ looking for a file named default (in lower case). As an example, if the
+ boot file name is /mybootdir/grldr, the Ethernet MAC address is
+ 88:99:AA:BB:CC:DD and the IP address 192.0.2.91, it will try following
+ files (in that order):
+
+ /mybootdir/menu.lst
+ /mybootdir/menu/01-88-99-AA-BB-CC-DD
+ /mybootdir/menu/C000025B
+ /mybootdir/menu/C000025
+ /mybootdir/menu/C00002
+ /mybootdir/menu/C0000
+ /mybootdir/menu/C000
+ /mybootdir/menu/C00
+ /mybootdir/menu/C0
+ /mybootdir/menu/C
+ /mybootdir/menu/default
+
+You cannot directly map an image file on (pd). You must map it in memory using
+the --mem option. For example,
+
+ map --mem (pd)/images/floppy.img (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ boot
+
+One more example,
+
+ map --mem (pd)/images/cdimage.iso (0xff)
+ map --hook
+ chainloader (0xff)
+ boot
+
+
+******************************************************************************
+*** New program badgrub.exe ***
+******************************************************************************
+
+The new program badgrub.exe is intended to serve 'bad' machines(typically some
+DELL models) that cannot run the normal grub.exe.
+
+
+******************************************************************************
+*** Conditional find ***
+******************************************************************************
+
+The new find syntax allows to find a device conditionally.
+
+ find [OPTIONS] [FILENAME] [CONDITION]
+
+CONDITION is a normal grub command which returns TRUE or FALSE.
+
+OPTIONS:
+ --set-root set the current root device.
+ --set-root=DIR set current root device and working directory to DIR.
+ please also see "Notation For The Current Root Device".
+ --ignore-cd skip search on (cd).
+ --ignore-floppies bypass all floppies.
+ --devices=DEVLIST specify the search devices and order.
+ DEVLIST u->(ud)
+ n->(nd)
+ p->(pd)
+ h->(hdx)
+ c->(cd)
+ f->(fdx)
+ default: upnhcf
+
+ Example 1:
+
+ find
+
+ This will list all partitions, all floppies and the (cd).
+
+ Example 2:
+
+ find +1
+
+ This will list all devices with a known filesystem.
+
+ Example 3:
+
+ find checkrange 0xAF parttype
+
+ This will list all partitions with ID=0xAF.
+
+ Example 4:
+
+ find /ntldr checkrange 0x07 parttype
+
+ This will list all partitions with ID=0x07 and existing /ntldr.
+
+ Example 5:
+ find --set-root /ntldr
+ This will set the first device it finds to current root device.
+
+ Example 6:
+ find --set-root --devices=h /bootmgr
+ Same of Example 5.but search on hard disk only.
+
+ Example 7:
+ find --set-root --devices=h makeactive --status
+ This will set current root device to first active partition.
+
+******************************************************************************
+*** How to build grldr boot images ***
+******************************************************************************
+
+1. build 1.44M floppy image ext2grldr.img
+
+ dd if=/dev/zero of=ext2grldr.img bs=512 count=2880
+ mke2fs ext2grldr.img
+ mkdir ext2tmp
+ mount -o loop ext2grldr.img ext2tmp
+ cp default ext2tmp
+ cp menu.lst ext2tmp
+ cp grldr ext2tmp
+ umount ext2tmp
+ bootlace.com --floppy --chs --sectors-per-track=18 --heads=2 --start-sector=0 --total-sectors=2880 ext2grldr.img
+
+2. build 1.44M floppy image fat12grldr.img
+
+ dd if=/dev/zero of=fat12grldr.img bs=512 count=2880
+ mkdosfs fat12grldr.img
+ mkdir fat12tmp
+ mount -o loop fat12grldr.img fat12tmp
+ cp default fat12tmp
+ cp menu.lst fat12tmp
+ cp grldr fat12tmp
+ umount fat12tmp
+ bootlace.com --floppy --chs fat12grldr.img
+
+3. build iso9660 CDROM image grldr.iso
+
+ mkdir iso_root
+ cp grldr iso_root
+ cp menu.lst iso_root
+ mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o grldr.iso iso_root
+
+
+******************************************************************************
+*** Use bootlace.com to install partition boot record ***
+******************************************************************************
+
+Since bootlace.com has not implemented the --install-partition option, you
+need to use the already implemented --floppy=PartitionNumber option instead.
+
+Hear is a way you might want to follow:
+
+Step 1. Get the boot sectors of the partition and save to a file MYPART.TMP.
+ For NTFS, you need to get the beginning 16 sectors. For other type of
+ filesystems, you only need to get one sector, but getting more sectors
+ is also ok.
+
+Step 2. Run this:
+
+ bootlace.com --floppy=Y --sectors-per-track=S --heads=H --start-sector=B --total-sectors=C --vfat --ext2 --ntfs MYPART.TMP
+
+ where we suppose MYPART.TMP is for (hdX,Y) and the partition number Y
+ should be specified as in the --floppy=Y option.
+
+ Note that for FAT12/16/32/NTFS partitions, you can omit these options:
+
+ --sectors-per-track, --heads, --start-sector, --total-sectors,
+ --vfat and --ext2.
+
+ For NTFS partitions, you must specify --ntfs option.
+
+ For ext2 partitions, you can omit --vfat, --ntfs and --ext2 options,
+ but other options should be specified.
+
+Step 3. Put MYPART.TMP back on to the boot sector(s) of your original partition
+ (hdX,Y).
+
+
+Note: Only a few file systems(FAT12/16/32/NTFS/ext2/ext3) are supported by now.
+
+Note2: Under Linux you may directly write the partition. That is to say, Step
+ 1 and Step 3 are not needed. Simply use its device name instead of
+ MYPART.TMP.
+
+Note3: grubinst has the feature of installing grldr boot code onto a
+ partition boot area.
+
+******************************************************************************
+*** Use a single key to select menu item ***
+******************************************************************************
+
+Some machines have a simplified keyboard. The keyborad might have only the
+number keys 0 .. 9 plus a few other keys. When the menu displayed, the user
+can strike a key for 8 times. When the menu handler detects the continuous
+single keypress, it will assume the user want to use this key to select a menu
+item and boot. This single key will act as the RIGHT-ARROW key for the user to
+select a menu item. And 5 seconds later after the user stops the keypress,
+the selected menu item will automatically boot. Any normal keys can be used as
+a single key for this purpose, except for a few functional keys like b, e,
+Enter, etc. Once another key is pressed, the feature of Single-Key-Selection
+will disappear immediately.
+
+
+******************************************************************************
+*** Parameter file for bootlace running under DOS ***
+******************************************************************************
+
+You may move all or part of the command-line arguments into a file. The file
+can have multi lines. Just like SPACEs and TABs, the CRs and LFs can also
+delimit the commandline arguments in the parameter file.
+
+Example:
+
+ bootlace < my_parafile
+ bootlace --read-only my_mbr < my_other_options
+
+Note: Pipes do not work. You have to use the input-redirection operator(<).
+
+
+******************************************************************************
+*** Use bootlace to create a triple MBR ***
+******************************************************************************
+
+This is typically used for USB drives, though it also works with hard drives.
+
+Steps to create triple MBR:
+
+1. Do a fresh FDISK to create a FAT12/16/32 partition starting at sector 95
+(in LBA, that is, the begginning sector(MBR) is sector 0).
+
+2. Install grldr boot sector onto the boot sector of this partition. See
+section "Use bootlace.com to install partition boot record" above.
+
+3. Get 96 sectors of the drive starting at sector 0(MBR), and save to file
+MYMBR96.TMP.
+
+4. Run bootlace.com:
+
+ bootlace.com MYMBR96.TMP
+
+5. Put MYMBR96.TMP back onto the drive starting at MBR(sector 0).
+
+Note: If the drive already has a triple MBR, then bootlace will cancel it
+and restore the original partition layout.
+
+
+******************************************************************************
+*** Use 'pxe detect' in preset-menu ***
+******************************************************************************
+
+Now the "pxe" command has a new subcommand "detect":
+
+ pxe detect [BLOCK_SIZE] [MENU_FILE]
+
+BLOCK_SIZE specifies the block size for PXE. If it is not specified or it is
+0, then grub4dos will go through a probing process and get a proper value
+for data transfer.
+
+MENU_FILE specifies the config file on the PXE server. If omitted, a standard
+config file in the menu.lst sub-dir will gain control. For a description on
+the config files in the menu.lst sub-dir, please refer to the section
+"GRLDR as PXE boot file" above.
+If MENU_FILE starts in a "/", then the MENU_FILE on the PXE server will gain
+control, else(if MENU_FILE does not start in a "/") no menu will be executed.
+
+Normally you want to use a "pxe blksize ..." or a "pxe detect ..." command
+before you access the (pd) device, since the default blocksize of 512 might
+not work on your system.
+
+
+******************************************************************************
+*** Use 'configfile' in preset-menu ***
+******************************************************************************
+
+Now the preset menu holds the highest priority. It will gain control prior to
+the menu.lst on the boot device. If a 'configfile' command(without specifying
+any file as the parameter) occurs in the menu init command group of the preset
+menu, then control will go to the menu.lst on the boot device.
+
+Note: You should better not use "configfile ANOTHER_MENU" frequently in your
+menu.lst file, because it could create infinite loop and thus hang your
+computer.
+
+
+******************************************************************************
+*** New command 'dd' to copy files ***
+******************************************************************************
+
+Usage:
+
+dd if=IF of=OF [bs=BS] [count=C] [skip=IN] [seek=OUT] [buf=ADDR] [buflen=SIZE]
+
+Copy file IF to OF. BS is blocksize in bytes, default to 512. C is blocks to
+copy, default is total blocks in IF. IN specifies number of blocks to skip
+when read, default is 0. OUT specifies number of blocks to skip when write,
+default is 0. Skipped blocks are not touched. Both IF and OF must exist.
+
+Both IF and OF must have a leading device name, i.e., of the form `(...)'.
+You may use `()' for the current root device.
+
+dd can neither enlarge nor reduce the size of OF, the leftover tail of IF
+will be discarded. OF cannot be a gzipped file. If IF is a gzipped file,
+it will be decompressed automatically when copying.
+
+dd is dangerous, use at your own risk. To be on the safe side, you should
+only use dd to write a file in memory.
+
+In some cases when writing a file in a NTFS volume, dd might fail.
+
+If you attempt to write a device or a block file that is not in memory by
+starting dd in a menu, you will safely be refused :-) (Update: no restrictions
+now)
+
+Update: New options are implemented for user defined buffer. By default,
+the buffer is at address 0x50000, and length is 0x10000(=64KB). You cannot
+specify ADDR to be lower than 0x100000(=1MB). Besides, you must specify SIZE
+larger than 0x10000(=64KB). Normally you want ADDR >= 0x1000000(=16MB), and
+SIZE also >= 16MB. A large SIZE could speed up the progression of dd.
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
+!!!! Caution! Both IF and OF can be a device name which stands for !!!!
+!!!! all the sectors on the device. Take utmost care! !!!!
+!!!!______________________________________________________________________!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+******************************************************************************
+*** New command 'uuid' to identify partitions ***
+******************************************************************************
+
+Usage:
+
+ uuid [DEVICE] [UUID]
+
+If DEVICE is not specified, search for filesystem with UUID in all partitions
+and set the partition containing the filesystem as new root (if UUID is
+specified), or just list uuid's of all filesystems on all devices (if UUID is
+not specified). If DEVICE is specified, return true or false according to
+whether or not the DEVICE matches the specified UUID (if UUID is specified),
+or just list the uuid of DEVICE (if UUID is not specified).
+
+Example 1:
+
+ find --set-root uuid () 7f95820f-5e33-4e6c-8f50-0760bf06d79c
+
+which will find a partition with uuid=7f95820f-5e33-4e6c-8f50-0760bf06d79c
+and set the partition as root if found.
+
+Example 2:
+
+ uuid ()
+
+which will print the uuid of the current root device.
+
+
+******************************************************************************
+*** gfxmenu support in grub4dos ***
+******************************************************************************
+
+Gfxmenu support has been added to grub4dos. To use it, you must first find the
+message file you need, then load it in menu.lst with command like this:
+
+ gfxmenu /message
+
+This should be a gloabl command, that is, not inside any menu item. Also, it
+can only be used in configure file, running it in console mode does not work.
+
+gfxmenu does not work in conjunction with the password feature.
+
+There are two major format of message file. Old format is created with gfxboot
+3.2.* or older (size of message file is normally about 150K), while new format
+is created with gfxboot 3.3.* and later (size of message file is normally above
+300K). Both format are supported in grub4dos.
+
+
+******************************************************************************
+*** Use 'write' to write a string into a device or file ***
+******************************************************************************
+
+Usage:
+
+ write [--offset=SKIP] ADDR_OR_FILE INTEGER_OR_STRING
+
+SKIP is an integer and defaults to 0.
+
+If ADDR_OR_FILE is an integer, then it is treated as a memory address, and
+INTEGER_OR_STRING must be an integer value. The integer INTEGER_OR_STRING
+will be written to address (ADDR_OR_FILE + SKIP).
+
+If ADDR_OR_FILE is a device or a file, then INTEGER_OR_STRING is treated as
+a string which will be written to ADDR_OR_FILE at offset SKIP (in bytes).
+
+The string is quoted with nothing, that is, neither with the single quote
+char(') nor with the double quote char(").
+
+Space char must be quoted with back slash(\). (Update: need not now)
+
+Single quote char(') and double quote char(") are not interpreted specially
+and can be used directly in the string.
+
+Some C-style quote sequences are interpreted as follows:
+
+ \NNN character with octal value NNN (1 to 3 digits)
+
+ \\ backslash
+
+ \a alert (BEL)
+
+ \b backspace
+
+ \f form feed
+
+ \n new line
+
+ \r carriage return
+
+ \t horizontal tab
+
+ \v vertical tab
+
+ \xHH byte with hexadecimal value HH (1 to 2 digits)
+
+Just like dd, the write can neither enlarge nor reduce the size of the
+destination file, the leftover tail of the string will be discarded.
+The destination file cannot be a gzipped file.
+
+Again like dd, the write command is also dangerous, use at your own risk.
+And to be on the safe side, you should only write to memory files.
+
+In some cases when writing a file in a NTFS volume, the write might fail.
+
+If you attempt to write a device or a block file that is not in memory by
+using write in a menu, you will safely be refused :-) (Update: no restrictions
+now)
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
+!!!! Caution! The file to write can be a device name which stands !!!!
+!!!! for all the sectors on the device. Take utmost care! !!!!
+!!!!______________________________________________________________________!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+******************************************************************************
+*** Item-by-item help text for menu entries ***
+******************************************************************************
+
+
+The help message at the bottom of the screen will vary as you choose the menu.
+
+You may append your help text to the title line. The help text must begin
+with "\n", for example:
+
+ title This is the title\nThis is the help text.\nAnd this is the 2nd line of the help text.
+
+Some C-style quote sequences are interpreted as stated in the section above.
+
+
+******************************************************************************
+*** initrd can load multiple cpio files for Linux 2.6 kernels ***
+******************************************************************************
+
+Usage:
+
+ initrd FILE [FILE ...]
+
+Note 1: You should not load more than one oldstyle disk images in this way,
+because this is not supported by Linux kernel.
+
+Note 2: The FILEs should be specified in the same order as with syslinux.
+
+******************************************************************************
+*** access some internel variables at a fixed location ***
+******************************************************************************
+
+Address Length Description
+========= ======== ==============================================
+0000:8208 4 (DWORD) install_partition (the boot partition)
+0000:8280 4 (DWORD) boot_drive (the boot drive)
+0000:8284 4 (DWORD) pxe_yip (your ip)
+0000:8288 4 (DWORD) pxe_sip (server ip)
+0000:828C 4 (DWORD) pxe_gip (gateway ip)
+0000:8290 8 (QWORD) filesize (file size by last "cat --length=0")
+0000:8298 4 (DWORD) saved_mem_upper (extended memory size in KB)
+0000:829C 4 (DWORD) saved_partition (current root partition)
+0000:82A0 4 (DWORD) saved_drive (current root drive)
+0000:82A4 4 (DWORD) no_decompression (no auto gunzip)
+0000:82A8 8 (QWORD) part_start (start sector of last partition)
+0000:82B0 8 (QWORD) part_length (total sectors of last partition)
+
+Note 1: Filesize can be initialised/modified by using "cat --length=0 FILE".
+Note 2: You should not write these variables by hand(should read only).
+Note 3: You may use 1K at 6000:0000 for your own varibles(See note 4).
+Note 4: The read command now returns the integer value at the given address.
+Note 5: Grub4dos does not have the variable expansion feature. You can only
+ use integer variables. You need not declare them, but use the memory
+ address directly. Usually you want to use variables as a logical
+ value or in a command for conditional test, e.g., of this form:
+ "checkrange RANGE read ADDR"
+Note 6: no_decompression, saved_drive and saved_partition are writable.
+
+
+******************************************************************************
+*** possibility to run another menu.lst after gfxmenu ***
+******************************************************************************
+
+Notice the use of CONFIGFILE after GFXMENU in the following example:
+
+ # The menu.lst file for gfxmenu
+ default=0
+ timeout=5
+ gfxmenu /message
+ configfile /another.lst
+ title 0..........
+ ................
+ title 1..........
+ ................
+ title 2..........
+ ................
+ # End of menu.lst
+
+ # Begin another.lst
+ default=0
+ timeout=5
+ title 0..........
+ ................
+ title 1..........
+ ................
+ title 2..........
+ ................
+ # End of another.lst
+
+This will try gfxmenu command first. On exit(or on failure) control will go
+to another.lst file.
+
+
+******************************************************************************
+*** a range of drives can be unmapped ***
+******************************************************************************
+
+Usage:
+
+ map --unmap=RANGE
+
+RANGE is a range of BIOS drive numbers to be unmapped. BIOS drive number 0
+is for the first floppy, 1 is for the second floppy; 0x80 is for the first
+hard drive, 0x81 is for the second hard drive, etc; virtual cdrom (hd32)
+corresponds to BIOS drive number 0xA0, (hd33) corresponds to 0xA1, etc.
+
+For description on RANGE, please refer to section `The New Command CHECKRANGE'
+above.
+
+Example 1:
+
+ map --unmap=0,0x80,0xff
+
+This will unmap virtual floppy (fd0), virtual hard drive (hd0) and virtual
+cdrom (0xff).
+
+Example 2:
+
+ map --unmap=0:0xff
+
+This will unmap all virtual floppies, all virtual hard drives and all virtual
+cdroms.
+
+Note 1: Normally a `map' command will add an item in the drive map table for
+ a virtual drive. But `--unmap' means items in the drive map table
+ (for the specified virtual drives) will be deleted.
+Note 2: The --unhook option only breaks the INT13 hook(to the inerrupt
+ vector table). It will not affect the drive map table. And later on
+ execution of a `boot' command, the INT13 disk emulation routine will
+ automatically get hooked(to the interrupt vector table) when needed
+ (e.g., the drive map table is non-empty) even if it has been unhooked.
+Note 3: Usually you want to do a `map --rehook' after you have changed the
+ drive map table.
+
+
+******************************************************************************
+*** geometry tune and sync ***
+******************************************************************************
+
+When a USB storage device is connected to a (or another) machine, the geometry
+in the partition table or in the BPB of the volume could be invalid, and the
+machine could hang at boot time. So you need to find out the correct geometry
+for the drive (use `geometry --tune'), and then update the geometry in
+partition table and BPB of the drive(use `geometry --sync').
+
+The above steps are required if you are going to boot DOS, because DOS
+requires the right geometry in the partition table and BPB. Windows/Linux may
+also require it, since the boot process could run in real-mode.
+
+
+******************************************************************************
+*** Version numbering ***
+******************************************************************************
+
+Now we append a letter 'a', 'b', 'c' or 'p' to the version number(e.g., 0.4.5).
+So the version will become 0.4.5a, 0.4.5b, 0.4.5c, 0.4.5 or 0.4.5p.
+
+'a' - alpha test. unstable, especially when there are known bugs.
+'b' - beta test. the developers think it has no bugs and want a widely testing.
+'c' - release candidate.
+''(nothing) - official release.
+'p' - patched versions to the official release.
+
+
+******************************************************************************
+*** Running User Programs ***
+******************************************************************************
+
+From 0.4.5 on, user programs can be developed for running under grub4dos. The
+executable program file must end with the 8-byte grub4dos EXEC signature:
+
+ 0x05, 0x18, 0x05, 0x03, 0xBA, 0xA7, 0xBA, 0xBC
+
+The executable must have no relocations, and the entry point is at the very
+beginning of the file, just like a DOS .com file(but the grub4dos executable
+is 32-bit).
+
+Here is a sample file echo.c:
+
+/*================ begin echo.c ================*/
+
+/*
+ * compile:
+
+gcc -nostdlib -fno-zero-initialized-in-bss -fno-function-cse -fno-jump-tables -Wl,-N -fPIE echo.c
+
+ * disassemble: objdump -d a.out
+ * confirm no relocation: readelf -r a.out
+ * generate executable: objcopy -O binary a.out b.out
+ *
+ * and then the resultant b.out will be grub4dos executable.
+ */
+
+/*
+ * This is a simple ECHO command, running under grub4dos.
+ */
+
+int i = 0x66666666; /* this is needed, see the following comment. */
+
+/* gcc treat the following as data only if a global initialization like the
+ * above line occurs.
+ */
+
+/* a valid executable file for grub4dos must end with these 8 bytes */
+asm(".long 0x03051805");
+asm(".long 0xBCBAA7BA");
+/* thank goodness gcc will place the above 8 bytes at the end of the b.out
+ * file. Do not insert any other asm lines here.
+ */
+
+int
+main()
+{
+ void *p = &main;
+
+ return
+ /* the following line is calling the grub_sprintf function. */
+ ((int (*)(char *, const char *, ...))((*(int **)0x8300)[0]))
+ /* the following line includes arguments passed to grub_sprintf. */
+ (0, p - (*(int *)(p - 8)));
+}
+
+/*================ end echo.c ================*/
+
+0x8300 is a pointer to the grub4dos system funtions(API). The system_functions
+variable is defined in asm.S.
+
+More function can use in user programs:
+ http://grubutils.googlecode.com/svn/trunk/src/include/grub4dos.h
+note: After 2010-11-16 version of grub4dos,you can use like below.
+/////////////////echo.c start///////////////////////////////////////////////
+#define sprintf ((int (*)(char *, const char *, ...))((*(int **)0x8300)[0]))
+
+#define printf(...) sprintf(NULL, __VA_ARGS__)
+int i = 0x66666666;
+asm(".long 0x03051805");
+asm(".long 0xBCBAA7BA");
+int main(char *arg,int flags)
+{
+
+ return printf("%s\n",arg);
+}
+/////////////////echo.c end/////////////////////////////////////////////////
+
+******************************************************************************
+*** Map options added by Karyonix ***
+******************************************************************************
+
+(from boot-land.net) Karyonix's note:
+
+map --add-mbt= option to be used with --mem. If =0 master boot track will not
+ be added automatically.
+map --top option to be used with --mem. map --mem will try to allocate memory
+ at highest available address.
+map --mem-max=, map --mem-min options to be used before map --mem. Allow user
+ to manually limit range of address that map --mem can use.
+
+safe_parse_maxint_with_suffix function parses K,M,G,T suffix after number.
+
+
+******************************************************************************
+*** Graphics mode 6A: 800x600 with 16 colors ***
+******************************************************************************
+
+Graphics mode now has 2 possibilities, one is the default 640x480 mode, and the
+other is 800x600 mode.
+
+To enter 800x600 mode, follow this way:
+
+1. Be sure you are in console text mode. You may execute "terminal console".
+2. Set graphics mode to 0x6A by using command "graphicsmode 0x6A".
+3. Enter graphics mode. You may execute command "terminal graphics".
+
+To return to 640x480 mode, follow this way:
+
+1. Be sure you are in console text mode. You may execute "terminal console".
+2. Set graphics mode to 0x12 by using command: "graphicsmode 0x12".
+3. Enter graphics mode. You may execute command "terminal graphics".
+
+******************************************************************************
+***** GRUB4DOS variable support *****
+******************************************************************************
+
+From now we supports variables, the same usage of MSDOS.
+
+commands:
+ set [/p] [/a|/A] [/l|/u] [VARIABLE=[STRING]]
+ variable specifies the variable name (up to 8 characters).
+ string Specifies a string assigned to the variable (up to 512 characters.)
+
+SET command without parameters will display the current variables.
+
+with "=",if the string is empty.
+ set myvar=
+Will delete the variable myvar
+
+Show the name has been used for all variable. For example:
+ set ex_
+Will display all variables beginning with ex_, returns 0 if no match.
+
+Note: 1. the same of MSDOS.
+ a full line of command will be conducted before the implementation of variable substitution.
+ 2. Variable names must beginning with letter or "_".
+ Otherwise you will not be able to access your variables.
+ 3. See the previous description for length limit.
+ 3. To reset all used variable enter command "set *"
+
+the new command if
+ if [/I] [NOT] STRING1==STRING2 [COMMAND]
+ if [NOT] exist VARIABLE|FILENAME [COMMAND]
+
+ STRING1==STRING2
+ Specifies a true condition if the specified text strings match.
+ COMMAND
+ Specifies the command to carry out if the condition is met.
+ /I
+ if specified, says to do case insensitive string compares.
+ NOT
+ Specifies that should carry out the command only if the condition is false.
+
+Example:
+ 1. To determine whether strings are equal, and not case sensitive.
+ if /i test==%myvar% echo this is a test
+ 2. To determine the character is empty.
+ if %myvar%#==# echo variable myvar not defined.
+Usage example:
+ 1. Displays a string including the variable.
+ echo myvar=%myvar%
+ 2. Using a variable instead of command.
+ set print = echo
+ %print% This a test.
+ 3. You can use a "^" to stop extended, example
+ echo %myvar^%
+ Or
+ echo %my^var%
+ Will be displayed %myvar% rather than the extended character after myvar.
+Note: We only deal the ^ between the symbols %%.
+
+******************************************************************************
+***** GRUB4DOS batch scripting support *****
+******************************************************************************
+
+The new version supports running a batch script,It very like MS-DOS batch.
+Yes!you needn't to learn a new language.
+
+Example of a simple script:
+ ========= GRUB4DOS BATCH SCRIPT START ===============================
+ !BAT #Note: The file header !BAT is necessary to identify this is a batch
+ echo %0
+ echo Your type:%1 %2 %3 %4 %5 %6 %7 %8 %9
+ call :Label1 This is a test string
+ goto :label2
+ :Label1
+ echo %1 %2 %3 %4 %5 %6 %7 %8 %9
+ goto :eof
+ :Label2
+ echo end of batch script.
+ ========= GRUB4DOS BATCH SCRIPT END ===============================
+
+Some differences:
+ 1. Batch will stop when an error occurs.
+ 2. Use command "exit 1",if you need to stop a running batch script.
+ 3. %9 refers to all the remaining parameters.
+ 5. extensions
+ %~d0 expands %0 to a drive letter.e.g: (hd0,0) ,()
+ %~p0 expands %0 to a path only
+ %~n0 expands %0 to a file name only
+ %~x0 expands %0 to a file extension only
+ %~f0 expands %0 to a fully qualified path name
+ %~z0 expands %0 to size of file
+ 6.You can find some script in below site.
+ http://chenall.net/post/tag/grub4dos/
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS_CN.txt b/client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS_CN.txt
new file mode 100644
index 00000000..33bcf43e
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/README_GRUB4DOS_CN.txt
@@ -0,0 +1,4314 @@
+本文档来源:http://bbs.znpc.net/viewthread.php?tid=5587
+感谢zw2312914提供
+原版是中英文对照的版本,这里已经经过删改。
+需要看原版的可以从上面的贴子下载.
+
+一些旧的网址已经删除,只保留目前在用的.
+
+注:本文仅供参考,可能有一些更新没有在这里说明.如果有发现错误可以到论坛发贴或email联系我(grub4dos@chenall.net)
+
+其它命令用法请参考
+ http://grub4dos.sourceforge.net/wiki/ 处的 GRUB4DOS 有关文档。
+
+外部命令的用法请参考
+ http://chenall.net/post/tag/grub4dos/
+
+项目主页
+ http://code.google.com/p/grub4dos-chenall/
+
+下载网址:
+ http://code.google.com/p/grub4dos-chenall/downloads/list
+ http://nufans.net/grub4dos/
+
+工具和外部命令:
+ http://code.google.com/p/grubutils/downloads/list
+
+通过匿名 svn 服务器获取最新源代码的方法:
+
+ svn co http://grub4dos-chenall.googlecode.com/svn/trunk/ grub4dos
+
+通过你的 web 浏览器在线查看源代码:
+ http://code.google.com/p/grub4dos-chenall/source/browse/
+
+GRUB4DOS 邮件列表(未用):
+ grub4dos-devel@gna.org
+
+订阅页面:
+ https://mail.gna.org/listinfo/grub4dos-devel/
+
+论坛(官方技术支持站点):
+ http://bbs.znpc.net/forumdisplay.php?fid=4
+ http://reboot.pro/forum/66/
+
+---------------------近期更新记录-----------------------------------------------
+最新更新记录请查看,ChangeLog_chenall.txt
+2011-01-03
+ 添加了GRUB4DOS的变量用法及相关介绍。
+
+2011-01-02
+ 1.为了方便pause命令添加--test-key参数,显示按键扫描码.
+
+
+2010-12-31 更新:
+ 1.pause命令增强,增加了显示按键扫描码的功能。需要debug 为-1.
+ 例子:显示一个按键扫描码
+ debug -1 && pause && debug 1
+ 注:此功能已为被参数--test-key代替。
+
+ 2.hiddenmenu命令增强。增加一个--chkpass参数
+ 功能: 在隐藏菜单的时候按Esc键要输入正确的密码才可以显示菜单。
+ 注意: 1.该功能启用之后,如果按了其它按键则直接启动默认菜单。
+ 默认的Esc按键可以自由设置。使用--chkpass=KEY
+ 2.菜单初始化有password命令时才需要输入密码。
+ 3.按键代码如果不清楚可以使用上面的功能来获取。
+ 例子: hiddenmenu --chkpass=0x8500 按F11键才可以显示菜单。
+ hiddenmenu --chkpass 按Esc键才可以显示菜单。
+ hiddenmenu --chkpass=0x2200 按Alt+G显示菜单。
+
+------------------------------------------------------------------------------
+GRUB.EXE 用法:
+ GRUB [--bypass] [--time-out=T] [--hot-key=K] [--config-file=FILE]
+ 旁路 暂停时间 热键 配置文件
+
+ 这里的 FILE ,例如,可以是 (hd0,0)/menu.lst
+
+ 在 CONFIG.SYS 中,其配置行类似于:
+
+ install=c:\some\where\grub.exe --config-file=FILE
+
+ 如果没有使用选项,GRUB.EXE简单的使用(hd0,0)/menu.lst
+ 来作为配置文件,只要它存在的话。(注意!我们最终将默认的配
+ 置文件从 (hd0,0)/boot/grub/menu.lst 变更为 (hd0,0)/menu.lst)
+ (更新于2006-12-23。参见更新3)
+
+ 这里的分区(hd0,0)可以是一个Windows分区或者是一个linux分区,
+ 或者是被 GRUB 支持的其他任意分区。
+
+
+ 这里的FILE只接受GRUB风格的文件名。DOS风格的文件名不被调用
+ (很明显,我们应该使用GRUB风格的文件名,原因是比如在Linux
+ ext2分区中不能使用DOS风格的文件名来访问文件 )。
+ (参见更新2)
+
+ 更新:FILE 可以是菜单的内容。使用分号来分隔嵌入 FILE 中的命
+ 令。FILE 可以被一对双引号括起来,示例:
+
+ GRUB --config-file="root (hd0,0);chainloader +1"
+ 这条命令将启动(hd0,0)上的系统。
+
+ 另一个例子:
+ GRUB --config-file="reboot"
+ 这条命令将令机器重启。
+
+ 再例如:
+ GRUB --config-file="halt"
+ 这条命令将令机器关闭。
+
+ 如果选项--bypass 被指定,GRUB将在暂停时间截止后从DOS退出。
+ 选项'--time-out=T' 指定了以秒计时的暂停值。如果指定了--bypass
+ 则T的默认值为5 ,而--bypass选项没有被指定时默认值为0 。
+
+ 默认的热键值是 0x3920 (即空格键)。如果此键被按下,GRUB将正常
+ 启动。如果其他键被按下,GRUB 将立即终止并返回到DOS。参见下面
+ 的“int16 键盘扫描码”
+
+ 每个选项最多只能被指定一次。
+
+ 更新 2:DOS风格的文件名已经被支持(由John Cobb先生提供此补丁)。
+ 如果 FILE 的起始两个字符是“ #@ ”,那么 FILE 中其余的部分将被视
+ 为一个DOS风格的文件名。例如:
+
+ GRUB --config-file="#@c:\menu.lst"
+
+ DOS风格的文件只有起始的4kB被使用。此文件应当是一个未被压缩的文
+ 本文件。
+
+ 注意:你也可以在SHELL或者在CONFIG.SYS的INSTALL配置行使用‘DOS
+ 风格文件直接访问’。但不要在DEVICE 配置行使用它。DOS文档中表述
+ 了DOS设备驱动不能使用'打开文件'的DOS调用。
+
+
+ 更新 3(2006-12-23): 作为默认,GRUB.EXE将按以下顺序查找它的配置文件:
+
+ (DOS风格文件) .\menu.lst, 当前目录下的MENU.LST。
+ (DOS风格文件) \menu.lst, 当前驱动器根目录下的MENU.LST
+ (GRUB风格文件) /menu.lst, 启动设备根目录下的MENU.LST
+
+ 默认的启动设备还是(hd0,0)。
+
+
+--------------------------------------------------------
+
+更新 1 : 版本0.2.0 同时带来一个新的东西。GRUB for NTLDR ,它能够从
+ Windows NT/2000/XP的启动菜单启动到GRUB。复制GRLDR到Windows
+ NT/2000/XP的C盘根目录,并在C:\BOOT.INI中加入这样一行:
+
+ C:\GRLDR="Start GRUB"
+
+ 这样就完成了安装。GRLDR应该与 BOOT.INI及NTLDR 位于相同的目录。
+ 注意 BOOT.INI 通常是隐藏的因而你要看见它必须取消隐藏。如果GRLDR
+ 在一个NTFS分区,应该将它复制到一个非NTFS分区的根目录(并且menu.lst
+ 文件应当同样这样做)。假如GRLDR被压缩了,比如在NTFS分区中对它启
+ 用了压缩的情况下,它将不能运行。
+
+ 即使这个磁盘的驱动器号已经被Windows设备管理器改变为另外的不同
+ 于 C 的盘号 ,你仍然需要在 BOOT.INI 中使用盘符 C ,否则,NTLDR
+ 将查找不到 GRLDR 文件。
+
+ 也就表示,如果你从一个软盘上启动NTLDR,你也需要把A:\BOOT.INI
+ 中的 GRLDR 的所在行这样写:
+
+ C:\GRLDR="Start GRUB"
+
+ 而不能象下面这样使用盘符 A :
+
+ A:\GRLDR="Start GRUB"
+
+ (注意在 BOOT.INI 位于软盘 A 的这个例子中,标记“C:\GRLDR”
+ 实际将访问 A:\GRLDR )
+
+
+更新 2: GRUB for linux 也一起被引入到版本0.2.0。
+ 你可以使用使用linux的引导程序 KEXEC,LILO,SYSLINUX 或者别的
+ GRUB来启动它。(GRUB4LIN 已经合并到 GRUB.EXE 中)
+
+ 从Linux中直接启动到GRUB ,使用这样一组命令:
+
+ kexec -l grub.exe
+ kexec -e
+
+ 经由GRUB启动到GRUB,使用如下的命令:
+
+ kernel (hd0,0)/grub.exe
+ boot
+
+ 经由LILO启动到GRUB,在lilo.conf中加入这样几行:
+
+ image=/boot/grub.exe
+ label=grub.exe
+
+ 经由syslinux启动到GRUB,在syslinux.cfg中加入这样几行:
+
+ label grub.exe
+ kernel grub.exe
+
+ LOADLIN在引导GRUB.EXE时可能会遇到问题,原因是grub.exe需要一些
+ 未更改的原始的BIOS中断向量,但是DOS破坏了这些中断向量,而loadlin
+ 在将控制权交给grub.exe前并没有恢复它们。
+
+
+更新 3: 从版本0.4.0开始,DOS下的GRUB支持内存驱动器。示例:
+
+ # boot into a floppy image
+ map --mem (hd0,0)/floppy.img (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ map --floppies=1
+ boot
+
+ 由于镜像将被拷贝到一个内存区域,所以镜像本身可以是非连续的,
+ 甚至可以是被gzip压缩过的。
+
+ 另一个例子:
+ map --mem=-2880 (hd0,0)/floppy.img (fd0)
+
+ 这个内存驱动器(fd0)将占用至少1440 KB的内存。
+ 这也对那些小于1440 KB的1.44M 软盘镜像有用。
+
+ 再例如:
+ map --mem --read-only (hd0,0)/hd.img (hd1)
+
+ 这个内存驱动器成为了一个硬盘驱动器,并且只读。
+ 这表示你不能向这个(hd1)中写入数据。
+
+ 你可以同时使用多个内存驱动器和多个原来的基于磁盘虚拟的仿真驱动器。
+
+ 如果BIOS不支持中断int15/EAX=e820h,你将不能使用任何内存驱动器。
+
+更新 4: 对于内存驱动器仿真,一个单一的分区镜像可以被转换为整个硬盘镜像来
+
+
+ map --mem (hd0,7)/win98.img (hd0)
+ map --hook
+ chainloader (hd0)+1
+ rootnoverify (hd0)
+ map --harddrives=1
+ boot
+
+ 这里的win98.img是一个头部不含主引导记录和分区表的分区镜像。
+ GRUB for DOS 确实会为这个内存驱动器(hd0)建立一个MBR和分区表。
+
+更新 5: 现在GRLDR可以作为一个非模拟模式的可启动光盘的启动映像文件来使
+ 用。Linux用户使用示例:
+
+ mkdir iso_root
+ cp grldr iso_root
+ mkisofs -R -b grldr -no-emul-boot -boot-load-seg 0x1000 -o bootable.iso iso_root
+
+ 另一种选择是,grldr也可以用同样的方法作为stage2_eltorito来使用。
+ -boot-info-table选项是被允许使用的,但你可以省略它:
+
+ mkdir iso_root
+ cp grldr iso_root
+ mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o grldr.iso iso_root
+
+ 也要注意上面的可启动iso镜像是使用-boot-load-seg 0xHHHH选项来建立的话,
+ 就必须令HHHH大于或者等于1000(十六进制)
+ 如果HHHH小于1000(十六进制),虚拟机 QEMU 会死机。这是QEMU的一个缺陷。一
+ 个grldr.iso镜像可以使用也可以不使用-boot-load-seg 0xHHHH选项来创建。
+
+ menu.lst文件应该被放置在光盘的根目录。
+
+更新 6: 中文专用版被建立在"chinese"子目录中。
+ ( 由Gandalf先生提供此补丁,2005-06-27)
+
+ 中文专用版同时内附了scdrom 功能。
+ (更新:scdrom 从2006-07-20起已被删除)
+
+更新 7: 增加了内存驱动器(md) 。就像(nd)代表网络驱动器 (cd) 代表光驱一样,
+ 新的驱动器(md)实现了将整个内存作为一个磁盘驱动器来访问。
+ (md)只工作在支持BIOS中断int15/EAX=E820h的系统上。
+
+ 现在,cat命令已经有了一个十六进制转储的新选项:--hex
+ 以及通过--locate=STRING 在文件中找查找字符串。
+
+ 典型示例:
+
+ cat --hex (hd0)+1
+
+ 这将用十六进制的表格显示 MBR 扇区。
+
+ cat --hex (md)+2
+
+ 这将显示你内存起始处的1 KB内容(实际,这就是实模式的IDT表),也是
+ 使用十六进制的转储表。
+
+ cat --hex (md)0x800+1
+
+ 这将显示你的扩展内存的第一个扇区。
+
+ cat --hex (hd0,0)+1
+ 这将显示(hd0,0)分区的第一扇区。通常这个扇区包含操作系统的引导记录。
+
+更新 8: 增加了随机存贮驱动器 (rd) 。(md) 设备访问内存是从物理地址 0
+ 开始,而 (rd) 可以访问起始于任何基地址的内存。随机存贮器的基
+ 址与长度可以通过 map 命令指定。详情请使用 "help map" 命令。
+ 你甚至能够为(rd)驱动器指定一个BIOS驱动器号。比如:
+ map --ram-drive=0xf0。默认的 (rd) 驱动器号是使用0x7F的软驱号。
+ 如果 (rd) 是硬盘驱动器镜像,你应该用大于或等于0x80的值来改变
+ 它的驱动器号。(但应防止使用0xffff,因为0xffff是预留给(md)设
+ 备的。)
+
+ (rd)+1这个标志始终代表文件,它包含存储在(rd)中的所有字节。
+
+更新 9: 直接启动 WinNT/2K/XP 的 NTLDR 和 Win9x/ME 的 IO.SYS, 以及
+ FreeDOS 的 KERNEL.SYS. 例如:
+
+ chainloader --edx=0xPPYY (hd0,0)/ntldr
+ boot
+
+ chainloader --edx=0xYY (hd0,0)/io.sys
+ boot
+
+ chainloader --ebx=0xYY (hd0,0)/kernel.sys
+ boot
+
+ 十六进制的YY 指定了启动驱动器号,十六进制的PP指定了 NTLDR 的
+ 启动分区号。如果启动驱动器是软驱,PP应该是一个十六进制的值ff,
+ 即十进制的255.
+
+ 对于 Freedos 的 KERNEL.SYS , 选项--edx不能执行,请使用--ebx 。
+
+ 当文件位于它们平常的位置时,选项 --edx (--ebx)可以省略。但某些
+ 情况下,这些选项是必需的。
+ 例如,假设被调用的ntldr文件在ext2分区(hd2,8)中,而你又希望它认
+ 为(hd0,7)的 windows 分区是启动分区,那么--edx就是必需的:
+
+ chainloader --edx=0x0780 (hd2,8)/ntldr
+
+ 对于DOS核心(即,IO.SYS和KERNEL.SYS),启动分区号是没有意义的,
+ 因此你只需指定恰当的启动驱动器号YY(不过指定了启动分区号也是
+ 无害的)。
+
+ 上面的PPYY也可以在chainloader命令之后通过root和rootnoverify命
+ 令来指定。例如:
+
+ chainloader (hd2,6)/kernel.sys
+ rootnoverify (hd0) <-------- YY=80
+ boot
+
+ chainloader (hd0,0)/ntldr
+ rootnoverify (hd0,5) <-------- YY=80, PP=05
+ boot
+
+ 提示:CMLDR (the ComMan LoaDeR,它被用于加载Windows的故障
+ 恢复控制台)可以像NTLDR一样被良好的加载。
+
+ Bean 成功地解压和启动了WinME的IO.SYS,感谢这个出色的工作。
+
+更新 10: isolinux.bin (版本 3.73) 可以被自2009-02-09 起建立的版本加载。
+
+ chainloader (cd)/isolinux.bin
+
+ isolinux.bin必须是存在于在真实或虚拟的光驱之中的。
+
+更新 11: Grub 传统版的 stage2 文件可以通过下面的方法加载:
+
+ chainloader --force --load-segment=0 --load-offset=0x8000 --boot-cs=0 --boot-ip=0x8200 (...)/.../stage2
+
+--------------------------------------------------------
+这里用一些示例来演示磁盘仿真命令的用法:
+
+1. 仿真硬盘分区C:为软驱A:并从C:中启动win98:
+
+ map --read-only (hd0,0)+1 (fd0)
+ chainloader (hd0,0)+1
+ rootnoverify (hd0)
+ boot
+
+ 在上面的示例中,(hd0,0)是一个装有win98的C:盘 。当win98启动完成后,你会发
+ 现A:中包含了C:的所有文件,而且如果你删除A:中的文件,C:上的相应文件也会消
+ 失。
+
+ 在map命令行中,(hdm,n)+1式的写法被解释成代表整个(hdm,n)分区,而不仅仅是
+ 此分区的第一扇区。
+
+2. 将硬盘分区C:仿真为软驱A:并从A:中启动win98:
+
+ map --read-only (hd0,0)+1 (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ map --floppies=1
+ boot
+
+ 在“map --hook”命令之后,仿真立即生效,即使是在GRUB的命令行模式中。
+
+ Note that the (fd0) in "chainloader (fd0)+1" is the emulated virtual
+ floppy A:, not the real floppy diskette(because map is hooked now).
+ 注意“chainloader (fd0)+1” 中的(fd0)是仿真后的虚拟软驱 A:,而不是真
+ 实的软盘(因为映射现在已经被挂载了)。
+
+
+3. 仿真镜像文件为软驱A:并从C:盘中启动win98:
+
+ map --read-only (hd0,0)/floppy.img (fd0)
+ chainloader (hd0,0)+1
+ rootnoverify (hd0)
+ map --floppies=1
+ map --harddrives=1
+ boot
+
+4. 仿真硬盘分区为第一硬盘并从中启动DOS:
+
+ map --read-only (hd2,6)+1 (hd0)
+ map --hook
+ chainloader (hd0,0)+1
+ rootnoverify (hd0)
+ map --harddrives=1
+ boot
+
+ 在这个示例中,(hd2,6)+1代表BIOS序号为3的(hd2)硬盘中的,扩展的DOS逻辑分区。
+
+ 如果一个DOS分区被仿真为一个硬盘,GRUB for DOS将首先定位分区表,通常,
+ 是在DOS分区的开头63个扇区中。如果那里没有分区表,GRUB for DOS将拒绝仿真。
+
+5. 仿真一个镜像文件为第一硬盘然后从中启动DOS:
+
+ map --read-only (hd0,0)/harddisk.img (hd0)
+ chainloader --load-length=512 (hd0,0)/harddisk.img
+ rootnoverify (hd0)
+ map --harddrives=1
+ boot
+
+ 如果一个镜像文件被仿真为硬盘,此镜像文件必须包含MBR。也就是说,
+ HARDDISK.IMG的第一扇区必须包含被仿真的虚拟硬盘的分区表。
+
+注意: BIOS数据区中的软盘和硬盘的总数在映射期间没有被改变。当主板上没有配置真
+ 实的软驱时,你通常应该专门使用诸如‘map --floppioes=’以及
+ map --harddrives=’来设置它们。如果不这样做,DOS可能会启动失败。
+
+ ‘map --status’可以报告出一些有价值的东西。同时要注意‘map --floppies=’
+ 和‘map --harddrives=’需要在没有执行映射前单独使用。
+
+ 版本0.4.2引入了一个新参数,memdisk_raw,用以模拟和内存驱动器类似的原生模式。
+ 如果BIOS不支持中断int15/87h,或者int18/87h的支持有缺陷,你应该在任何内
+ 存盘被使用前设置这个变量。这里是一个示例:
+
+ map --memdisk-raw=1
+ map --mem (hd0,0)/floppy.img (fd0)
+ map --hook
+ chainloader (fd0)+1
+ rootnoverify (fd0)
+ boot
+
+ 如果你碰到内存驱动器故障而又没有使用map --memdisk-raw=1时,你应当用
+ ‘map --memdisk-raw=1’来尝试一次。
+
+ 你一执行‘map --memdisk-raw=0’之后,就应该执行一次‘map --unhook’
+ (如果需要的话在这之后再执行‘map --hook’)。
+
+ 更新:memdisk_raw 现在默认值为1 。如果你希望使用中断int15/87h来访问内存
+ 驱动器,你应当令‘map --memdisk-raw=0 ’。
+
+--------------------------------------------------------
+
+ 任意大小的软盘或硬盘可以被 GRUB for DOS 0.2.0 版仿真。
+ 镜像文件必须是连续的,否则GRUB for DOS 将拒绝执行。
+ ‘blocklist’命令可以列举一个文件的碎片或者分块。
+ 在GRUB提示符下输入“help map”可以获得简要的命令说明。
+
+ 这样的形式
+ map ... (fd?)
+ 是一个软盘仿真,而下面的形式
+ map ... (hd?)
+ 是一个硬盘仿真。
+
+ 使用硬盘仿真时,基于安全因素最好不要去启动Windows 。
+ Windows甚至可能会破坏掉所有的数据和你硬盘上的所有资料!!!!!!!!
+
+ 关于--mem的更新 :当使用--mem时,甚至是在进入Windows的时候,它看
+ 来都相当安全。Win98可以正常运行内存驱动器。
+ Windows NT/2000/XP不能识别仿真的驱动器,不管是否使用了--mem选项。
+
+******************************************************************************
+*** grldr可启动的软盘或硬盘分区的说明 ***
+******************************************************************************
+1. Ext2 引导扇区/引导记录的布局 (用于载入grldr)
+
+------------------------------------------------------------------------------
+一个EXT2/EXT3的卷可以是GRUB可启动的。复制grldr和可选的menu.lst文件到这个EXT2/EXT3
+卷的根目录,并按照grldr的第五扇区建立它的引导扇区(一些需要更改的字段在下面的表
+中做了详细注释)。那么,这个EXT2/EXT3的卷就是GRUB可启动的。
+
+更新: bootlace.com是一个dos/linux下的工具,它可以把GRLDR的引导记录安装到一个
+ EXT2/EXT3卷的第一扇区。
+
+偏移 长度 说明
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+ 近转移指令的机器码
+
+02h 1 LBA indicator. Valid values are 0x02 for CHS mode, or 0x42 for
+ LBA mode.
+ LBA指示码。CHS模式时,有效值是0x02;LBA模式时有效值为0x42。
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x42.
+ 如果BIOS的int13支持LBA,此字节可以安全地设置为0x42。
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x42. It seems that
+ (generally) all USB BIOSes have LBA support.
+ 某些 USB 设备的BIOS在使用CHS寻址模式时可能有缺陷,所以格式化程
+ 序应当设置这个字节为0X42 。似乎所有(多数)的USB BIOS都能支持LBA 。
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+ 如果格式化程序不知道BIOS是否具有LBA支持,它可以采用以下方法:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x42,
+ otherwise, set to 0x02.
+ 如果(分区的起始地址加上分区的总扇区)超过了CHS的寻址能力。
+ (特别是当它大于1024*256*63时),调用程序应当设置此字节为0x42,
+ 否则,要设为0x02。
+
+ Note that Windows98 uses the value 0x0e as the LBA indicator.
+ 注意 Windows98 使用0x0e作为LBA指示码。
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+ 更新:LBA指示码这个字节已被忽略。引导记录能够探测BIOS的LBA支持。
+
+03h 10 OEM name string (of OS which formatted the disk).
+ Update: this field is now used for error message of "I/O error"
+ OEM 名称字符串(对该磁盘进行格式化的操作系统的名字)。
+ 更新:此字段现在被用于错误提示信息“I/O error”
+
+0Dh 1 Sectors per block. Valid values are 2, 4, 8, 16 and 32.
+ 每块扇区数。有效值是2, 4, 8, 16 和 32。
+
+0Eh 2 Bytes per block. Valid values are 0x400, 0x800, 0x1000, 0x2000
+ and 0x4000.
+ 每块字节数。有效值是0x400, 0x800, 0x1000, 0x2000 和 0x4000。
+
+10h 4 Pointers in pointers-per-block blocks, that is, number of
+ blocks covered by a double-indirect block.
+ 在pointers-per-block块中的指针数,即一个二级间接块包含的块数。
+
+ Valid values are 0x10000, 0x40000, 0x100000, 0x400000 and
+ 0x1000000.
+ 有效值是0x10000, 0x40000, 0x100000, 0x400000 和 0x1000000。
+
+14h 4 Pointers per block, that is, number of blocks covered by an
+ indirect block.
+ 每块指针数,即一个间接块包含的块数。
+
+ Valid values are 0x100, 0x200, 0x400, 0x800, 0x1000.
+ 有效值是0x100, 0x200, 0x400, 0x800, 0x1000 。
+
+18h 2 Sectors per track.
+ 每磁道的扇区数。
+
+1Ah 2 Number of heads/sides.
+ 磁头数/面数
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+ 隐藏扇区数(它们位于引导扇区之前)
+
+ Also referred to as the starting sector of the partition.
+ 也被成为是分区的起始扇区。
+
+ For floppies, it should be 0.
+ 对于软盘,它应当为0 。
+
+20h 4 Total number of sectors in the filesystem(or in the partition).
+ 文件系统中的扇区总数(或者是分区的扇区总数)。
+
+24h 1 BIOS drive number of the boot device.
+ 启动设备的 BIOS 驱动器号码。
+
+ Actually this byte is ignored for read. The boot code will
+ write DL onto this byte. The BIOS or the caller should set
+ drive number in DL.
+ 实际此字节在读入时被忽略。引导代码将把DL的值写入到此字节中。
+ BIOS或者调用程序应当在DL中设置磁盘号码。
+
+ We assume all BIOSes pass correct drive number in DL.
+ Buggy BIOSes are not supported!!
+ 我们假定所有的BIOS在DL中能传递正确的磁盘号码。
+ 糟糕的BIOS不被支持!!
+
+25h 1 Partition number of this partition on the boot drive.
+ 此分区在启动驱动器上的分区号
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+ 0, 1, 2, 3 是主分区 。4, 5, 6, ... 等等是扩展分区中的逻辑分区。
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+ 0xff代表整个磁盘。所以对于软盘,其分区号码应当是0xff 。
+
+26h 2 inode size in bytes. (Notice! We use the formerly reserved
+ word here for inode size!)
+ 字节计数的索引节点大小。(注意!我们在此处为索引节点大小使用
+ 了以前被保留的一个字,即两个字节)
+
+28h 4 Number of inodes per group.
+ 每组的i节点数
+
+ Normally a 1.44M floppy has only one group, and the total
+ number of inodes is 184. So the value should be 184 or
+ greater.
+ 通常,1.44M软盘只有一个组,并且总的i节点数是184。所以此值
+ 应为184或者更大。
+
+2Ch 4 The block number for group descriptors.
+ 组描述符的块号码。
+
+ Valid values are 2 for 1024-byte blocks, and 1 otherwise.
+ 对于1024字节的块有效值是2 ,否则是1 。
+
+ The value here is equal to (s_first_data_block + 1).
+ 这里的值等于(s_first_data_block + 1)。
+
+30h 1 code for "cld"(0xFC).
+ 指令“cld”(即0xFC)。
+
+31h 2 code for "xor ax,ax"(0x31, 0xC0).
+ 指令“xor ax,ax”(即0x31,0xC0)
+
+33h 1 code for "nop"(0x90) or "cwd"(0x99)
+ 指令“nop”(即0x90)或“cwd”(即0x99)
+
+34h 458 The rest of the machine code.
+ 机器码部分。
+
+1FEh 2 Boot Signature AA55h.
+ 引导签名AA55h 。
+
+
+2. FAT12/FAT16 Boot Sector/Boot Record Layout (for loading grldr)
+2. FAT12/FAT16 引导扇区/引导记录的布局 (用于载入grldr)
+
+------------------------------------------------------------------------------
+A FAT12/16 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
+the root dir of the FAT12/16 volume, and build the boot sector based on the
+fourth sector of grldr(some fields need to be changed as detailed in the
+following table). And then the FAT12/16 volume is GRUB-bootable.
+一个FAT12/16的卷是GRUB可启动的。复制grldr和可选的menu.lst文件到这个FAT12/16 卷
+的根目录,并按照grldr的第四扇区建立它的引导扇区(一些需要更改的字段在下面的表中
+做了详细注释)。然后这个FAT12/16的卷就是GRUB可启动的。
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the boot sector of an FAT12/16 volume.
+更新: bootlace.com 是一个dos/linux下的工具,而它能把GRLDR的引导记录安装到一个
+ FAT12/16卷的引导扇区。
+
+Offset Length Description
+偏移 长度 说明
+
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+ 近转移指令的机器码
+
+02h 1 LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
+ LBA mode.
+ LBA指示码。CHS模式时,有效值为0x90;LBA模式时,有效值为0x0e 。
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x0e.
+ 如果BIOS int13支持LBA,此字节可以安全地设置为0x0e 。
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x0e. It seems that
+ (generally) all USB BIOSes have LBA support.
+ 某些USB设备的BIOS在使用CHS寻址模式时可能有缺陷,所以格式化程序
+ 应当设置这个字节为0X0e 。似乎所有的(多数)USB BIOS都能支持 LBA 。
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+ 如果格式化程序不知道BIOS是否具有LBA支持,它可以采用以下方法:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x0e,
+ otherwise, set to 0x90.
+ 如果(分区的起始地址加上分区的总扇区)超过了CHS 的寻址能力。
+ (特别是当它大于1024*256*63),调用程序应当设置此字节为0x0e,
+ 否则,要设为0x90。
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+ 更新:LBA 指示码这个字节已被忽略。引导记录能探测BIOS的LBA支持。
+
+ Update(2006-07-31): Though GRLDR won't use this LBA-indicator
+ byte, Windows 98 uses it. Usually this byte should be 0x90 for
+ CHS mode(especially for floppies). If this byte is not set
+ properly, Windows 98 will not recognize the floppy or
+ partition. This problem was reported by neiljoy. Many thanks!
+ 更新 (2006-07-31):尽管GRLDR不再使用LBA指示码这个字节,
+ 但Windows 98会使用它。通常这个字节在 CHS 模式中应当设置为0x90
+ (软盘尤其如此)。如果此字节未被正确设置,Windows 98将不能识别
+ 软盘或分区。这一问题由neiljoy先生报告。非常感谢!
+
+03h 8 OEM name string (of OS which formatted the disk).
+ OEM名称字符串 (对该磁盘进行格式化的操作系统的名称)
+
+0Bh 2 Bytes per sector. Must be 512.
+ 每扇区字节数。必须为512 。
+
+0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
+ and 128. But a cluster size larger than 32K should not occur.
+ 每簇的扇区数。有效值是1, 2, 4, 8, 16, 32, 64和128 。但是簇大小
+ 大于32K的情况不应发生。
+
+0Eh 2 Reserved sectors(number of sectors before the first FAT,
+ including the boot sector), usually 1.
+ 保留的扇区数(第一文件分配表之前的扇区数,包括引导扇区),通常是1。
+
+10h 1 Number of FATs(nearly always 2).
+ 文件分配表数(几乎总是2)。
+
+11h 2 Maximum number of root directory entries.
+ 根目录项的最大个数。
+
+13h 2 Total number of sectors (for small disks only, if the disk is
+ too big this is set to 0 and offset 20h is used instead).
+ 扇区总数(仅用于小磁盘,如果磁盘太大此处被设置为0,而偏移 20h 处
+ 则替代它使用)。
+
+15h 1 Media descriptor byte, pretty meaningless now (see below).
+ 媒体描述符字节,现在该此节已经没有太大意义了(参见后面)。
+
+16h 2 Sectors per FAT.
+ 每个文件分配表的扇区数。
+
+18h 2 Sectors per track.
+ 每个磁道的扇区数
+
+1Ah 2 Total number of heads/sides.
+ 磁头或面的总数。
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+ 隐藏扇区数(位于引导扇区之前)。
+
+ Also referred to as the starting sector of the partition.
+ 也被称为是分区的开始扇区。
+
+ For floppies, it should be 0.
+ 对于软盘,它应当为0 。
+
+20h 4 Total number of sectors for large disks.
+ 大磁盘的扇区总数。
+
+24h 1 BIOS drive number of the boot device.
+ 引导设备的BIOS磁盘号。
+
+ Actually this byte is ignored for read. The boot code will
+ write DL onto this byte. The BIOS or the caller should set
+ drive number in DL.
+ 实际此字节在读入时被忽略。引导代码将把DL中的值写入此字节。
+ BIOS或者调用程序应当在DL中设置磁盘号码。
+
+ We assume all BIOSes pass correct drive number in DL.
+ Buggy BIOSes are not supported!!
+ 我们假定所有的BIOS在DL中能传递正确的磁盘号码。
+ 糟糕的BIOS不被支持!!
+
+25h 1 Partition number of this filesystem in the boot drive.
+ 启动驱动器上此文件系统的分区号码。
+
+ This byte is ignored for read. The boot code will write
+ partition number onto this byte. See offset 41h below.
+ 此字节在读入时被忽略。引导代码将分区号码写到此字节。
+ 见下述偏移41h 。
+
+26h 1 Signature (must be 28h or 29h to be recognised by NT).
+ 签名(必须是28h或者29h以便能被 NT 识别)
+
+27h 4 Volume serial number.
+ 卷的序列号。
+
+2Bh 11 Volume label.
+ 卷标签。
+
+36h 8 File system ID. "FAT12 ", "FAT16 " or "FAT ".
+ 文件系统ID。“FAT12”, “FAT16”或 “FAT”。
+
+3Eh 1 code for "cli".
+ 指令“cli”。
+
+3Fh 1 code for "cld".
+ 指令“cld”。
+
+40h 1 code for "mov dh, imm8".
+ 指令“mov dh, imm8”。
+
+41h 1 Partition number of this partition on the boot drive.
+ 此分区在启动驱动器的分区号。
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+ 0, 1, 2, 3 是主分区。4, 5, 6, ... 等等是扩展分区中的逻辑分区。
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+ 0xff代表整个磁盘。所以对于软盘,其分区号码应当是0xff 。
+
+42h 442 The rest of the machine code.
+ 机器码部分。
+
+1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
+ 引导签名AA550000h 。(Win9x 使用4字节作为魔数值。)
+
+
+3. FAT32 Boot Sector/Boot Record Layout (for loading grldr)
+3. FAT32 引导扇区/引导记录的布局 (用于载入grldr)
+
+------------------------------------------------------------------------------
+A FAT32 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
+the root dir of the FAT32 volume, and build the boot sector based on the
+third sector of grldr(some fields need to be changed as detailed in the
+following table). And then the FAT32 volume is GRUB-bootable.
+一个FAT32的卷是GRUB可启动的。复制grldr和可选的menu.lst文件到这个FAT32卷的根
+目录,并按照grldr的第三扇区建立它的引导扇区(一些需要更改的字段在下面的表中
+做了详细注释)。然后这个FAT32的卷就是GRUB可启动的。
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the boot sector of an FAT32 volume.
+更新: bootlace.com 是一个dos及linux下的工具而它能把 GRLDR 的引导记录安装
+ 到一个FAT32卷的引导扇区。
+
+
+Offset Length Description
+偏移 长度 说明
+
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+ 近转移指令的机器码。
+
+02h 1 LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
+ LBA mode.
+ LBA指示码。CHS模式时,有效值为0x90,而LBA模式时,有效值为0x0e。
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x0e.
+ 如果BIOS的int13支持LBA,此字节可以安全地设置为0x0e。
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x0e. It seems that
+ (generally) all USB BIOSes have LBA support.
+ 某些USB设备的BIOS在使用CHS寻址模式时可能有缺陷,所以格式化程
+ 序应当设置这个字节为0X0e。似乎所有(多数)的USB BIOS都能支持LBA 。
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+ 如果格式化程序不知道BIOS是否具有LBA支持,它可以采用以下方法:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x0e,
+ otherwise, set to 0x90.
+ 如果(分区的起始地址加上分区的总扇区)超过了CHS 的寻址能力。
+ (特别是当它大于1024*256*63),调用程序应当设置此字节为0x0e,
+ 否则,要设为0x90。
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+ 更新: LBA 指示码这个字节已被忽略。引导记录能探测BIO的LBA支持。
+
+ Update(2006-07-31): Though GRLDR won't use this LBA-indicator
+ byte, Windows 98 uses it. Usually this byte should be 0x90 for
+ CHS mode(especially for floppies). If this byte is not set
+ properly, Windows 98 will not recognize the floppy or
+ partition. This problem was reported by neiljoy. Many thanks!
+ 更新 (2006-07-31):尽管GRLDR不再使用 LBA 指示码这个字节,
+ 但Windows 98会使用它。通常这个字节在 CHS 模式中应当设置为0x90
+ (软盘尤其如此)。如果此字节未被正确设置,Windows 98 将不能识别
+ 软盘或分区。这一问题由neiljoy先生报告。非常感谢!
+
+03h 8 OEM name string (of OS which formatted the disk).
+ OEM名称字符串 (对该磁盘进行格式化的操作系统的名称)
+
+0Bh 2 Bytes per sector. Must be 512.
+ 每扇区字节数。必须为512 。
+
+0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
+ and 128. But a cluster size larger than 32K should not occur.
+ 每簇的扇区数。有效值是1, 2, 4, 8, 16, 32, 64 和 128 。
+ 但是簇大小大于32K的情况不应发生。
+
+0Eh 2 Reserved sectors(number of sectors before the first FAT,
+ including the boot sector), usually 1.
+ 保留的扇区数(第一文件分配表之前的扇区数,包括引导扇区),
+ 通常是1 。
+
+10h 1 Number of FATs(nearly always 2).
+ 文件分配表数(几乎总是2)。
+
+11h 2 (Maximum number of root directory entries)Must be 0.
+ (根目录项的最大个数)必须为0 。
+
+13h 2 (Total number of sectors for small disks only)Must be 0.
+ (仅用于小磁盘的扇区总数)必须为0 。
+
+15h 1 Media descriptor byte, pretty meaningless now (see below).
+ 媒体描述符字节,现在该此节已经没有太大意义了(参见后面)。
+
+16h 2 (Sectors per FAT)Must be 0.
+ (每个文件分配表的扇区数)必须为0 。
+
+18h 2 Sectors per track.
+ 每个磁道的扇区数
+
+1Ah 2 Total number of heads/sides.
+ 磁头或面的总数。
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+ 隐藏扇区数(它们位于引导扇区之前)。
+
+ Also referred to as the starting sector of the partition.
+ 也被称作是分区的起始扇区。
+
+ For floppies, it should be 0.
+ 对于软盘,它应当为0 。
+
+20h 4 Total number of sectors for large disks.
+ 大磁盘的扇区总数。
+
+24h 4 FAT32 sectors per FAT.
+ 每个文件分配表的 FAT32 扇区数。
+
+28h 2 If bit 7 is clear then all FATs are updated, otherwise bits
+ 0-3 give the current active FAT, all other bits are reserved.
+ 如果第7位被清零,所有文件分配表将被更新,否则0-3位给出当前活
+ 动的文件分配表,所有其它位被保留。
+
+2Ah 2 High byte is major revision number, low byte is minor revision
+ number, currently both are 0.
+ 高字节是主修订号码,低字节是小修订号码,现在都是0 。
+
+2Ch 4 Root directory starting cluster.
+ 根目录起始簇。
+
+30h 2 File system information sector.
+ 文件系统信息扇区。
+
+32h 2 If non-zero this gives the sector which holds a copy of the
+ boot record, usually 6.
+ 如果非零它给出具有引导记录的备份扇区,通常是6。
+
+34h 12 Reserved, set to 0.
+ 保留,设为0 。
+
+40h 1 BIOS drive number of the boot device.
+ 启动设备的 BIOS 驱动器号码。
+
+ 80h is first HDD, 00h is first FDD.
+ 第一硬盘是80h,第一软盘是00h。
+
+ Actually this byte is ignored for read. The boot code will
+ write DL onto this byte. The BIOS or the caller should set
+ drive number in DL.
+ 实际此字节在读入时被忽略。引导代码将把DL中的值写入此字节。
+ BIOS或者调用程序应当在DL中设置磁盘号码。
+
+ We assume all BIOSes pass correct drive number in DL.
+ Buggy BIOSes are not supported!!
+ 我们假定所有的 BIOS 在DL中能传递正确的磁盘号码。
+ 糟糕的BIOS不被支持!!
+
+41h 1 Partition number of this filesystem in the boot drive.
+ 启动驱动器上此文件系统的分区号码。
+
+ This byte is ignored for read. The boot code will write
+ partition number onto this byte. See offset 5Dh below.
+ 此字节在读入时被忽略。引导代码将分区号码写到此字节。
+ 见下述的偏移5Dh 。
+
+42h 1 Signature (must be 28h or 29h to be recognised by NT).
+ 签名(必须是 28h 或者 29h 以便能被 NT 识别)
+
+43h 4 Volume serial number.
+ 卷的序列号。
+
+47h 11 Volume label.
+ 卷标签。
+
+52h 8 File system ID. "FAT32 ".
+ 文件系统标识。“FAT32 ”。
+
+5Ah 1 opcode for "cli".
+ 指令 “cli”。
+
+5Bh 1 opcode for "cld".
+ 指令 “cld” 。
+
+5Ch 1 opcode for "mov dh, imm8".
+ 指令 “mov dh, imm8”。
+
+5Dh 1 Partition number of this partition on the boot drive.
+ 此分区在启动驱动器上的分区号。
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+ 0, 1, 2, 3 是主分区。4, 5, 6, ...等等是扩展分区中的逻辑分区。
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+ 0xff 代表整个磁盘。所以对于软盘,其分区号码应当是0xff 。
+
+5Eh 414 The rest of the machine code.
+ 机器码部分。
+
+1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
+ 引导签名AA550000h 。(Win9x 使用4字节作为魔数值。)
+
+
+4. NTFS Boot Sector/Boot Record Layout (for loading grldr)
+ NTFS 引导扇区/引导记录的布局 (用于载入grldr)
+
+------------------------------------------------------------------------------
+An NTFS volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
+the root dir of the NTFS volume, and build the boot sector based on the
+6th-9th sectors of grldr(some fields need to be changed as detailed in the
+following table). And then the NTFS volume is GRUB-bootable.
+一个FAT32的卷是GRUB可启动的。复制grldr和可选的menu.lst文件到这个FAT32卷的根
+目录,并按照grldr的第6至9扇区建立它的引导扇区(一些需要更改的字段在下面的表
+中做了详细注释)。然后这个FAT32的卷就是GRUB可启动的。
+
+Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
+record onto the leading 4 sectors of an NTFS volume.
+更新: bootlace.com是一个在dos/linux下的工具,而它能把GRLDR的引导记录安装到
+ 一个NTFS卷的开头4个扇区。
+
+Offset Length Description
+偏移 长度 说明
+
+====== ====== ==============================================================
+00h 2 Machine code for short jump over the data.
+ 近转移指令的机器码。
+
+02h 1 LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
+ LBA mode.
+ LBA指示码。CHS模式时,有效值为0x90;LAB模式时,有效值为0x0e。
+
+ If the BIOS int13 supports LBA, this byte can be safely set to
+ 0x0e.
+ 如果BIOS的int13支持LBA,此字节可以安全地设置为0x0e 。
+
+ Some USB BIOSes might have bugs when using CHS mode, so the
+ format program should set this byte to 0x0e. It seems that
+ (generally) all USB BIOSes have LBA support.
+ 某些USB设备的BIOS在使用CHS寻址模式时可能有缺陷,所以格式化程
+ 序应当设置这个字节为0X0e 。似乎所有(多数)的USB BIOS 都能支持LBA。
+
+ If the format program does not know whether the BIOS has LBA
+ support, it may operate this way:
+ 如果格式化程序不知道BIOS是否具有LBA支持,它可以采用以下方法:
+
+ if (partition_start + total_sectors_in_partition) exceeds the
+ CHS addressing ability(especially when it is greater than
+ 1024*256*63), the caller should set this byte to 0x0e,
+ otherwise, set to 0x90.
+ 如果(分区的起始地址加上分区的总扇区)超过了CHS 的寻址能力。
+ (特别是当它大于1024*256*63),调用程序应当设置此字节为0x0e,
+ 否则,要设为0x90。
+
+ Update: this byte of LBA indicator is ignored. The boot
+ record can probe the LBA support of BIOS.
+ 更新: LBA 指示码这个字节已被忽略。引导记录能探测BIOS的LBA支持。
+
+ Update(2006-07-31): Though GRLDR won't use this LBA-indicator
+ byte, Windows 98 uses it. Usually this byte should be 0x90 for
+ CHS mode(especially for floppies). If this byte is not set
+ properly, Windows 98 will not recognize the floppy or
+ partition. This problem was reported by neiljoy. Many thanks!
+ 更新 (2006-07-31):尽管GRLDR不再使用 LBA 指示码这个字节,但
+ Windows 98会使用它。通常这个字节在 CHS 模式中应当设置为0x90
+ (软盘尤其如此)。如果此字节未被正确设置,Windows 98 将不能识别
+ 软盘或分区。这一问题由neiljoy先生报告。非常感谢!
+
+03h 8 OEM name string (of OS which formatted the disk).
+ OEM名称字符串 (对该磁盘进行格式化的操作系统的名称)
+
+0Bh 2 Bytes per sector. Must be 512.
+ 每扇区字节数。必须为512 。
+
+0Dh 1 Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
+ and 128. But a cluster size larger than 32K should not occur.
+ 每簇的扇区数。有效值是1, 2, 4, 8, 16, 32, 64 和 128 。
+ 但是簇大小大于32K的情况不应发生。
+
+0Eh 2 (Reserved sectors)Unused.
+ (保留的扇区数)未被使用。
+
+10h 1 (Number of FATs)Must be 0.
+ (文件分配表数)必须为 0 。
+
+11h 2 (Maximum number of root directory entries)Must be 0.
+ (根目录项的最大个数)必须为0 。
+
+13h 2 (Total number of sectors for small disks only)Must be 0.
+ (仅用于小磁盘的扇区总数)必须为0 。
+
+15h 1 Media descriptor byte, pretty meaningless now (see below).
+ 媒体描述符字节,现在该此节已经没有太大意义了(参见后面)。
+
+16h 2 (Sectors per FAT)Must be 0.
+ (每个文件分配表的扇区数)必须为0 。
+
+18h 2 Sectors per track.
+ 每个磁道的扇区数。
+
+1Ah 2 Total number of heads/sides.
+ 磁头/面的总数。
+
+1Ch 4 Number of hidden sectors (those preceding the boot sector).
+ 隐藏扇区数(它们位于引导扇区之前)。
+
+ Also referred to as the starting sector of the partition.
+ 也被称作是分区的起始扇区。
+
+ For floppies, it should be 0.
+ 对于软盘,它应当为0 。
+
+20h 4 (Total number of sectors for large disks)Must be 0.
+ (大磁盘的扇区总数)必须为 0 。
+
+24h 4 (FAT32 sectors per FAT) - Usually 80 00 80 00, A value of
+ 80 00 00 00 has been seen on a USB thumb drive which is
+ formatted with NTFS under Windows XP. Note this is removable
+ media and is not partitioned, the drive as a whole is NTFS
+ formatted.
+ (每个文件分配表的 FAT32 扇区数)- 通常是 80 00 80 00 ,值
+ 为80 00 00 00将被看作是由Windows XP格式化为NTFS的USB拇指碟
+
+28h 8 Number of sectors in the volume.
+ 此卷的扇区号。
+
+30h 8 LCN of VCN 0 of the $MFT.
+ $MFT的逻辑簇号。
+
+38h 8 LCN of VCN 0 of the $MFTMirr.
+ $MFTMirr的逻辑簇号。
+
+40h 4 Clusters per MFT Record.
+ 每个MFT记录的簇数。
+
+44h 4 Clusters per Index Record.
+ 每个索引的簇数。
+
+48h 8 Volume serial number.
+ 卷序列号
+
+50h 4 Checksum, usually 0.
+ 校验和,通常为 0 。
+
+54h 1 opcode for "cli".
+ 指令 “cli”。
+
+55h 1 opcode for "cld".
+ 指令 “cld”。
+
+56h 1 opcode for "mov dh, imm8".
+ 指令 “mov dh, imm8”。
+
+57h 1 Partition number of this partition on the boot drive.
+ 此分区在启动驱动器上的分区号。
+
+ 0, 1, 2, 3 are primary partitions.
+ 4, 5, 6, ... are logical partitions in the extended partition.
+ 0, 1, 2, 3 是主分区。4, 5, 6, ...等等是扩展分区中的逻辑分区。
+
+ 0xff is for whole drive. So for floppies, it should be 0xff.
+ 0xff 代表整个磁盘。所以对于软盘,其分区号码应当是0xff 。
+
+58h 420 The rest of the machine code in the first sector.
+ 机器码部分。
+
+1FCh 4 Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
+ 引导签名AA550000h 。(Win9x 使用4字节作为魔数值。)
+
+200h 1536 The rest of the machine code in the last 3 sectors.
+ 末尾 3 个扇区为机器码部分。
+
+------------------------------------------------------------------------------
+
+附录A:FAT32 的文件系统信息扇区(不用于引导grldr)
+
+Offset Length Description
+偏移 长度 说明
+====== ====== ==============================================================
+0h 4 Leading Signature 41615252h.
+ 起始处签名 41615252h 。
+
+4h 480 Reserved, set to 0.
+ 被保留,设为 0 。
+
+1E4h 4 FSI structure signature 61417272h.
+ 故障征兆指数结构签名 61417272h
+
+1E8h 4 Contains the last known count of free clusters, if this is
+ equal to FFFFFFFFh, then the count is unknown.
+ 最后已知的空闲簇数,如果它等于FFFFFFFFh,簇数是未知的。
+
+1ECh 4 Cluster number at which you should begin a search for a free
+ cluster, if this is equal to FFFFFFFFh then the field has not
+ been set.
+ 假如它等于FFFFFFFFh的话,你应当去寻找一个空闲簇的簇号码 。
+ 此字段没有被设置。
+
+1F0h 12 Reserved, set to 0.
+ 被保留,设为 0 。
+
+1FCh 4 Trailing Signature AA550000h.
+ 结尾签名AA550000h 。
+
+------------------------------------------------------------------------------
+
+Appendix B: Media Descriptor Byte(not used by grldr)
+附录B:媒体描述字节(非用于grldr)
+
+The Media descriptor byte is meaningless because of the duplications, F0h for
+example.
+此媒体描述字节没有意义,因为有些字节具有多重意义,例如 F0h 。
+
+Byte Type of disk Sectors Heads Tracks Capacity
+字节 磁盘种类 扇区 头 磁道 容量
+---- ------------ ------- ----- ------ --------
+FFh 5 1/4" 8 2 40 320KB
+FEh 5 1/4" 8 1 40 160KB
+FDh 5 1/4" 9 2 40 360KB
+FCh 5 1/4" 9 1 40 180KB
+FBh both 9 2 80 640KB
+FAh both 9 1 80 320KB
+F9h 5 1/4" 15 2 80 1200KB
+F9h 3 1/2" 9 2 80 720KB
+F0h 3 1/2" 18 2 80 1440KB
+F0h 3 1/2" 36 2 80 2880KB
+F8h hard disk NA NA NA NA
+
+******************************************************************************
+*** grldr.mbr - 怎样将grldr.mbr写到硬盘的主引导磁道 ***
+******************************************************************************
+ grldr.mbr包含能够用作主引导记录的代码。此代码负责搜索所有分区的grldr,并且在发现
+ 它后装载它。现在被支持的分区种类是:FAT12/FAT16/FAT32,NTFS,EXT2/EXT3。在扩展分区
+ 上的逻辑分区也被支持,条件是此扩展分区与微软兼容。实际上,搜索机制没有充分地测试
+ 分区类型(0x85 )的Linux 的扩展分区。
+
+怎样将 GRLDR.MBR 写到硬盘的主引导磁道?
+
+ 首先,读入 Windows 磁盘签名及分区信息字节(总共72字节,从主引导记录的偏移
+ 0x01b8到0x01ff处),并且放置到GRLDR.MBR的开始扇区的相同范围的偏移0x01b8
+ 到0x01ff处。
+
+ 如果硬盘上的主引导记录是由微软的FDISK产生的单一的扇区主引导记录,
+ 可以选择把它复制到GRLDR.MBR的第二扇区。
+
+ GRLDR.MBR的第二扇区叫作“原先的主引导记录”。当找不到GRLDR后,将从“原先的主引
+ 导记录”开始引导。
+
+ 不需要其它的步骤,当所有的上述的必要的改变已经完成后,现在只要将GRLDR.MBR写到
+ 主引导磁道。这就全部完成了。
+
+注意:主引导磁道表示的是硬盘的第一条磁道。
+
+注意:GRLDR.MBR 的自举代码只在分区的根目录寻找GRLDR。你最好把menu.lst文件和GRLDR
+放置在一起。(就是说放在和 GRLDR 相同分区的相同根目录下。)
+
+“grldr” 文件名在ext2分区中必须是小写字母,而且grldr的文件种类必须是纯普通文件。
+其它种类,例如,符号链接文件也是不行的。
+
+ 更新: bootlace.com 是一个在 DOS/LINUX 下的能把 grldr.mbr 安装到主引导记录
+ 的工具。整个grldr.mbr被嵌入到bootlace.com工具内部,因此 bootlace.com可以独
+ 立使用。参见后面。
+
+以下内容供开发人员参考.....
+******************************************************************************
+*** grldr.mbr - Details about the control bytes ***
+******************************************************************************
+ grldr.mbr - 其控制字节的详述
+
+Six bytes can be used to control the boot process of GRLDR.MBR.
+有六个字节可以控制GRLDR.MBR引导过程。
+
+Offset Length Description
+偏移量 长度 说明
+
+====== ====== ==============================================================
+02h 1 bit0=1: disable the search for GRLDR on floppy
+ bit0=0: enable the search for GRLDR on floppy
+ 第 0 位=1 :允许搜索软盘上的GRLDR 。
+ 第 0 位=0 :禁止搜索软盘上的GRLDR 。
+
+ bit1=1: disable the boot of PREVIOUS MBR with invalid
+ partition table(usually an OS boot sector)
+ bit1=0: enable the boot of PREVIOUS MBR with invalid
+ partition table(usually an OS boot sector)
+ 第 1 位=1 :禁止引导分区表无效的原主引导记录
+ (通常是一个操作系统的引导扇区)
+ 第 1 位=0 :允许引导分区表无效的原主引导记录
+ (通常是一个操作系统的引导扇区)
+
+ bit2=1: disable the feature of unconditional entrance to
+ the command-line(See below `--duce')
+ bit2=0: enable the feature of unconditional entrance to
+ the command-line(See below `--duce')
+ 第 2 位 = 1 :禁止无条件进入命令行 (见下面的`--duce')
+ 第 2 位 = 0 :允许无条件进入命令行(见下面的`--duce')
+
+ bit3=1: disable geometry tune(See below `--chs-no-tune')
+ bit3=0: enable geometry tune(See below `--chs-no-tune')
+ 第 3 位= 1 :禁止改变磁盘几何参数(见下面的 `--chs-no-tune')
+ 第 3 位= 0 :允许改变磁盘几何参数(见下面的 `--chs-no-tune')
+
+ bit4 - bit6: reserved
+ 第 4 位到第 6 位:被保留
+
+ bit7=1: try to boot PREVIOUS MBR after the search for GRLDR
+ bit7=0: try to boot PREVIOUS MBR before the search for GRLDR
+ 第 7 位=1:在搜索 GRLDR 之后尝试引导原先的主引导记录
+ 第 7 位=0:在搜索 GRLDR 之前尝试引导原先的主引导记录
+
+03h 1 timeout in seconds to wait for a key press. 0xff stands for
+ waiting all the time(endless).
+ 等待键被按下时的暂停秒数。0xff代表始终暂停(即无休止的)。
+
+
+04h 2 hot-key code. high byte is scan code, low byte is ASCII code.
+ the default value is 0x3920, which stands for the space bar.
+ if this key is pressed, GRUB will be started prior to the boot
+ of previous MBR. See "int 16 keyboard scan codes" below.
+ 热键代码。高字节是扫描码,低字节是ASCII码。默认值是0x3920,代
+ 表的是空格键。如果此键被按下,GRUB将在引导原先的主引导记录之前
+ 启动。见“ int16 键盘扫描码”。
+
+06h 1 preferred boot drive number, 0xff for no-drive
+ 优先引导的驱动器号,0xff 代表没有。
+
+07h 1 preferred partition number, 0xff for whole drive
+ 优先引导的分区号,0xff 代表整个驱动器。
+
+ if the preferred boot drive number is 0xff, the order of the
+ search for GRLDR will be:
+ 如果优先引导的驱动器号是0xff,搜索 GRLDR 的顺序是:
+
+ (hd0,0), (hd0,1), ..., (hd0,L),(L=max partition number)
+ (hd1,0), (hd1,1), ..., (hd1,M),(M=max partition number)
+ ... ... ... ... ... ... ... ...
+ (hdX,0), (hdX,1), ..., (hdX,N),(N=max partition number)
+ (X=max harddrive number)
+ (fd0)
+
+ otherwise, if the preferred boot drive number is Y(not equal to
+ 0xff) and the preferred partition number is K, then the order of
+ the search for GRLDR will be:
+ 否则,如果优先引导的驱动器号假定为Y (且不等于0xff),而优先引导
+ 的分区号为K,那么搜索 GRLDR 的顺序是:
+
+ (Y) if K=0xff; or (Y,K) otherwise
+ (hd0,0), (hd0,1), ..., (hd0,L),(L=max partition number)
+ (hd1,0), (hd1,1), ..., (hd1,M),(M=max partition number)
+ ... ... ... ... ... ... ... ...
+ (hdX,0), (hdX,1), ..., (hdX,N),(N=max partition number)
+ (X=max harddrive number)
+ (fd0)
+
+ Note: if Y < 0x80, then (Y) is floppy, else (Y) is harddrive,
+ and (Y,K) is partition number K on harddrive (Y).
+ 注意:如果Y小于0x80 ,那么这个(Y)驱动器代表软驱,否则就是硬盘驱动器。
+ 而(Y,K)代表Y号硬盘驱动器上的 k 号分区。
+
+
+******************************************************************************
+*** bootlace.com - 安装GRLDR.MBR自举代码到MBR ***
+******************************************************************************
+
+BOOTLACE.COM 能将GRLDR的引导记录安装到硬盘驱动器或硬盘映像文件的主引导记录中,
+或者安装到软盘或者软盘映像的引导扇区。
+
+用法:
+ bootlace.com [OPTIONS] DEVICE_OR_FILE
+ 选项 设备或文件
+选项:
+ --read-only 对指定的设备或文件执行所有操作,但是并不不真正地写入。
+
+ --restore-mbr 恢复原先的主引导记录。
+
+ --mbr-no-bpb 即使最靠前的是一个FAT分区,也不复制BPB表到主引导记录。
+
+ --no-backup-mbr 不复制旧的主引导记录到设备或文件的第二扇区。
+
+ --force-backup-mbr 强行复制主引导记录到设备或文件的第二扇区。
+
+ --mbr-enable-floppy 允许搜索软盘上的GRLDR 。
+
+ --mbr-disable-floppy 禁止搜索软盘上的GRLDR 。
+
+ --mbr-enable-osbr 允许引导分区表无效的原先的主引导记录(通常是
+ 操作系统的引导扇区)
+
+ --mbr-disable-osbr 禁止引导分区表无效的原先的主引导记录(通常是
+ 操作系统的引导扇区)
+
+ --duce 禁止无条件进入命令行功能。
+
+ 任何人按‘C’键都可以正常取得命令行控制台,绕
+ 过了所有的配置文件。(包括预置的配置文件)。
+ 这是一种安全漏洞。所以我们需要这一选项来禁止这
+ 种情况。
+
+ DUCE 即 Disable Unconditional Command-line Entrance
+ 的缩写,意为无条件的(或不受控的)命令行入口。
+
+ --chs-no-tune 禁止磁盘几何参数修正功能。
+
+ --boot-prevmbr-first 在搜索GRLDR之前,先尝试引导原先的主引导记录。
+
+ --boot-prevmbr-last 在搜索GRLDR之后,再尝试引导原先的主引导记录。
+
+ --preferred-drive=D 优先引导的驱动器号,驱动器号D应大于0而小于255 。
+
+ --preferred-partition=P 优先引导的分区号,分区号P应大于0 而小于255 。
+
+ --serial-number=SN 为硬盘驱动器设置一个新的序列号码。SN必须是非零的数。
+
+ --time-out=T 在引导原先的主引导记录前等待 T 秒钟。如果T是0xff,
+ 则始终等待。默认值是 5 。
+
+ --hot-key=K 如果热键被按下,在引导原先的主引导记录之前启动
+ GRUB 。K 是一个双字节的值,如同 int16/AH=1 返回
+ 到AX寄存器的值一样。高字节是扫描码,低字节是ASCII
+ 码。默认值是 0x3920,即空格键。参见“int16键盘扫描码”。
+
+ --floppy 如果设备或文件是软盘,使用这一选项。
+
+ --floppy=N 如果设备或文件是一个硬盘驱动器上的分区,使用此选项。
+ N用于指定分区号码:0 ,1,2 和 3 为主分区,而 4,5,
+ 6,...等等为逻辑分区。
+
+ --sectors-per-track=S 为--floppy 选项指定每磁道扇区数。S 应大于1且小于63,
+ 默认值是63 。
+
+ --heads=H 为--floppy选项指定磁头数,H应大于1且小于256 。默认值是255 。
+
+ --start-sector=B 为--floppy=N 选项指定隐藏扇区。
+
+ --total-sectors=C 为--floppy 选项指定总扇区数。默认值是 0 。
+
+ --lba 对--floppy 选项使用 lba 模式。如果软盘BIOS支持LBA,
+ 你可以在这里指定--lba选项。理论上所有的软盘BIOS 都
+ 支持CHS。因此你指定--chs选项更适当。如果--chs和--lba
+ 选项都未被指定,那么LBA指示码(即引导扇区的第三字节)
+ 将不被修改。
+
+ --chs 为--floppy选项使用chs模式。如果软盘BIOS不支持
+ LBA,你应当指定--chs选项。我们假定所有的软盘BIOS
+ 都能支持CHS。所以你需要指定--chs 选项更为恰当。
+ 如果既不指定--chs选项又不指定--lba选项,那么LBA
+ 指示码(即,引导扇区的第三字节)将不被改变。
+
+ --fat12 --floppy选项使用时,确认安装到FAT12系统。
+
+ --fat16 --floppy选项使用时,确认安装到FAT16系统。
+
+ --fat32 --floppy选项使用时,确认安装到FAT32系统。
+
+ --vfat --floppy选项使用时,确认安装到FAT12/16/32等系统。
+
+ --ntfs --floppy选项使用时,确认安装到NTFS系统。
+
+ --ext2 --floppy选项使用时,确认安装到EXT2系统。
+
+ --install-partition=I 将引导记录安装到指定的硬盘驱动器或硬盘映像(设备或文件)
+ 的第 I 号分区的引导区中。
+
+DEVICE_OR_FILE: 设备或者映像文件的文件名。对于DOS,BIOS驱动器号(两位的十六进制
+或三位的十进制数)可以被用来访问驱动器。BIOS驱动器号0表示第一软盘,1表示第二硬盘;
+0x80 表示第一硬盘驱动器,0x81表示第二硬盘驱动器,等等。
+
+注意:BOOTLACE.COM 仅仅是把引导代码写到MBR中。引导代码需要加载GRLDR作为GRUB启动
+过程的第二(最后)阶段。因而在BOOTLACE.COM成功执行前或者是执行后,GRLDR应当被复
+制到任一受支持分区的根目录下,当前受支持分区的文件系统类型仅有FAT12,FAT16,FAT32,
+NTFS,EXT2以及EXT3 。
+
+注意 2:如果DEVICE_OR_FILE是硬盘设备或是硬盘映像文件,它必须包含有效的分区表,
+否则,BOOTLACE.COM 将安装失败。如果设备或文件是指向软驱或者软盘映像文件,那么
+他必须包含一个受支持的文件系统(FAT12/FAT16/FAT32/NTFS/EXT2/EXT3 等之一)。
+
+注意 3:如果DEVICE_OR_FILE是软驱或软盘映像文件,而它又被格式化为EXT2或EXT3,
+那么你必须明确指定--sectors-per-track 和 --heads 选项。
+
+重要!! 如果你安装grldr的引导代码到一个软盘或者一个分区,此软盘或分区将只能从
+grldr引导 ,而你原本的IO.SYS(DOS/Win9x/Me)和NTLDR(WinNT/2K/XP)将变为不能
+引导。这是由于软盘或分区的原始引导记录被覆盖了。而把GRLDR的引导记录安装到MBR
+则没有这个问题。
+更新:在最新版本的GRUB4DOS中NTLDR,IO.SYS或KERNEL.SYS等文件,可以被直接加载。
+
+提示:如果文件名的开始是短划线(-)或数字,你可以在它前面加上目录名(./) 或 (.\)。
+
+示例:
+ 在Linux下安装GRLDR的引导代码到MBR:
+ bootlace.com /dev/hda
+
+ 在DOS下安装GRLDR的引导代码到MBR:
+ bootlace.com 0x80
+
+ 在DOS或Linux下安装GRLDR的引导代码到硬盘映像:
+ bootlace.com hd.img
+
+ 在Linux下安装GRLDR的引导代码到软盘:
+ bootlace.com --floppy --chs /dev/fd0
+
+ 在DOS下安装GRLDR的引导代码到软盘:
+ bootlace.com --floppy --chs 0x00
+
+ 在DOS或Linux下安装GRLDR的引导代码到软盘映像:
+ bootlace.com --floppy --chs floppy.img
+
+BOOTLACE.COM 无法在Windows NT/2000/XP/2003下正常运行。它被希望(和设计)用于
+DOS/Win9x和Linux中。
+
+更新:对于映像文件,在Windows NT/2000/XP/2003下,bootlace.com 可以正常使用。
+
+bootlace.com不能在 Windows NT/2000/XP/2003 中运行的原因是,bootlace.com是一个DOS工具而 Windows NT/2000/XP/2003
+不认可它对设备的访问,你可以通过WINHEX/DISKRW之类的工具来间接的完全这个操作.
+一个DISKRW的例子在这里:
+ http://bbs.znpc.net/viewthread.php?tid=5447
+
+******************************************************************************
+*** kexec-tools should be patched for the 1.101 release ***
+******************************************************************************
+ kexec-tools 应当打上1.101发布的补丁
+
+The file kexec-tools-1.101-patch is a patch to the kexec-tools-1.101 release.
+Kexec might fail to load grub.exe without this patch.
+kexec-tools-1.101-patch 是为kexec-tools-1.101发布的补丁。没有这个补丁Kexec 加载
+grub.exe 会失败。
+
+The home page of kexec-tools is:
+kexec-tools 的主页是:
+
+ http://www.xmission.com/~ebiederm/files/kexec/
+
+Note: The Linux kernel should be KEXEC enabled before kexec can be run.
+注意: 在使用 kexec 前应该使 Linux 核心支持 KEXEC 系统调用。
+
+ !! Important Update !!
+ 重要更新
+
+The patch `kexec-tools-1.101-patch' is not needed now and has been deleted.
+Even worse, it fails in `kexec -l grub.exe --initrd=imgfile'. So please
+do not use it any more.
+现在不再需要`kexec-tools-1.101-patch'补丁而且它已经被删除了。很糟糕的是,执行
+`kexec -l grub.exe --initrd=imgfile'竟会失败。所以请不要再使用它。
+
+******************************************************************************
+*** Direct transition to DOS/Win9x from within Linux ***
+******************************************************************************
+ 从Linux直接转换到DOS/Win9x
+
+使用kexec,我们能够轻易地从运行中的 Linux 系统启动到 DOS/Win9x 。
+
+假如 WIN98.IMG 是一个可引导的硬盘映像,按照如下操作:
+
+kexec -l grub.exe --initrd=WIN98.IMG --command-line="--config-file=map (rd) (hd0); map --hook; chainloader (hd0)+1; rootnoverify (hd0)"
+
+kexec -e
+
+如果DOS.IMG是一个可引导的软盘映像,按照以下方法:
+
+kexec -l grub.exe --initrd=DOS.IMG --command-line="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+
+kexec -e
+
+注意,按照这种方式,我们可以不用使用真实的 DOS/Win9x 磁盘就启动到 DOS/Win9x 。
+我们不需要FAT分区而只需要一个映像文件。
+
+我们已经注意到通过使用 kexec 和 grub.exe,Linux本身就能够成为一个大的引导管理器。
+这给安装程序或者引导程序或者初始化程序的开发者带来了方便。
+
+当然,grub.exe和可引导的磁盘映像也能够被运行中的GRUB 或LILO 或syslinux 加载。例如:
+
+1.通过 GRUB 加载:
+
+ kernel (hd0,0)/grub.exe --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+ initrd (hd0,0)/DOS.IMG
+ boot
+
+2.通过 LILO 加载:
+
+ image=/boot/grub.exe
+ label=grub.exe
+ initrd=/boot/DOS.IMG
+ append="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+
+3.通过 SYSLINUX 加载:
+
+ label grub.exe
+ kernel grub.exe
+ append initrd=DOS.IMG --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"
+
+注意:如果使用上面的‘map (rd) (...)’失败,你可以使用‘map (rd)+1 (...)’代替,
+然后再试一次。
+
+******************************************************************************
+*** Keyboard BIOS Scan Code/ASCII code tables ***
+******************************************************************************
+ 键盘 BIOS 扫描码和 ASCII 码表
+
+Keyboard bios scan code and ascii character code tables can be obtained from
+the web by, for example, googling for "3920 372A 4A2D 4E2B 352F". Here are 2
+main results:
+键盘 bios 扫描码和 ASCII 字符码表能够通过 web 网获取,例如,使用 google 查找
+"3920 372A 4A2D 4E2B 352F"。这里有两项主要的结果:
+
+1. From "http://heim.ifi.uio.no/~stanisls/helppc/scan_codes.html":
+ 转自“http://heim.ifi.uio.no/~stanisls/helppc/scan_codes.html”:
+
+INT 16 - Keyboard Scan Codes
+INT 16 - 键盘扫描码
+
+ Key Normal Shifted w/Ctrl w/Alt
+ 键位 常态 上档态 控制态 变更态
+
+ A 1E61 1E41 1E01 1E00
+ B 3062 3042 3002 3000
+ C 2E63 2E43 2E03 2E00
+ D 2064 2044 2004 2000
+ E 1265 1245 1205 1200
+ F 2166 2146 2106 2100
+ G 2267 2247 2207 2200
+ H 2368 2348 2308 2300
+ I 1769 1749 1709 1700
+ J 246A 244A 240A 2400
+ K 256B 254B 250B 2500
+ L 266C 264C 260C 2600
+ M 326D 324D 320D 3200
+ N 316E 314E 310E 3100
+ O 186F 184F 180F 1800
+ P 1970 1950 1910 1900
+ Q 1071 1051 1011 1000
+ R 1372 1352 1312 1300
+ S 1F73 1F53 1F13 1F00
+ T 1474 1454 1414 1400
+ U 1675 1655 1615 1600
+ V 2F76 2F56 2F16 2F00
+ W 1177 1157 1117 1100
+ X 2D78 2D58 2D18 2D00
+ Y 1579 1559 1519 1500
+ Z 2C7A 2C5A 2C1A 2C00
+
+ Key Normal Shifted w/Ctrl w/Alt
+ 键位 常态 上档态 控制态 变更态
+
+ 1 0231 0221 7800
+ 2 0332 0340 0300 7900
+ 3 0433 0423 7A00
+ 4 0534 0524 7B00
+ 5 0635 0625 7C00
+ 6 0736 075E 071E 7D00
+ 7 0837 0826 7E00
+ 8 0938 092A 7F00
+ 9 0A39 0A28 8000
+ 0 0B30 0B29 8100
+
+ Key Normal Shifted w/Ctrl w/Alt
+ 键位 常态 上档态 控制态 变更态
+
+ - 0C2D 0C5F 0C1F 8200
+ = 0D3D 0D2B 8300
+ [ 1A5B 1A7B 1A1B 1A00
+ ] 1B5D 1B7D 1B1D 1B00
+ ; 273B 273A 2700
+ ' 2827 2822
+ ` 2960 297E
+ \ 2B5C 2B7C 2B1C 2600 (same as Alt L)
+ , 332C 333C
+ . 342E 343E
+ / 352F 353F
+
+ Key Normal Shifted w/Ctrl w/Alt
+ 键位 常态 上档态 控制态 变更态
+
+ F1 3B00 5400 5E00 6800
+ F2 3C00 5500 5F00 6900
+ F3 3D00 5600 6000 6A00
+ F4 3E00 5700 6100 6B00
+ F5 3F00 5800 6200 6C00
+ F6 4000 5900 6300 6D00
+ F7 4100 5A00 6400 6E00
+ F8 4200 5B00 6500 6F00
+ F9 4300 5C00 6600 7000
+ F10 4400 5D00 6700 7100
+ F11 8500 8700 8900 8B00
+ F12 8600 8800 8A00 8C00
+
+ Key Normal Shifted w/Ctrl w/Alt
+ 键位 常态 上档态 控制态 变更态
+
+ BackSpace 0E08 0E08 0E7F 0E00
+ Del 5300 532E 9300 A300
+ Down Arrow 5000 5032 9100 A000
+ End 4F00 4F31 7500 9F00
+ Enter 1C0D 1C0D 1C0A A600
+ Esc 011B 011B 011B 0100
+ Home 4700 4737 7700 9700
+ Ins 5200 5230 9200 A200
+ Keypad 5 4C35 8F00
+ Keypad * 372A 9600 3700
+ Keypad - 4A2D 4A2D 8E00 4A00
+ Keypad + 4E2B 4E2B 4E00
+ Keypad / 352F 352F 9500 A400
+ Left Arrow 4B00 4B34 7300 9B00
+ PgDn 5100 5133 7600 A100
+ PgUp 4900 4939 8400 9900
+ PrtSc 7200
+ Right Arrow 4D00 4D36 7400 9D00
+ SpaceBar 3920 3920 3920 3920
+ Tab 0F09 0F00 9400 A500
+ Up Arrow 4800 4838 8D00 9800
+
+
+ 一些组合键不是在所有系统中都能获取。PS/2 包括了很多不能在PC, XT和
+ AT上获取的组合键。
+
+- To retrieve the character from a scan code logical AND the word
+ with 0x00FF.
+ 由扫描码检索出字符可以用 0x00FF 和该字符进行逻辑与操作。
+
+- see INT 16 MAKE CODES
+ 参见INT16 通码
+
+
+
+2. From "http://www.hoppie.nl/ivan/keycodes.txt":
+ 转自“http://www.hoppie.nl/ivan/keycodes.txt”:
+
+
+ Keystroke Keypress code
+--------------------------------------------------
+ Esc 011B
+ 1 0231
+ 2 0332
+ 3 0433
+ 4 0534
+ 5 0635
+ 6 0736
+ 7 0837
+ 8 0938
+ 9 0A39
+ 0 0B30
+ - 0C2D
+ = 0D3D
+ Backspace 0E08
+ Tab 0F09
+ q 1071
+ w 1177
+ e 1265
+ r 1372
+ t 1474
+ y 1579
+ u 1675
+ i 1769
+ o 186F
+ p 1970
+ [ 1A5B
+ ] 1B5D
+ Enter 1C0D
+ Ctrl **
+ a 1E61
+ s 1F73
+ d 2064
+ f 2166
+ g 2267
+ h 2368
+ j 246A
+ k 256B
+ l 266C
+ ; 273B
+ ' 2827
+ ` 2960
+ Shift **
+ \ 2B5C
+ z 2C7A
+ x 2D78
+ c 2E63
+ v 2F76
+ b 3062
+ n 316E
+ m 326D
+ , 332C
+ . 342E
+ / 352F
+ Gray * 372A
+ Alt **
+ Space 3920
+ Caps Lock **
+ F1 3B00
+ F2 3C00
+ F3 3D00
+ F4 3E00
+ F5 3F00
+ F6 4000
+ F7 4100
+ F8 4200
+ F9 4300
+ F10 4400
+ F11 8500
+ F12 8600
+ Num Lock **
+ Scroll Lock **
+ White Home 4700
+ White Up Arrow 4800
+ White PgUp 4900
+ Gray - 4A2D
+ White Left Arrow 4B00
+ Center Key 4C00
+ White Right Arrow 4D00
+ Gray + 4E2B
+ White End 4F00
+ White Down Arrow 5000
+ White PgDn 5100
+ White Ins 5200
+ White Del 5300
+ SysReq **
+ Key 45 [1] 565C
+ Enter (number keypad) 1C0D
+ Gray / 352F
+ PrtSc **
+ Pause **
+ Gray Home 4700
+ Gray Up Arrow 4800
+ Gray Page Up 4900
+ Gray Left Arrow 4B00
+ Gray Right Arrow 4D00
+ Gray End 4F00
+ Gray Down Arrow 5000
+ Gray Page Down 5100
+ Gray Insert 5200
+ Gray Delete 5300
+
+ Shift Esc 011B
+ ! 0221
+ @ 0340
+ # 0423
+ $ 0524
+ % 0625
+ ^ 075E
+ & 0826
+ * (white) 092A
+ ( 0A28
+ ) 0B29
+ _ 0C5F
+ + (white) 0D2B
+ Shift Backspace 0E08
+ Shift Tab (Backtab) 0F00
+ Q 1051
+ W 1157
+ E 1245
+ R 1352
+ T 1454
+ Y 1559
+ U 1655
+ I 1749
+ O 184F
+ P 1950
+ { 1A7B
+ } 1B7D
+ Shift Enter 1C0D
+ Shift Ctrl **
+ A 1E41
+ S 1F53
+ D 2044
+ F 2146
+ G 2247
+ H 2348
+ J 244A
+ K 254B
+ L 264C
+ : 273A
+ " 2822
+ ~ 297E
+ | 2B7C
+ Z 2C5A
+ X 2D58
+ C 2E43
+ V 2F56
+ B 3042
+ N 314E
+ M 324D
+ < 333C
+ > 343E
+ ? 353F
+ Shift Gray * 372A
+ Shift Alt **
+ Shift Space 3920
+ Shift Caps Lock **
+ Shift F1 5400
+ Shift F2 5500
+ Shift F3 5600
+ Shift F4 5700
+ Shift F5 5800
+ Shift F6 5900
+ Shift F7 5A00
+ Shift F8 5B00
+ Shift F9 5C00
+ Shift F10 5D00
+ Shift F11 8700
+ Shift F12 8800
+ Shift Num Lock **
+ Shift Scroll Lock **
+ Shift 7 (number pad) 4737
+ Shift 8 (number pad) 4838
+ Shift 9 (number pad) 4939
+ Shift Gray - 4A2D
+ Shift 4 (number pad) 4B34
+ Shift 5 (number pad) 4C35
+ Shift 6 (number pad) 4D36
+ Shift Gray + 4E2B
+ Shift 1 (number pad) 4F31
+ Shift 2 (number pad) 5032
+ Shift 3 (number pad) 5133
+ Shift 0 (number pad) 5230
+ Shift . (number pad) 532E
+ Shift SysReq **
+ Shift Key 45 [1] 567C
+ Shift Enter (number pad) 1C0D
+ Shift Gray / 352F
+ Shift PrtSc **
+ Shift Pause **
+ Shift Gray Home 4700
+ Shift Gray Up Arrow 4800
+ Shift Gray Page Up 4900
+ Shift Gray Left Arrow 4B00
+ Shift Gray Right Arrow 4D00
+ Shift Gray End 4F00
+ Shift Gray Down Arrow 5000
+ Shift Gray Page Down 5100
+ Shift Gray Insert 5200
+ Shift Gray Delete 5300
+
+ Ctrl Esc 011B
+ Ctrl 1 --
+ Ctrl 2 (NUL) 0300
+ Ctrl 3 --
+ Ctrl 4 --
+ Ctrl 5 --
+ Ctrl 6 (RS) 071E
+ Ctrl 7 --
+ Ctrl 8 --
+ Ctrl 9 --
+ Ctrl 0 --
+ Ctrl - 0C1F
+ Ctrl = --
+ Ctrl Backspace (DEL) 0E7F
+ Ctrl Tab 9400
+ Ctrl q (DC1) 1011
+ Ctrl w (ETB) 1117
+ Ctrl e (ENQ) 1205
+ Ctrl r (DC2) 1312
+ Ctrl t (DC4) 1414
+ Ctrl y (EM) 1519
+ Ctrl u (NAK) 1615
+ Ctrl i (HT) 1709
+ Ctrl o (SI) 180F
+ Ctrl p (DEL) 1910
+ Ctrl [ (ESC) 1A1B
+ Ctrl ] (GS) 1B1D
+ Ctrl Enter (LF) 1C0A
+ Ctrl a (SOH) 1E01
+ Ctrl s (DC3) 1F13
+ Ctrl d (EOT) 2004
+ Ctrl f (ACK) 2106
+ Ctrl g (BEL) 2207
+ Ctrl h (Backspace) 2308
+ Ctrl j (LF) 240A
+ Ctrl k (VT) 250B
+ Ctrl l (FF) 260C
+ Ctrl ; --
+ Ctrl ' --
+ Ctrl ` --
+ Ctrl Shift **
+ Ctrl \ (FS) 2B1C
+ Ctrl z (SUB) 2C1A
+ Ctrl x (CAN) 2D18
+ Ctrl c (ETX) 2E03
+ Ctrl v (SYN) 2F16
+ Ctrl b (STX) 3002
+ Ctrl n (SO) 310E
+ Ctrl m (CR) 320D
+ Ctrl , --
+ Ctrl . --
+ Ctrl / --
+ Ctrl Gray * 9600
+ Ctrl Alt **
+ Ctrl Space 3920
+ Ctrl Caps Lock --
+ Ctrl F1 5E00
+ Ctrl F2 5F00
+ Ctrl F3 6000
+ Ctrl F4 6100
+ Ctrl F5 6200
+ Ctrl F6 6300
+ Ctrl F7 6400
+ Ctrl F8 6500
+ Ctrl F9 6600
+ Ctrl F10 6700
+ Ctrl F11 8900
+ Ctrl F12 8A00
+ Ctrl Num Lock --
+ Ctrl Scroll Lock --
+ Ctrl White Home 7700
+ Ctrl White Up Arrow 8D00
+ Ctrl White PgUp 8400
+ Ctrl Gray - 8E00
+ Ctrl White Left Arrow 7300
+ Ctrl 5 (number pad) 8F00
+ Ctrl White Right Arrow 7400
+ Ctrl Gray + 9000
+ Ctrl White End 7500
+ Ctrl White Down Arrow 9100
+ Ctrl White PgDn 7600
+ Ctrl White Ins 9200
+ Ctrl White Del 9300
+ Ctrl SysReq **
+ Ctrl Key 45 [1] --
+ Ctrl Enter (number pad) 1C0A
+ Ctrl / (number pad) 9500
+ Ctrl PrtSc 7200
+ Ctrl Break 0000
+ Ctrl Gray Home 7700
+ Ctrl Gray Up Arrow 8DE0
+ Ctrl Gray Page Up 8400
+ Ctrl Gray Left Arrow 7300
+ Ctrl Gray Right Arrow 7400
+ Ctrl Gray End 7500
+ Ctrl Gray Down Arrow 91E0
+ Ctrl Gray Page Down 7600
+ Ctrl Gray Insert 92E0
+ Ctrl Gray Delete 93E0
+
+ Alt Esc 0100
+ Alt 1 7800
+ Alt 2 7900
+ Alt 3 7A00
+ Alt 4 7B00
+ Alt 5 7C00
+ Alt 6 7D00
+ Alt 7 7E00
+ Alt 8 7F00
+ Alt 9 8000
+ Alt 0 8100
+ Alt - 8200
+ Alt = 8300
+ Alt Backspace 0E00
+ Alt Tab A500
+ Alt q 1000
+ Alt w 1100
+ Alt e 1200
+ Alt r 1300
+ Alt t 1400
+ Alt y 1500
+ Alt u 1600
+ Alt i 1700
+ Alt o 1800
+ Alt p 1900
+ Alt [ 1A00
+ Alt ] 1B00
+ Alt Enter 1C00
+ Alt Ctrl **
+ Alt a 1E00
+ Alt s 1F00
+ Alt d 2000
+ Alt f 2100
+ Alt g 2200
+ Alt h 2300
+ Alt j 2400
+ Alt k 2500
+ Alt l 2600
+ Alt ; 2700
+ Alt ' 2800
+ Alt ` 2900
+ Alt Shift **
+ Alt \ 2B00
+ Alt z 2C00
+ Alt x 2D00
+ Alt c 2E00
+ Alt v 2F00
+ Alt b 3000
+ Alt n 3100
+ Alt m 3200
+ Alt , 3300
+ Alt . 3400
+ Alt / 3500
+ Alt Gray * 3700
+ Alt Space 3920
+ Alt Caps Lock **
+ Alt F1 6800
+ Alt F2 6900
+ Alt F3 6A00
+ Alt F4 6B00
+ Alt F5 6C00
+ Alt F6 6D00
+ Alt F7 6E00
+ Alt F8 6F00
+ Alt F9 7000
+ Alt F10 7100
+ Alt F11 8B00
+ Alt F12 8C00
+ Alt Num Lock **
+ Alt Scroll Lock **
+ Alt Gray - 4A00
+ Alt Gray + 4E00
+ Alt 7 (number pad) #
+ Alt 8 (number pad) #
+ Alt 9 (number pad) #
+ Alt 4 (number pad) #
+ Alt 5 (number pad) #
+ Alt 6 (number pad) #
+ Alt 1 (number pad) #
+ Alt 2 (number pad) #
+ Alt 3 (number pad) #
+ Alt Del --
+ Alt SysReq **
+ Alt Key 45 [1] --
+ Alt Enter (number pad) A600
+ Alt / (number pad) A400
+ Alt PrtSc **
+ Alt Pause **
+ Alt Gray Home 9700
+ Alt Gray Up Arrow 9800
+ Alt Gray Page Up 9900
+ Alt Gray Left Arrow 9B00
+ Alt Gray Right Arrow 9D00
+ Alt Gray End 9F00
+ Alt Gray Down Arrow A000
+ Alt Gray Page Down A100
+ Alt Gray Insert A200
+ Alt Gray Delete A300
+
+ -------------------------------------------------------------------------
+
+Footnotes
+脚注
+ [1] In the United States, the 101/102-key keyboard is shipped
+ with 101 keys. Overseas versions have an additional key
+ sandwiched between the left Shift key and the Z key. This
+ additional key is identified by IBM (and in this table) as
+ "Key 45."
+ 在美国,101/102键键盘有101 个键。海外版本有一个附加的键,夹在
+ 左上档键和Z 键之间。此附加键是由IBM 确定的(在本表中是 45 键)。
+
+ [**] Keys and key combinations marked ** are used by the ROM BIOS
+ but do not put values into the keyboard buffer.
+ 键及键组合若有 ** 标记,则被ROM BIOS所使用,但不会将键值放入键盘
+ 缓冲区。
+
+ [--] Keys and key combinations marked -- are ignored by the ROM
+ BIOS.
+ 键及键组合若有 -- 标记,则被ROM BIOS所忽略。
+
+
+
+3. From "http://heim.ifi.uio.no/~stanisls/helppc/make_codes.html":
+ 转自“http://heim.ifi.uio.no/~stanisls/helppc/make_codes.html”:
+
+INT 9 - Hardware Keyboard Make/Break Codes
+INT 9 - 硬件键盘的通/断码
+
+ Key Make Break Key Make Break
+ 键位 通码 断码 键位 通码 断码
+
+ Backspace 0E 8E F1 3B BB
+ Caps Lock 3A BA F2 3C BC
+ Enter 1C 9C F3 3D BD
+ Esc 01 81 F4 3E BE
+ Left Alt 38 B8 F7 41 C1
+ Left Ctrl 1D 9D F5 3F BF
+ Left Shift 2A AA F6 40 C0
+ Num Lock 45 C5 F8 42 C2
+ Right Shift 36 B6 F9 43 C3
+ Scroll Lock 46 C6 F10 44 C4
+ Space 39 B9 F11 57 D7
+ Sys Req (AT) 54 D4 F12 58 D8
+ Tab 0F 8F
+
+ Keypad Keys Make Break
+ 数字小键盘键位 通码 断码
+
+ Keypad 0 (Ins) 52 D2
+ Keypad 1 (End) 4F CF
+ Keypad 2 (Down arrow) 50 D0
+ Keypad 3 (PgDn) 51 D1
+ Keypad 4 (Left arrow) 4B CB
+ Keypad 5 4C CC
+ Keypad 6 (Right arrow) 4D CD
+ Keypad 7 (Home) 47 C7
+ Keypad 8 (Up arrow) 48 C8
+ Keypad 9 (PgUp) 49 C9
+ Keypad . (Del) 53 D3
+ Keypad * (PrtSc) 37 B7
+ Keypad - 4A CA
+ Keypad + 4E CE
+
+ Key Make Break Key Make Break
+ 键位 通码 断码 键位 通码 断码
+
+ A 1E 9E N 31 B1
+ B 30 B0 O 18 98
+ C 2E AE P 19 99
+ D 20 A0 Q 10 90
+ E 12 92 R 13 93
+ F 21 A1 S 1F 9F
+ G 22 A2 T 14 94
+ H 23 A3 U 16 96
+ I 17 97 V 2F AF
+ J 24 A4 W 11 91
+ K 25 A5 X 2D AD
+ L 26 A6 Y 15 95
+ M 32 B2 Z 2C AC
+
+ Key Make Break Key Make Break
+ 键位 通码 断码 键位 通码 断码
+
+ 1 02 82 - 0C 8C
+ 2 03 83 = 0D 8D
+ 3 04 84 [ 1A 9A
+ 4 05 85 ] 1B 9B
+ 5 06 86 ; 27 A7
+ 6 07 87 ' 28 A8
+ 7 08 88 ` 29 A9
+ 8 09 89 \ 2B AB
+ 9 0A 8A , 33 B3
+ 0 0B 8B . 34 B4
+ / 35 B5
+
+
+Enhanced Keyboard Keys (101/102 keys)
+键盘扩展键 (101/102 键)
+
+ Control Keys Make Break
+ 控制键 通码 断码
+
+ Alt-PrtSc (SysReq) 54 D4
+ Ctrl-PrtSc E0 37 E0 B7
+ Enter E0 1C E0 9C
+ PrtSc E0 2A E0 37 E0 B7 E0 AA
+ Right Alt E0 38 E0 B8
+ Right Ctrl E0 1D E0 9D
+ Shift-PrtSc E0 37 E0 B7
+ / E0 35 E0 B5
+ Pause E1 1D 45 E1 9D C5 (not typematic)
+ Ctrl-Pause (Ctrl-Break) E0 46 E0 C6 (not typematic)
+
+ - Keys marked as "not typematic" generate one stream of bytes
+ without corresponding break scan code bytes (actually the
+ break codes are part of the make code).
+ 键位是以未使用断码扫描码字节信息的“非机器自动连续打印的"所
+ 生成的一种扫描码字节流来标记的。(实际上断码是通码的一部分)
+ (译注:typematic 有人翻译为‘机打’)
+
+
+ Normal Mode or
+ Shift w/Numlock
+ 常态或上档态及
+ 数字键盘锁定态模式
+
+ Key Make Break |----- Numlock on ------.
+ 数字键盘锁定
+ Make Break
+ 键位 通码 断码 通码 断码
+
+ Del E0 53 E0 D3 E0 2A E0 53 E0 D3 E0 AA
+ Down arrow E0 50 E0 D0 E0 2A E0 50 E0 D0 E0 AA
+ End E0 4F E0 CF E0 2A E0 4F E0 CF E0 AA
+ Home E0 47 E0 C7 E0 2A E0 47 E0 C7 E0 AA
+ Ins E0 52 E0 D2 E0 2A E0 52 E0 D2 E0 AA
+ Left arrow E0 4B E0 CB E0 2A E0 4B E0 CB E0 AA
+ PgDn E0 51 E0 D1 E0 2A E0 51 E0 D1 E0 AA
+ PgUp E0 49 E0 C9 E0 2A E0 49 E0 C9 E0 AA
+ Right arrow E0 4D E0 CD E0 2A E0 4D E0 CD E0 AA
+ Up arrow E0 48 E0 C8 E0 2A E0 48 E0 C8 E0 AA
+
+ Key |--Left Shift Pressed--. |--Right Shift Pressed--.
+ 键位 左上档键按下时 右上档键按下时
+
+ Make Break Make Break
+ 通码 断码 通码 断码
+
+ Del E0 AA E0 53 E0 D3 E0 2A E0 B6 E0 53 E0 D3 E0 36
+ Down arrow E0 AA E0 50 E0 D0 E0 2A E0 B6 E0 50 E0 D0 E0 36
+ End E0 AA E0 4F E0 CF E0 2A E0 B6 E0 4F E0 CF E0 36
+ Home E0 AA E0 47 E0 C7 E0 2A E0 B6 E0 47 E0 C7 E0 36
+ Ins E0 AA E0 52 E0 D2 E0 2A E0 B6 E0 52 E0 D2 E0 36
+ Left arrow E0 AA E0 4B E0 CB E0 2A E0 B6 E0 4B E0 CB E0 36
+ PgDn E0 AA E0 51 E0 D1 E0 2A E0 B6 E0 51 E0 D1 E0 36
+ PgUp E0 AA E0 49 E0 C9 E0 2A E0 B6 E0 49 E0 C9 E0 36
+ Right arrow E0 AA E0 4D E0 CD E0 2A E0 B6 E0 4D E0 CD E0 36
+ Up arrow E0 AA E0 48 E0 C8 E0 2A E0 B6 E0 48 E0 C8 E0 36
+ / E0 AA E0 35 E0 B5 E0 2A E0 B6 E0 35 E0 B5 E0 36
+
+
+ - The PS/2 models have three make/break scan code sets. The first
+ set matches the PC & XT make/break scan code set and is the one
+ listed here. Scan code sets are selected by writing the value F0
+ to the keyboard via the 8042 (port 60h). The following is a brief
+ description of the scan code sets (see the PS/2 Technical Reference
+ manuals for more information on scan code sets 2 and 3):
+ PS/2 类型有三套通断扫描码。其中第一套是适用于PC & XT 的通断码扫描码集,
+ 并列在了这里。扫描码集可以通过向8042 键盘控制器(端口60)写入值 F0 来
+ 选择。下面是扫描码集的简要介绍(更多第2,3套扫描码集的信息见PS/2 技术
+ 参考手册)
+
+ / set 1, each key has a base scan code. Some keys generate
+ extra scan codes to generate artificial shift states. This
+ is similar to the standard scan code set used on the PC and XT.
+ 第一套扫描码集,每个键具有一个基本的扫描码。一些键产生扩展扫
+ 描码以便人工生成上档状态。它与 PC 和 XT 机上的标准扫描码相似。
+
+ / set 2, each key sends one make scan code and two break scan
+ codes bytes (F0 followed by the make code). This scan code
+ set is available on the IBM AT also.
+ 第二套扫描码集,每个键发送一个通码扫描码和两个断码扫描码字节
+ (通码在F0之后)。这套扫描码集在 IBM AT 机上也有效。
+
+ / set 3, each key sends one make scan code and two break scan
+ codes bytes (F0 followed by the make code) and no keys are
+ altered by Shift/Alt/Ctrl keys.
+ 第三套扫描码集,每个键发送一个通码扫描码和两个断码扫描码字节
+ (通码在F0之后)并且键位不随 Shift/Alt/Ctrl 等键的使用而改变。
+
+ / typematic scan codes are the same as the make scan code
+ “非机器自动连续打印的”扫描码和通码扫描码是相同的。
+
+ - Some Tandy 1000's do not handle Alt key combinations when multiple
+ shift keys are pressed. The Alt-Shift-H combination loses the Alt.
+ 一些 Tandy 1000 机器在多重组合键的 shift 键被按下时不能处理 ALT 键。
+ 使用键组合 Alt-Shift-H 时会丢失 ALT 键。
+
+ - extended keys like (F11, F12) can only be read with systems that
+ have extended keyboard BIOS support (or INT 9 extensions); to
+ read these special keys on these systems INT 16,10 must be used
+ 扩展键比如(F11,F12)等只能在具有 BIOS 键盘扩展支持(或 INT 9 扩展)
+ 的系统上被读取。用INT16读取这些系统上的特别的键时,必须使用10号功能 。
+
+
+******************************************************************************
+*** GRLDR Error messages ***
+******************************************************************************
+ GRLDR 错误提示信息
+
+1. Missing MBR-helper.
+ 缺少主引导辅助记录。
+
+ 紧接在主引导记录后的辅助功能程序不见了,或者是它已经被病毒或 Windows
+ XP/Vista等删除了。
+
+ 运行 bootlace.com 工具来解决这个问题。
+
+2. Buggy BIOS!
+ 缺陷太多的BIOS!
+
+ 你的 BIOS 太糟糕了。它甚至不能支持 INT 13/AH=8 。
+
+ 除了升级你的 BIOS 没有办法解决。未来,缺陷多的 BIOS 将会很常见而且
+ 会对 grub4dos 造成很多问题。
+
+3. This partition is NTFS but with unknown boot record. Please install
+Microsoft NTFS boot sectors to this partition correctly, or create an
+FAT12/16/32 partition and place the same copy of GRLDR and MENU.LST there.
+此分区系统是 NTFS 但包含未知的引导记录。请安装正确的微软 NTFS 引导扇区到
+这个分区,或者建立一个FAT12/16/32的分区并将GRLDR 及MENU.LST 的相同的备份
+文件放到那里。
+
+ The boot record was changed or erased by Microsoft Windows XP Service
+ Pack 2.
+ 引导记录已经被微软 Windows XP Service Pack 2 改变或删除。
+
+ You may install the old boot record introduced with the original clean
+ Windows 2K/XP. As another solution, you may create an FAT partition
+ for your system, and copy GRLDR and your MENU.LST to its root dir.
+ 你可以用原来的引导记录来安装,以清理掉Windows 2K/XP的记录。另一个解决办
+ 法是,你可以在系统上建立一个FAT分区,并且将GRLDR 和你的MENU.LST复制到它
+ 的根目录。
+
+ While the startup code of grldr might fail to load GRLDR in NTFS
+ partitions, it always successfully loads GRLDR in FAT partitions(and
+ even in ext2/ext3 partitions).
+ 在NTFS分区grldr的自举代码在加载GRLDR时可能会失败,但在FAT分区(甚至在
+ ext2/ext3分区)它总能成功加载 GRLDR 。
+
+ Note that NTLDR only loads the startup code of grldr(i.e., the leading
+ 16 sectors of grldr), not the whole grldr file.
+ 注意 NTLDR只能加载grldr的自举代码(即,grldr开头的16个扇区),而不能将
+ 整个grldr载入。
+
+
+ Thus, C:\GRLDR must exist(here C: can be NTFS), since it is used for
+ BOOT.INI and NTLDR. If C: is NTFS, X:\GRLDR should exist as well,
+ where X: stands for a certain FAT partition.
+ 因此,自从它用于 BOOT.INI 和 NTLDR 以来 ,C 盘根目录下必须存在有GRLDR
+ (这里的C盘可以是 NTFS 文件系统)。
+
+
+
+******************************************************************************
+*** Known BIOS bugs ***
+******************************************************************************
+ 已知的BIOS 缺陷
+
+1. 一些较新的 Dell 机不能支持int13/AH=43h 。当你尝试对仿真磁盘进行写访问时,
+ 可能会遭遇失败。
+
+ 注意:这个缺陷非常严重!老的安装方法"root+setup" (在实模式的grub环
+ 境中)使用INT13将stage2文件写入第一扇区。在这些有缺陷的DELL机上通过
+ LBA 模式来访问 stage2 文件时将会失败。
+
+2.一些有缺陷的BIOS不能引导启动光盘映像文件(见前面)。(虚拟机qemu 能良好的引导)
+
+3.在DOS下运行GRUB.EXE时,一些较新的 Dell 机激烈地破坏那些硬件中断请求的中断向量,
+ 而使得机器会失去响应 。你可以尝试用BADGRUB.EXE来再试一次。
+
+4.有报告称,通过Linux中的kexec启动GRUB.EXE后,一些BIOS将功能异常。报告称一些
+ 机器会死机,而另一些不能访问USB驱动器。
+
+******************************************************************************
+*** Known Problems ***
+******************************************************************************
+ 已知问题
+1. 在 Windows 9x/Me的DOS窗口运行GRUB.EXE时可能会死机,特别是在这些系统
+ 使用USB的时候。在Linux下通过KEXEC运行GRUB.EXE时,你也可能碰到同样的
+ 问题。
+
+注意: 你不能在已进入保护模式的Win 9x 中运行GRUB.EXE,那可能会死机;作为变
+ 通,你可以执行“重启并进入MS-DOS模式”选项来达到运行 GRUB.EXE 的目
+ 的,这很安全。
+
+2. 默认的chainloader动作将保持 A20 的状态。一些有缺陷的 DOS 扩展内存管理软
+ 件可能会令机器死掉。你可以在chainloader命令行中使用--disable-a20选项
+ 然后再试一次。至少,你应当避免使用那些有缺陷的内存管理软件。
+
+3. THTF BIOS L4S5M Ver 1.1a(dated 2002-1-10) has a buggy int15 which
+ causes hang at the boot of a multi boot kernel(memdisk for example).
+ OEM签名为清华同方,主板为精英L4S5M, BIOS版本1.1a(日期 2002-1-10)
+ 的机器上,其 int15 含有缺陷,当它启动一个多重引导核心时,会失去响应。
+ (比如使用syslinux的memdisk时)
+
+4. 在天汇标准中文系统中,较新的GRUB.EXE不能运行。
+ 总之,在具有反跟踪措施的内存驻留程序的系统下GRUB.EXE不再运行。
+
+******************************************************************************
+*** List of binary files and their corresponding source files ***
+******************************************************************************
+ 二进制文件及对应的源代码文件列表
+
+binary file main source file other included source or binary files
+二进制文件 源代码主文件 包含的其他源代码或二进制文件
+------------- ---------------- -------------------------------------
+
+bootlace.com bootlacestart.S bootlace.inc, grldrstart.S
+
+grldr grldrstart.S pre_stage2(binary, See note below)
+
+grldr.mbr mbrstart.S grldrstart.S
+
+grub.exe dosstart.S pre_stage2(binary, See note below)
+
+hmload.com hmloadstart.S
+
+-----------------------------------------------------------------------------
+注意:pre_stage2 是GNU GRUB的主体程序,它以二进制格式被简单的添加到grldrstart
+ 及dosstart部分,形成我们的grldr和grub.exe 。
+
+注意:GRUB (无.exe后缀)在Linux下是一个静态链接的 ELF 格式的可执行文件,它
+可以被GRUB Shell正常调用。GRUB Shell 是一个启动管理软件,但并不是一个引导装
+载器(boot 命令在GRUB Shell里不能执行)。GRUB.EXE (通过KEXEC)能作为一个引
+导装载器直接在 Linux 下使用。
+
+******************************************************************************
+*** Memory Layout for Quiting to DOS from GRUB.EXE ***
+******************************************************************************
+ GRUB.EXE 返回 DOS 时的内存布局
+
+使用 quit 命令实现返回到DOS,是在GRUB.EXE是从DOS启动的情况下。
+
+1.在GRUB.EXE 将控制权移交给 pre_stage2 之前,它将复制 640 kb的常规内存到
+ 物理地址0x200000 (即,2 M)处,并将立即写入4 字节的长整数到常规内存备
+ 份区之后:
+ At 0x2A0000: 0x50554B42, it is the "BKUP" signature.
+ 0x50554b42, 它是“BKUP”的签名 。
+
+ At 0x2A0004: Gate A20 status under DOS: non-zero means A20 on;
+ zero means A20 off. Update: A20 always on, see below.
+ DOS下的A20地址线门状态:非零表示A20开启;零表示A20
+ 地址线关闭。更新:A20 始终开启,参见后面。
+
+ At 0x2A0008: high word is boot-CS, low word is boot-IP. The quit
+ command uses this entry point to return to DOS.
+ 高字节是引导的代码段段地址,低字节是引导的指令指针值。
+ 退出命令 quit 使用这个入口点返回DOS。
+
+ At 0x2A000C: CheckSum: the sum of all long integers in the memory
+ range from 0x200000 to 0x2A000F is 0.
+ 校验和:内存范围从0x200000 到 0x2A000F的所有长整数的
+ 和为 0 。
+
+2.如果上述内存结构被某个grub命令所破坏,quit命令将发出一条错误提示信息而拒绝从grub中返回DOS。
+
+3.由于GRUB可能破坏扩展内存,在DOS下你最好避免在GRUB.EXE运行前使用扩展内存。
+
+4. Gate A20 will be enabled by GRUB.EXE. Hopefully this would hurt nothing.
+ GRUB.EXE将开启A20 地址线。真希望这不会危及任何东西。
+
+******************************************************************************
+*** Memory usage in conventional/low memory area ***
+******************************************************************************
+ 常规内存/低端内存空间的内存使用
+
+1. boot.c, fsys_reiserfs.c: 8K below 0x68000.
+
+2. fsys_ext2fs.c, fsys_minix.c: 1K below 0x68000.
+
+3. fsys_jfs.c: 4K + 256 bytes below 0x68000.
+
+4. fsys_reiserfs.c: 202 bytes at 0x600.
+
+5. fsys_xfs.c: 188 bytes at 0x600.
+
+6. fsys_xfs.c: (logical block size) bytes below 0x68000.
+
+7. geometry tune: 0x50000 - 0x5ffff.
+
+******************************************************************************
+*** Command-line Length about GRUB.EXE ***
+******************************************************************************
+ 关于GRUB.EXE的命令行长度
+
+GRUB.EXE 可以通过CONFIG.SYS中的DEVICE命令来启动:
+
+ DEVICE=grub.exe [--config-file="FILENAME_OR_COMMANDS"]
+
+1. 如果GRUB.EXE是被DEVICE命令调用而且FILENAME_OR_COMMANDS 参数是一个由分号分
+ 隔的grub命令集合,那么FILENAME_OR_COMMANDS可以接近4 KB长 ----很吃惊?但这是
+ 事实!MS-DOS 7及以上版本即使允许更长的行,但看起来4 KB对GRUB.EXE足够了。
+ 当我们希望将一个大菜单嵌入到命令行时,这是非常有用的。注意 grldr 还不支持
+ 任何命令行参数。
+
+2. 如果GRUB.EXE是被INSTALL命令调用,那么选项长度的限制是80个字符(包括开头的
+ --config-file= 这部分)。超出的话可能会立即将MS-DOS挂起。
+
+3. 如果GRUB.EXE是被SHELL命令调用,那么选项长度的的限制是126个字符(包括开头的
+ --config-file= 这部分)。超出的话虽然不会将 MS-DOS 挂起,但命令行将被截短。
+ 这和 DOS 控制台或批处理文件中命令的限制是一样的。
+
+4. DOS编辑器EDIT不支持一行4KB的长度。所以请使用其他编辑器,例如,vi for Linux 。
+
+5. DEVICE=GRUB.EXE 这一行可以和其他的DEVICE命令同时使用,如DEVICE=HIMEM.SYS
+ 及DEVICE=EMM386.EXE等。配置命令里的GRUB.EXE所在行必须出现在EMM386.EXE所在
+ 行的前面,以避免因EMM386而冲突。
+ 更新 :从0.4.2版本起,GRUB.EXE在EMM386.EXE加载后,仍然可以运行。
+
+6. 在以上提到的任何情况下,你都可以通过quit命令返回到DOS 。
+
+7. 命令行菜单的内存占用:4KB的命令行菜单起始于物理地址0x0800而终止于0x17ff。
+
+******************************************************************************
+*** New Syntax for the DEFAULT/SAVEDEFAULT Commands ***
+******************************************************************************
+ DEFAULT 及 SAVEDEFAULT 命令的新语法
+
+相对于原来的用法"default NUM"及"default saved "增加的部分,现在有一个新用
+法"default FILE",象这样:
+
+ default (hd0,0)/default
+
+注意参数FILE必须是一个有效的DEFAULT文件格式。一个简单的DEFAULT文件就包含
+在发行版中。你可以复制它到你希望的地方,但是你应该避免手工修改它的大小。
+DEFAULT文件可以按以下方法使用:
+(1) 首先,你要复制一个格式有效的default文件到你运行的系统上。
+
+(2) 其次,你要使用GRUB中的"default FILE"命令来表明是使用这个FILE作为我们新
+ 的预设文件,以便"savedefault"命令执行时写入它。
+
+
+(3) 然后,你可以使用"savedefault"命令来把想要的入口数字保存到这个新的预设文
+ 件中。
+
+(4) 下次启动时,你可以通过使用类似上面第二步骤中的"default FILE"一样的
+ 命令来读取已保存的入口数字。
+
+同时,SAVEDEFAULT 命令增加了一个选项 --wait=T ,象这样:
+
+ savedefault --wait=5
+
+如果`--wait=T' 选项被指定而且 T 非零,savedefault 命令将在它就要写入磁盘
+前,给使用者一个提示信息。
+
+这里是一个简单的menu.lst文件:
+
+#--------------------begin menu.lst---------------------------------------
+color black/cyan yellow/cyan
+timeout 30
+default /default
+
+title find and load NTLDR of Windows NT/2K/XP
+find --set-root /ntldr
+chainloader /ntldr
+savedefault --wait=2
+
+title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
+fallback 2
+find --set-root /cmldr
+chainloader /cmldr
+#####################################################################
+# write string "cmdcons" to memory 0000:7C03 in 2 steps:
+#####################################################################
+# step 1. Write 4 chars "cmdc" at 0000:7C03
+write 0x7C03 0x63646D63
+# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
+write 0x7C07 0x00736E6F
+savedefault --wait=2
+
+title find and load IO.SYS of Windows 9x/Me
+find --set-root /io.sys
+chainloader /io.sys
+savedefault --wait=2
+
+title floppy (fd0)
+chainloader (fd0)+1
+rootnoverify (fd0)
+savedefault --wait=2
+
+title find and boot Linux with menu.lst already installed
+find --set-root /sbin/init
+savedefault --wait=2
+configfile /boot/grub/menu.lst
+
+title find and boot Mandriva with menu.lst already installed
+find --set-root /etc/mandriva-release
+savedefault --wait=2
+configfile /boot/grub/menu.lst
+
+title back to dos
+savedefault --wait=2
+quit
+
+title commandline
+savedefault --wait=2
+commandline
+
+title reboot
+savedefault --wait=2
+reboot
+
+title halt
+savedefault --wait=2
+halt
+#--------------------end menu.lst---------------------------------------
+
+注意 1:预设文件 DEFAULT 必须是存在的而且具有和前面所述一样严格的格式。
+
+注意 2:在一个有 MENU.LST 文件的相同目录中的 DEFAULT 文件将和 MENU.LST 文
+ 件一起被联合调用
+
+注意 3:即使没有出现`default'命令,被关联的 DEFAULT 文件也将自动生效。
+
+注意 4:就在菜单文件(诸如,GRLDR 的关联文件MENU.LST,或是通过
+ `grub.exe --config-file=(DEVICE)/PATH/YOUR_MENU_FILE'来指定的,
+ 或是通过grub的`configfile'命令来指定的)取得控制权之前,它的
+ 关联文件DEFAULT只要出现就会被使用,直到遇见了一个明确的`default'命令。
+
+******************************************************************************
+*** The New `cdrom' Command Syntax ***
+******************************************************************************
+ 新的 `cdrom' 命令的语法
+
+1. 初始化ATAPI接口的CDROM设备:
+
+ grub> cdrom --init
+
+ 显示找到的atapi接口的cdrom光驱的数目:参数为 atapi_dev_count
+
+2. 停止ATAPI接口的CDROM设备:
+
+ grub> cdrom --stop
+
+ 这会设置参数atapi_dev_count为0 。
+
+3. 增加搜索atapi cdrom设备的IO端口。例如:
+
+ grub> cdrom --add-io-ports=0x03F601F0
+
+ 在执行`cdrom --init'以及`map --hook'命令后,cdrom光驱可以通过(cd0),
+ (cd1), ...等设备号来访问。
+
+注意 1:如果系统不完全支持ATAPI CD-ROM 规范,在你试图访问这些(cdX)设备时将
+ 遭遇失败。
+
+注意 2:在执行一条`cdrom --stop'命令后,你应当使用一条`map --unhook'命令。当然,
+ 你可以再次使用`map --hook'命令,假如还有驱动器被映射着的话。
+
+注意 3:在增加IO端口之后,你应当接着`cdrom --init'执行一条`map --unhook'命令然
+ 后再接着执行一条`map --hook'命令。
+
+ 默认将使用这些端口来搜索cdrom设备(因此不需要再添加了)
+ 0x03F601F0, 0x03760170, 0x02F600F0,
+ 0x03860180, 0x6F006B00, 0x77007300.
+
+注意 4:BIOS可能已经提供了cdrom 的接口。它的设备号总是(cd)。在 `cdrom --init'
+ 和 `map --hook' 执行后,我们可以有我们自己有效的(cd0), (cd1), ...等设备。
+
+注意 5:你可以用块列表的方式去访问(cd)和 (cdX) 等设备。例子:
+
+ cat --hex (cd0)16+2
+
+ cdrom 扇区是大小为 2048 字节的大扇区。
+
+注意 6:我们的iso9660文件系统驱动具有Rock-Ridge扩展支持,但没有Joliet扩展支持。
+ 因此当你试图在一个使用Joliet扩展的光盘上读取文件时,可能遭遇失败。
+
+注意 7:现在,(cd)及 (cdX)设备可以被引导了。示例:
+ chainloader (cd)
+ boot
+
+ chainloader (cd0)
+ boot
+
+ chainloader (cd1)
+ boot
+
+ 在chainloader (cd)之前,你必须保证已经可以访问该设备。
+
+******************************************************************************
+*** About the New `setvbe' Command ***
+******************************************************************************
+ 关于新命令 `setvbe'
+
+Gerardo Richarte contributed the `setvbe' code and the following comment:
+Gerardo Richarte 先生提供了`setvbe'的源码,下面是注释:
+
+ New command is `setvbe', and can be used to change the video mode
+ before executing the kernel.
+ `setvbe'是一个新的命令,它可以在系统核心运行前被用来改变视频模式。
+
+ For example, you can do
+ 例如,你可以执行
+
+ setvbe 1024x768x32
+
+ this will scan the list of available modes and set it, and
+ automatically append a `video=' option to each subsequent kernel
+ command-line. The appended `video=' option is like this:
+ 这会扫描出其可用模式的列表并设置它,并且自动在随后的每个kernel命令
+ 行中增加一个选项`video='。增加的选项`video='类似于:
+
+ video=1024x768x32@0xf0000000,4096
+
+ where 0xf0000000 is the video framebuffer address as reported by vbe,
+ and 4096 is the size of a scanline in bytes (also as reported by vbe).
+ 这里的0xf0000000是vbe报告的视频模式的帧缓存地址,而4096是扫描线的字节大小。
+
+ This is really useful if you want to give some graphics support to your
+ OS, but you don't want to implement any video functionality other than
+ writing a pixel to video memory.
+ 如果你想在你的操作系统上获得一些图形支持,但是除了只写一个像素点到视频内
+ 存而外,你却不想使用任何视频功能,这确实有用。
+
+
+******************************************************************************
+*** About the DOS utility `hmload' ***
+******************************************************************************
+ 关于DOS工具`hmload'
+
+此程序由 John Cobb 先生编写(伦敦玛丽皇后学院)。
+
+John Cobb先生的注释:
+
+ To make use of the ram drive feature I wrote a program `hmload' to load
+ an arbitrary file to an arbitrary address in high memory. The program
+ is not very sophisticated and relies on XMS to turn on the A20 line.
+ (Also one must be very careful to steer clear of any areas of memory
+ already in use).
+ 为了使用内存驱动器的特性,我写了一个程序“hmload”来将任意文件加载
+ 到高端内存的任意地址。这个程序不是十分深奥但依赖在XMS 里开启A20地址线。
+ (并且必须将那些已经使用了的任何内存空间精心的清理干净)
+
+ Under Linux we generated a disk image `dskimg' (with the kernel and
+ Initrd and a partition table).
+ 我们在linux下生成一个磁盘映象“dskimg”(包含kernel和initrd及一个分区表)。
+
+ Using this our boot procedure looked something like this:
+ 我们的引导过程看起来是下面这样:
+
+ hmload -fdskimg -a128
+ fixrb
+ <unload network drivers>
+ grub
+
+ map --ram-drive=0x81
+ map --rd-base=0x8000000
+ map --rd-size=0x400000
+ root (rd,0)
+ kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
+ initrd /initrd
+ boot
+
+See http://sysdocs.stu.qmul.ac.uk/sysdocs/Comment/GrubForDOS/ for details.
+详情参阅 http://sysdocs.stu.qmul.ac.uk/sysdocs/Comment/GrubForDOS/
+
+Update 2007-12-05:
+更新 2007-12-05 :
+
+ Now the MAP command can handle gzipped (rd) image. One can use this
+ feature with the hmload utility. For example,
+
+ step 1. Load the gzipped image under DOS at a relatively low address:
+ 步骤 1. 在DOS的相对较低的地址处加载gzip压缩映像:
+
+ hmload -fdskimg.gz -a16
+
+ step 2. Unload network drivers.
+ 步骤 2 卸载网络驱动器
+
+ step 3. Run GRUB.EXE.
+ 步骤 3. 运行 GRUB.EXE
+
+ step 4. At the grub prompt, run these commands:
+ 步骤 4. 在grub 命令提示符下,执行下列命令:
+
+ map --rd-base=0x1000000 # set rd-base address to be 16M
+ # 设置rd-base地址为16M
+
+ map --rd-size=<the accurate size of dskimg.gz in bytes>
+ < dsking.gz 精确的字节数 >
+
+ map (rd)+1 (hd0) # This will decompress (rd) and place
+ # the decompressed image at the top end
+ # of the extended memory. The (rd)+1
+ # here has special meaning and stands
+ # for the whole (rd) device. You must
+ # use (rd)+1 instead of (rd).
+ # 这会将(rd)解压并且把解压后的映像放到扩展内存的顶端。
+ # 这里的(rd)+1具有特定的含义而且将整个(rd)设备放到了顶端。
+ # 这里你必须使用 (rd)+1 来替代(rd)。
+ map --hook
+ root (hd0,0)
+ kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
+ initrd /initrd
+ map --unhook
+ map (hd0) (hd0) # Delete the map; this is needed.
+ # 删除map映射;这是需要的
+ boot
+
+
+******************************************************************************
+*** Notes on the use of stack ***
+******************************************************************************
+ 关于堆栈的注释
+The protected-mode and real-mode stack are merged at physical address 0x2000.
+保护模式与实模式的堆栈被合并到物理地址 0x2000 处。
+
+All functions should use at most 2K stack space(0x1800-0x2000). So each
+subfunction should use as little stack as possible to avoid stack-overflow.
+所有的功能应当最多使用 2K 的堆空间 (0x1800到0x2000)。因此各个子功能部分
+应当使用尽可能小的堆以避免堆栈溢出。
+
+Don't use recursive functions because they could expend too much stack space.
+不要使用递归功能,因为他们会消耗太多的堆空间。
+
+The original protected mode stack at 0x68000(expand-down) is free now and can
+be reused for any purposes.
+原来位于0x68000(向下延伸)的保护模式的堆现在不再使用,并且它可以被用于任何目的。
+
+
+******************************************************************************
+*** A bug was found in the CDROM driver ***
+******************************************************************************
+ CDROM 驱动器上发现的缺陷
+
+似乎 cdrom 应当连接在IDE控制器的主设备通道上。
+
+如果 cdrom 是从设备,读取cdrom扇区的驱动将失败。希望有人能解决这个问题。
+
+******************************************************************************
+*** BIOS and the (cd) drive ***
+******************************************************************************
+ BIOS 与 (cd)驱动器
+
+当BIOS启动一个非模拟模式的可启动的CD-ROM设备时,它会分配一个BIOS驱动器号给这个
+CD设备。如果这个CD-ROM使用grldr或stage2_eltorito作为启动映像文件,那么GRUB可以
+通过BIOS分配的驱动器号来访问这个CD-ROM 媒体。
+
+BIOS 会分配一个驱动器号给非模拟模式启动的CDROM 设备,即使这个CDROM 是不能启动的。
+虚拟机QEMU就是这样处理的。在引导的时候,GRUB4DOS将搜索那些由BIOS分配的,驱动器号
+从0x80至0xFF的,可能存在的非模拟模式的CDROM 驱动器。 所以,如果BIOS为CDROM提供了
+扩展int13(功能号41h-4eh)接口,那么这个(cd)设备自动在GRUB4DOS 中有效。
+
+
+******************************************************************************
+*** The way of disk emulation changed greatly ***
+******************************************************************************
+ 磁盘仿真方式发生了巨大变化
+
+磁盘仿真方式自从0.4.2正式版之后已经发生了巨大变化。在使用磁盘仿真功能时候,
+请不要将较新的版本和旧的版本混合使用。
+
+较新的版本不会自动卸载之前已经在grub4dos环境建立的仿真盘。GRUB.EXE 的一个
+很古老的版本,在将控制权移交给grub主程序(即,pre_stage2)前,将会自动释放
+先前建立的仿真盘。
+
+
+******************************************************************************
+*** FreeDOS EMM386 v2.26 (2006-08-27) VCPI problem ***
+******************************************************************************
+ FreeDOS EMM386 版本2.26 (2006-08-27) VCPI服务的问题
+
+The VCPI function "AX=DE0Ch - Switch From Protected Mode to V86 Mode" of
+FreeDOS EMM386 v2.26 was not implemented properly(it always hangs). As an
+alternative, you can use Microsoft's EMM386 instead.
+FreeDOS 的 EMM386 版本2.26 中的VCPI服务,“功能号 AX=DE0Ch-选择从
+保护模式到虚拟8086模式”,不能正确的执行(总是死机)。选择之一是,
+你用微软的 EMM386 来代替它。
+
+Even while emm386 is running, grub.exe can be started. But if you try to quit
+to DOS from grub4dos by using the `quit' command, the VCPI function DE0C will
+be called. If EMM386 is of Microsoft, everything goes ok. If EMM386 is of
+FreeDOS, the machine will hang.
+即使emm386已经运行,grub.exe也能够启动。但是如果你试图从grub4dos中通过`quit'
+命令来返回DOS,VCPI 服务的DE0C 号功能将被调用。如果是微软的 EMM386 ,接下来的
+一切都很正常 。而如果是FreeDOS 的 EMM386 ,那么将会死机。
+
+******************************************************************************
+*** New options for map were added ***
+******************************************************************************
+ map 命令的新增选项
+
+随着0.4.2 最终版的发布,map 命令有了两个新选项。它们是--safe-mbr-hook=SMH
+以及--int13-scheme=SCH 。它们都和Win9x环境下(尽可能稳定的)使用磁盘仿真有关。
+
+SMH参数可以是0或1这个两个值之一。作为默认,SMH参数为1 。如果你在Win9x中遇到
+磁盘仿真的问题,你可以插入这样一行到`boot'命令之前,
+
+ map --safe-mbr-hook=0
+
+然后再试一次。
+
+SCH在使用时,也可以取0或1之一的值。作为默认,SCH为1 。如果你在Win9x中遇到
+磁盘仿真的问题,你可以插入这样一行到`boot'命令之前,
+
+ map --int13-scheme=0
+
+然后再试一次。
+
+顺便提醒一下。类似于--safe-mbr-hook和--int13-scheme ,MAP命令中有几个其他
+选项可被用以设置全局变量。
+
+ map --floppies=M
+
+其中的M 可以是0 , 1 或者2 。MAP 将把一个恰当的M 值设置在地址0040:0010 处。
+
+ map --harddrives=N
+
+其中的N 可以是从0到127之间的值。MAP将把N 值设置在0040:0075处。
+
+ map --memdisk-raw=RAW
+
+其中的RAW默认为1 。如果RAW=0,将通过`int15/ah=87h'访问内存驱动器。
+
+ map --ram-drive=RD
+
+其中RD默认是0x7F的软驱号。如果随机内存驱动器是一个硬盘驱动器镜像(第一扇区
+含有分区表),那么你可以将 RD 设置为大于或等于0x80并且小于0xA0之间的值。
+如果是一个光盘镜像,那需要设置为大于或等0xA0并且小于0xFF之间的值。
+
+ map --rd-base=ADDR
+
+ map --rd-size=SIZE
+
+其中的 ADDR 指定出内存映像的物理基地址。SIZE指定出内存映像的字节数大小。ADDR
+默认为0 。SIZE的默认值也是0 ,但是值为0 表示4 GB ,而不是零字节长的磁盘。随机
+内存驱动器可以在 GRUB 环境中通过使用 (rd) 设备来访问。
+
+
+******************************************************************************
+*** About the new map option --in-situ ***
+******************************************************************************
+ 关于 map 的新选项 --in-situ
+
+--in-situ被使用于硬盘驱动器映像或者是硬盘驱动器分区。通过--in-situ ,我们可以把
+一个逻辑分区象征性的作为一个主分区来使用。
+
+--in-situ 的映射是整个驱动器的映射。它只虚拟出分区表和 DBR 上的BPB里的隐藏扇区数。
+
+尽管磁盘仿真在 win9x 中可能会遇到的各种问题,但在win9x中,in-situ的映射却运行得很好。
+
+注意 --in-situ 的映射不会改变真实的分区表。
+
+示例:
+ map --in-situ (hd0,4)+1 (hd0)
+
+******************************************************************************
+*** The PARTNEW Command Syntax ***
+******************************************************************************
+ PARTNEW 命令的语法
+
+除了上述章节的仿真方法而外,你也可以替代选择用 PARTNEW 来建立一个新的主分区。
+PARTNEW可以为逻辑分区生成一个新的主分区项(在分区表中)。
+
+例如,
+ partnew (hd0,3) 0x07 (hd0,4)+1
+
+这里的(hd0,4)+1 代表了整个(hd0,4)分区。这条命令将建立一个分区类型为 0x07
+的新的主分区(hd0,3),并且它的内容(即数据)和逻辑分区(hd0,4)一样。
+
+就像整个逻辑分区时的情况一样,一个连续的分区映像文件也可以用在PARTNEW 命令中:
+
+ partnew (hd0,3) 0x00 (hd0,0)/my_partition.img
+
+The type 0x00 indicates a type-auto-detection of the image MY_PARTITION.IMG.
+The above command will create a new primary partition (hd0,3) with a proper
+type and with contents/data being exactly that of the contiguous file
+(hd0,0)/my_partition.img.
+这个 0x00 类型表示这个 MY_PARTITION.IMG 映像文件的分区类型由自动检测确定。
+上面的命令将建立一个类型恰当的新的主分区(hd0,3),并且使用这个连续的
+ (hd0,0)/my_partition.img 文件中的全部内容(数据)作为它的内容(数据)。
+
+PARTNEW 将自动修正 BPB 中的“隐藏扇区数”并且这个修改是永久的。而且PARTNEW
+修改分区表也是永久的。
+
+除了建立分区表项外,PARTNEW也可以用来删除(抹掉,擦除)一个分区表项。例如,
+
+ partnew (hd0,3) 0 0 0
+
+这样,主引导记录中最后一个分区表项将被清空。通常,你可以用"partnew PARTITION 0 0 0"的格式来
+抹掉其分区表项,但是已经存储在这个分区中的数据不被影响。
+
+******************************************************************************
+*** Newly implemented operators `&&' and `||' ***
+******************************************************************************
+ 最近实现的运算符 `&&' and `||'
+
+它的实现非常简单。它不处理嵌套的运算符。
+
+`&&'的用法:
+ command1 && command2
+说明 :
+ 如果 command1 返回 真,那么 command2 将执行
+
+`||'的用法:
+
+ command1 || command2
+
+说明 :
+ 如果 command1 返回 假,那么 command2 将执行
+
+示例:
+ is64bit && default 0
+ is64bit || default 1
+
+注意:
+ 1.只要返回值非0都是真,否则是假.比如
+ read 0x60000 && command2
+ command2有可能会不被执行.因为内存地址0x60000的值有可能是0.
+ 一般情况下命令执行失败时总是返回0(假).所以可以用于判断命令执行的结果.
+ 2.在菜单中使用这些符号会忽略错误检测,这是一个很有用的功能.
+ 比如:
+ find --set-root /file.ext
+ 在菜单中使用时可能会返回文件未找到的错误并停止执行.必要的话我们可以使用
+ find --set-root /file.ext || echo file not found.
+ 这个命令在菜单中使用会显示find not found,但不停止执行.
+
+更新1: 最新版本可以使用嵌套,例子:
+ find --set-root /file1 || find --set-root /file2 || find --set-root /file3
+ 如果没有找到file1就继续找file2,还是没有找到就找file3,如果还是没有找到将会失败
+
+******************************************************************************
+*** Three new commands is64bit, errnum and errorcheck ***
+******************************************************************************
+ 三个新命令 is64bit, errnum 和 errorcheck
+
+is64bit 和 errnum 命令分别用来检索是否是 64 位的系统和错误值。
+
+errcheck off|on
+
+errorcheck(错误检查)命令控制着错误是否被处理。默认错误检查是开启的 ,即在
+错误发生时命令脚本将停止执行。而假如错误检查是关闭的,那么脚本将一直执行到 boot
+命令。一条 boot 命令可以把错误检查转变为开启。
+
+******************************************************************************
+*** Use numeric keys to select a menu entry ***
+******************************************************************************
+ 使用数字键来选择菜单项
+
+例如,如果你想要选择第25项菜单项,你可以先按下数字键2 之后再按下 5 。
+
+******************************************************************************
+*** Use the INSERT key to debug step by step at startup ***
+******************************************************************************
+ 启动时使用 INSERT 键逐步的调试
+
+在一些有缺陷机器上进入 grub4dos 环境时可能会失败。可能是意外的死机或者重启。
+在启动时尽可能快的按下 INSERT 键,你就可能获得进入单步启动进程的机会而看到它最
+多能运行到哪里,然后请上报这些bug截图 。
+
+******************************************************************************
+*** The debug command syntax has been changed ***
+******************************************************************************
+ debug 命令的语法已经改变
+
+DEBUG 命令现在可以用来控制冗余的命令输出:
+ debug [ on | off | normal | status | INTEGER ]
+
+0 或者 off 指定为静默模式
+
+1 或者 normal 指定为标准模式
+
+从 2 到 0x7fffffff 或者 on 指定为冗余模式
+(调试报告BUG时请使用该模式,可以获得更详细的信息)
+
+******************************************************************************
+*** GRUB4DOS and Windows Vista ***
+******************************************************************************
+ GRUB4DOS 与 Windows Vista
+
+首先,使用以下命令来建立一个启动项:
+
+ bcdedit /create /d "GRUB for DOS" /application bootsector
+
+执行结果看起来类似这样:
+The entry {05d33150-3fde-11dc-a457-00021cf82fb0} was successfully created.
+
+其中长字串{05d33150-3fde-11dc-a457-00021cf82fb0} 是这个项的数字标识{id}。
+
+然后,通过以下命令来设置启动参数:
+ bcdedit /set {id} device boot
+ bcdedit /set {id} path \grldr.mbr
+ bcdedit /displayorder {id} /addlast
+请用先前的命令所返回的实际的id 来替换掉 {id}。
+
+最后,复制 GRLDR.MBR 到 你引导分区的根目录下,并且将 GRLDR 和 menu.lst 复制到
+任意一个 FAT16/FAT32/EXT2/NTFS 的分区根目录下。
+
+注意:引导分区必须是含有 BOOTMGR 的激活的主分区。
+
+LianJiang 先生写出了一个脚本来自动化的完成这个麻烦的工作:
+
+ @echo off
+ rem by lianjiang
+ cls
+ echo.
+ echo Please run as administrator
+ echo.
+ pause
+ set gname=GRUB for DOS
+ set vid=
+ set timeout=5
+ bcdedit >bcdtemp.txt
+ type bcdtemp.txt | find "\grldr.mbr" >nul && echo. && echo BCD entry existing, no need to install. && pause && goto exit
+ bcdedit /export "Bcd_Backup" >nul
+ bcdedit /create /d "%gname%" /application bootsector >vid.ini
+ for,/f,"tokens=2 delims={",%%i,In (vid.ini) Do (
+ set vida=%%i
+ )
+ for,/f,"tokens=1 delims=}",%%i,In ("%vida%") Do (
+ set vid={%%i}
+ )
+ echo %vid%>vid.ini
+ bcdedit /set %vid% device boot >nul
+ bcdedit /set %vid% path \grldr.mbr >nul
+ bcdedit /displayorder %vid% /addlast >nul
+ bcdedit /timeout %timeout% >nul
+ if exist grldr.mbr copy grldr.mbr %systemdrive%\ /y && goto exit
+ echo.
+ echo Please copy grldr.mbr to %systemdrive%\
+ echo.
+ pause
+ :exit
+ del bcdtemp.txt >nul
+-------------------------------------------------------------------
+更新: Fujianabc 先生指出以下这行
+ bcdedit /set %vid% device boot >nul
+必须更改为
+ bcdedit /set %vid% device partition=%SystemDrive% >nul
+chenall注: 其实没有必要改,使用boot可以获得更好的兼容性.
+-------------------------------------------------------------------
+你还需要自行复制 grldr和menu.lst文件。
+
+注意: 你只需要指定BCD的位置就可以修改另一个操作系统的BCD 启动项:
+ bcdedit /store D:\boot\BCD ...
+
+注意: 执行这些命令需要提高权限,它们必须是“以管理员身份运行”于cmd.exe中。
+
+注意:已有人报告说,即使使用管理员身份,Vista的某些版本也不支持在C盘根目录下建立
+无扩展名的文件。你既可以复制grldr到另外的一个分区来解决这个问题,也可以将 grldr
+重命名,比如为 grub.bin 。如何改名,请参见下节。
+
+******************************************************************************
+*** How to rename grldr ***
+******************************************************************************
+ 怎样重命名 grldr
+
+ grldr 和 grldr.mbr引用引导文件内部的文件名来决定装载哪个文件,所以假如你
+ 想更换它们的名字,那么你也必须要修改那些内嵌在文件内部的设置。你可以使用
+ 辅助程序grubinst 来做到这些,grubinst 可以在以下网址下载到:
+
+http://download.gna.org/grubutil/
+
+ grubinst 能生成自定义的grldr.mbr:
+
+ grubinst -o -b=mygrldr C:\mygrldr.mbr
+
+ grubinst 也能编辑一个既有的 grldr 或 grldr.mbr:
+
+ grubinst -e -b=mygrldr C:\mygrldr
+
+ grubinst -e -b=mygrldr C:\mygrldr.mbr
+
+在这种情况中,你必须使用一个和 grub4dos 版本兼容的grubinst,否则修改将会失败。
+
+ 所以,在命令中通过加载mygrldr来代替grldr ,你可以使用下面的方法之一:
+
+1.使用已定制好的grldr.mbr 来加载 mygrldr 。在这种情况下,你需要修改内嵌在
+ grldr.mbr中的引导文件名。grldr.mbr的名字可以被任意的改变。
+
+2.直接使用mygrldr 。在这种情况下,你需要将 mygrldr 中内嵌的引导文件名改为
+ 一个合适的名字。
+
+注意: 引导文件名必须遵循 8.3 文件名规范。
+
+******************************************************************************
+*** GRLDR as PXE boot file ***
+******************************************************************************
+ GRLDR 作为 PXE 启动文件
+
+GRLDR 可以被用作远程或网络服务器的 PXE 启动文件。(pd) 设备被用于访问服务器上文件。
+当 GRLDR 已经通过网络启动后,它将使用预设菜单作为配置文件。不过,你可以使用
+一条"pxe detect"命令,它的表现是和pxelinux一样的方式。
+
+ * 首先,它将使用设备类型(使用它的 ARP 类型码)和地址来搜索配置文件,全部用
+ 破折号分割的十六进制;例如,对一个以太网(ARP 类型是1)的88:99:AA:BB:CC:DD
+ 地址,它会用文件名01-88-99-AA-BB-CC-DD 来搜索。
+
+ * 其次,它将使用它本地的IP 地址大写字母的十六进制格式(即192.0.2.91 转换为
+ C000025B。)来搜索配置文件。如果文件没有找到,它将去掉一个十六进制数字后再试一次。
+ 最后,它会尝试寻找一个名为 default (小写字母)的文件。
+
+******************************************************************************
+*** PXE device ***
+******************************************************************************
+ PXE 设备
+
+如果使用PXE启动,GRUB4DOS 将建立一个虚拟设备 (pd),可能通过它来访问tftp服务器
+上的文件。你可以使用下面的步骤来设置一个无盘启动环境:
+
+客户端
+你需要从 PXE ROM 上启动。
+
+服务器端
+你需要配置一个dhcp服务器和一个tftp服务器。在dhcp服务器上,使用grldr作为引导文件。
+
+你可能希望为不同的客户端加载一个不同的menu.lst 。GRUB4DOS将在以下位置查找配置文件:
+
+ [/mybootdir]/menu.lst/01-88-99-AA-BB-CC-DD
+ [/mybootdir]/menu.lst/C000025B
+ [/mybootdir]/menu.lst/C000025
+ [/mybootdir]/menu.lst/C00002
+ [/mybootdir]/menu.lst/C0000
+ [/mybootdir]/menu.lst/C000
+ [/mybootdir]/menu.lst/C00
+ [/mybootdir]/menu.lst/C0
+ [/mybootdir]/menu.lst/C
+ [/mybootdir]/menu.lst/default
+
+更新1: 如果/mybootdir/menu.lst 文件存在,将会优先使用,这样可以加快引导速度.
+
+这里,我们假设客户端的网卡mac地址是 88:99:AA:BB:CC:DD ,而ip地址是192.0.2.91 (C000025B)。
+/mybootdir 是引导文件所在目录,例如,如果引导文件是 /tftp/grldr ,那么mybootdir=tftp 。
+
+如果上面的文件都未出现,grldr将使用它的内置的menu.lst 。
+
+这是一个如何访问tftp服务器上文件的menu.lst文件。
+
+ title Create ramdisk using map
+ map --mem (pd)/floppy.img (fd0)
+ map --hook
+ rootnoverify (fd0)
+ chainloader (fd0)+1
+
+ title Create ramdisk using memdisk
+ kernel (pd)/memdisk
+ initrd (pd)/floppy.img
+
+chenall注: 1.你也可以省略(pd)/或者使用(bd)/或()/
+ 这样可以使得一个菜单可以不经过修改就可以用于其它地方的启动.
+
+你可以看到这个 menu.lst 和在普通磁盘上引导的是相似的,你只是需要把象(hd0,0)
+这样的设备用(pd) 来代替。
+
+磁盘设备和 pxe 设备有一些不同点:
+
+1. 你不能把pxe设备上的文件以列表显示。
+更新2: 现在可以列表,但要求服务器上有dir.txt文件,使用以下命令可以创建一个dir.txt文件
+ dir /b>dir.txt
+ 也可以直接使用TFTPD32的服务器,选择自动生成DIR.TXT文件.
+
+2.blocklist 命令不能用于 pxe 设备上的文件。
+
+3.如果你想映射一个pxe服务器上的文件,你必须使用--mem 选项 。
+
+当你使用 chainloader 命令装载一个pxe 设备上的文件时,有一个选项你可以使用:
+
+ chainloader --raw (pd)/BOOT_FILE
+
+选项 --raw 的执行就和--force一样,但是它是一次性将文件装载执行。这可以改善
+一些情况下的执行效率。
+
+你可以使用 pxe 命令来控制 pxe 设备。
+
+1. pxe
+ 如果没有使用任何参数,pxe 命令将显示当前设置。
+
+2. pxe blksize N
+ 设置tftp packet size (传输包)大小。最小值是 512 ,最大值是 1432 。这个参数主要使
+ 用在那些不支持远大于 512 字节包大小的tftp 服务器上。
+
+3. pxe basedir /dir
+ 为tftp 服务器上的文件设置基本目录。如
+ pxe basedir /tftp
+
+ 那么在pxe 设备上的所有文件都和目录 /tftp 相关。例如,(pd)/aa.img
+ 对应于服务器上的 /tftp/aa.img 。
+
+ 基本目录的默认值是引导文件所在目录,例如,如果引导文件是 /tftp/grldr ,
+ 那么默认的基本目录就是 /tftp 。
+
+4. pxe keep
+ 保持 pxe stack。GRUB4DOS的默认退出时自动卸载pxe strack。
+ 如果你希望在引导后继续使用PXE功能,比如用于RIS安装,这时必须使用这个选项.
+
+5. pxe unload
+ 立即卸载 PXE stack。pxe占用了大量的常规内存,某些引导程序可能会无法正常引导。
+ 这时你可以先卸载然后再引导。一个例子:
+ title Linux memtest
+ map --mem /memtest.bin (rd)
+ pxe unload
+ kernel (rd)+1
+ 如果在PXE启动时直接kernel /memtest.bin可能会失败。
+
+
+******************************************************************************
+*** New Feature of Relative Path Support ***
+******************************************************************************
+ 相对路径支持的新特性
+
+使用`root' 或 `rootnoverify'命令来指定`工作目录' 。
+
+例如:
+ root (hd0,0)/boot/grub
+
+这就指定了当前工作目录是(hd0,0)/boot/grub 。因此所有继"/..."之后的文件名将实际
+提交到(hd0,0)/boot/grub/...
+
+也就是说:
+
+ cat /menu.lst
+将等同于
+ cat (hd0,0)/boot/grub/menu.lst
+
+
+******************************************************************************
+*** Notation For The Current Root Device ***
+******************************************************************************
+ 当前根设备的符号
+
+符号`()'可以在访问当前根设备时使用。你可以使用`find --set-root ...'来设置当前根
+设备,但find 命令不能设置根设备的`工作目录'。这时你应该使用`()'在find命令后来设
+置工作目录。
+ root ()/boot/grub
+
+2008-05-01 更新:
+ 现在 FIND 命令也可以设置`工作目录'了。例如:
+
+ find --set-root=/tmp /boot/grub/menu.lst
+
+ 它等同于这一组命令:
+ find --set-root /boot/grub/menu.lst
+ root ()/tmp
+
+******************************************************************************
+*** The new map option --a20-keep-on ***
+******************************************************************************
+ map 新选项 --a20-keep-on
+
+随着0.4.3最终版的发布,map 有了一个新选项 --a20-keep-on ,它跟内存驱动器扇区访
+问后的A20 地址线控制有关
+
+ map --a20-keep-on=0
+
+它必须被使用于"map --hook"命令之前。
+
+作为默认,在INT13 对随机内存的扇区访问之后 A20 将一直开启。如果"map --a20-keep-on=0"
+被使用,那么在INT13 中断调用后的 A20 的状态将和在INT13中断调用前相同。
+
+******************************************************************************
+*** The CDROM emulation (virtualization) ***
+******************************************************************************
+ 光盘仿真(虚拟化)
+光盘仿真有时候又称为 ISO 仿真。这里是个示例:
+ map (hd0,0)/myiso.iso (hd32)
+ map --hook
+ chainloader (hd32)
+ boot
+
+如果myiso.iso 是不连续的并且你有足够的内存,那么要增加一个--mem选项:
+ map --mem (hd0,0)/myiso.iso (hd32)
+ map --hook
+ chainloader (hd32)
+ boot
+
+注意:(hd32) 是一个 grub 驱动器,驱动器号和 (0xA0) 等价。如果一个虚拟驱动器被指
+定为一个大于或等于0xA0 的驱动器号,那么它将被视为是一个光盘。(即,是 2048 字节
+的大扇区)
+
+就像标准的磁盘仿真一样,光盘仿真也(主要)工作于实模式操作系统中。在一个保护模式的
+操作系统核心(例如WinNT/2K/XP/VISTA/LINUX)获得控制后,操作系统一般没有能力通过BIOS
+的int13 来访问虚拟光盘。
+
+DOS/Win9x 的使用者可以用google搜索到 ELTORITO.SYS 然后将它作为虚拟光驱的设
+备驱动使用到CONFIG.SYS 中。
+
+CONFIG.SYS 中 eltorito.sys 的用法举例:
+ device=eltorito.sys /D:oemcd001
+
+对应的可能是放在 AUTOEXEC.BAT中的 MSCDEX 命令:
+ MSCDEX /D:oemcd001 /L:D
+
+由于在 eltorito.sys中发现了一些缺陷,驱动器可能会加载失败。假如你碰到这类问题,
+那么你可以将虚拟光盘的驱动器号从(hd32)更换为(0xFF)然后再试一次。
+
+******************************************************************************
+*** The New Command CHECKRANGE ***
+******************************************************************************
+ 新命令 CHECKRANGE
+
+Checkrang 命令检查一条命令的返回值是否是在指定的值域或排列中。
+
+Usage: checkrange RANGE COMMAND
+用法: checkrange 域 命令
+
+这里是参数 RANGE 的一些示例:
+ 3 是仅包含数字 3 的值
+
+ 3:3 等价于 3
+
+ 3:8 是一个包含数字3, 4, 5, 6, 7, 8的值域
+ 3,4,5,6,7,8 等同于3:8
+ 3:5,6:8 也等同于3:8
+ 3,4:7,8 也等同于3:8
+
+注意:你不能把空格放在值域中。比如:以下是错误的。
+ checkrange 1 2 COMMAND
+
+这里用一个示例来演示怎样使用 checkrange 命令:
+ checkrange 0x05,0x0F,0x85 parttype (hd0,1) || hide (hd0,1)
+这意谓着:如果 (hd0,1) 不是一个扩展分区,那么执行hide (hd0,1)命令隐藏它。
+
+******************************************************************************
+*** The New Command TPM ***
+******************************************************************************
+ 新命令 TPM
+
+"tpm --init"在地址0000:7c00处使用512字节数据作为初始化TPM(可信赖平台模块)的缓存。
+
+在你引导 VISTA 的 BOOTMGR 前,你可能需要在一些机器上使用"tpm --init"。通常你应该在
+一条 CHAINLOADR 命令后执行"tpm --init"指令。
+
+******************************************************************************
+*** Delimitors or comments between titles ***
+******************************************************************************
+ 标题间的限制或注释
+
+把标题用来做限制或注释是可能的。如果一个标题(或菜单项)下所有的菜单命令都是非启动敏感的,
+它被叫做是不可启动的。
+
+下面的命令是启动敏感的(而其他命令是非启动敏感的)
+ boot
+ bootp
+ chainloader
+ configfile
+ embed
+ commandline
+ halt
+ install
+ kernel
+ pxe
+ quit
+ reboot
+ setup
+
+一个不可启动的标题在使用者按向上方向键或向下方向键时将被跳过。
+不可启动的菜单项可以通过使用左方向键或右方向键来被访问(和执行)的。示例:
+
+ title This is an UNBOOTABLE entry(so this line is also a comment)
+ pause --wait=0 This title is a comment. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ help
+ help root
+ help chainloader
+ help parttype
+ clear
+ title ------------------------------------------------------------
+ pause --wait=0 This title is a delimitor. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ clear
+ help
+ help boot
+ title ============================================================
+ pause --wait=0 This title is a delimitor. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ help
+ clear
+ help pause
+ title ************************************************************
+ pause --wait=0 This title is a delimitor. Nothing to do.
+ pause --wait=0 You can use non-boot-sensitive commands here
+ pause --wait=0 of any kind and as many as you would like.
+ help kernel
+ help
+ clear
+
+注意:一个不可启动菜单项必须至少包含一条命令。如果标题下没有命令,标题将被简单的
+丢弃并且不被显示。
+
+******************************************************************************
+*** Bifurcate drives ***
+******************************************************************************
+ 分支式驱动器
+
+一些机器在 CHS 和 LBA 模式之间对驱动器实施不同的动作。
+当你使用标准的BIOS调用int13/AH=02h来读取扇区时,你可能会发现这个驱动器是一个软盘
+但是当你用扩展的BIOS调用(EBIOS)int13/AH=42h来读取扇区时,你会发现是一个光盘。
+这样的驱动器被叫做分支式的。
+
+一个分支式的驱动器拥有两个驱动器号:一个是标准的 BIOS 驱动器号十六进制
+的 00或FF ,并且这个驱动器只使用 CHS 模式的磁盘访问(标准的BIOS int13/AH=02h);
+另一个是标准的 BIOS 驱动器号(按位与)0x100 (即十进制的256),并且这个驱动器只
+使用 LBA 模式的磁盘访问(EBIOS int13/AH=42h)。
+例如,驱动器0x00(即,第一软驱)是分支式的.
+ 那么驱动器(0x00)使用 CHS 模式来访问它的扇区
+ 而驱动器(0x100)则使用LBA 模式来访问它的扇区。
+
+geometry 命令会用 BIF 代替常见的 CHS 和 LBA 来报告分支式驱动器的磁盘访问模式。
+
+已知的分支式驱动器。发现虚拟机Virtual PC和一些真实机器当它们引导一个软盘模拟模式
+的可启动光盘时会建立一个分支式的软驱。命令"geometry (fd0)"将显示:
+ drive 0x00(BIF): C/H/S=...Sector Count/Size=.../512
+
+而"geometry (0x100)"将显示
+ drive 0x100(BIF): C/H/S=...Sector Count/Size=.../2048
+
+实际上(0x100) 可以访问整个光盘。
+你可以执行"ls (0x100)/" 显示光盘上文件(不是那个被引导的软盘映像中的文件)。
+当然 "ls (fd0)/"可以列举那些在被引导的软盘映像中的文件。
+
+注意:仅仅是某些(真实的或虚拟的)机器有这样的行为,其他的机器不会产生分支式驱动器。
+
+******************************************************************************
+*** New program badgrub.exe ***
+******************************************************************************
+ 新程序 badgrub.exe
+
+新程序 badgrub.exe 是特意供那些不能运行标准 grub.exe 的‘糟糕的’机器(一些典型
+的 DELL 原型机)使用的。
+
+
+******************************************************************************
+*** Conditional find ***
+******************************************************************************
+ 条件查找
+
+新的find 命令的语法允许带条件的查找设备。
+
+ find [OPTIONS] [FILENAME] [CONDITION]
+ 选项 文件名 条件
+
+OPTIONS:
+ --set-root set the current root device.
+ --set-root=DIR set current root device and working directory to DIR.
+ please also see "Notation For The Current Root Device".
+ --ignore-cd skip search on (cd).
+ --ignore-floppies bypass all floppies.
+ --devices=DEVLIST specify the search devices and order.
+ DEVLIST u->(ud)
+ n->(nd)
+ p->(pd)
+ h->(hdx)
+ c->(cd)
+ f->(fdx)
+ default: upnhcf
+
+
+其中的 CONDITION 是一个返回值是 TRUE 或者 FALSE 的标准 grub 命令。
+
+ 示例 1: 列举所有的分区,所有的软驱和 (cd) 。
+
+ find
+
+ 示例 2:列举文件系统已知的所有设备。
+
+ find +1
+
+ 示例 3: 列举分区类型为0xAF的所有分区。
+
+ find checkrange 0xAF parttype
+
+ 示例 4:列举分区类型为 0x07 且根目录存在 ntldr 的所有分区。
+
+ find /ntldr checkrange 0x07 parttype
+
+ 示例 5: 设置当前根设备到第一个根目录有存在ntldr的分区。
+
+ find --set-root /ntldr
+
+ 示例 6: 同例5,但是以下命令只查在硬盘上查找bootmgr
+
+ find --set-root --devices=h /bootmgr
+
+ 示例 7: 设置当前根设备为第一激活的主分区。
+
+ find --set-root --devices=h makeactive --status
+
+更新: 新的find 命令语法允许指定要查找和设备和查找的顺序。
+ 新的参数 --devices=DEVLIST,用于指定查找的设备和顺序。
+ DEVLIST可以下以下的字母组合。
+ u,p,n,h,c,f -->分别对应 ud,pd,nd,hd,cd,fd,
+ 查找时根据DEVLIST指定的设备顺序进行查找。默认是upnhcf.
+
+
+ 例子: 1.只查找硬盘上的文件
+ find --devices=h /file
+ 2.依次查找硬盘、光盘、软盘上的文件
+ find --devices=hcf /file
+
+ 注意:新的find命令有一个改变,查找的时候会优先查找当前设备(如果在列表中的话)。
+
+******************************************************************************
+*** How to build grldr boot images ***
+******************************************************************************
+ 如何创建 grldr 引导的映像文件
+
+1. 创建1.44M 软盘镜像文件 ext2grldr.img
+
+ dd if=/dev/zero of=ext2grldr.img bs=512 count=2880
+ mke2fs ext2grldr.img
+ mkdir ext2tmp
+ mount -o loop ext2grldr.img ext2tmp
+ cp default ext2tmp
+ cp menu.lst ext2tmp
+ cp grldr ext2tmp
+ umount ext2tmp
+ bootlace.com --floppy --chs --sectors-per-track=18 --heads=2 --start-sector=0 --total-sectors=2880 ext2grldr.img
+
+2. 创建1.44M 软盘镜像文件 fat12grldr.img
+
+ dd if=/dev/zero of=fat12grldr.img bs=512 count=2880
+ mkdosfs fat12grldr.img
+ mkdir fat12tmp
+ mount -o loop fat12grldr.img fat12tmp
+ cp default fat12tmp
+ cp menu.lst fat12tmp
+ cp grldr fat12tmp
+ umount fat12tmp
+ bootlace.com --floppy --chs fat12grldr.img
+
+3. 创建 iso9660 文件系统的光盘镜像文件 grldr.iso
+
+ mkdir iso_root
+ cp grldr iso_root
+ cp menu.lst iso_root
+ mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o grldr.iso iso_root
+
+
+******************************************************************************
+*** Use bootlace.com to install partition boot record ***
+******************************************************************************
+ 使用 bootlace.com 来安装分区引导记录
+
+在 bootlace.com 没有实现 --install-partition 选项之前,你需要用已实现的
+--floppy=PartitionNumber 选项来替代。
+
+你必须按下面的方法执行:
+
+步骤 1. 获取分区的引导扇区然后保存为一个文件 MYPART.TMP 。对于 NTFS 文件系统,你需要获取
+ 起始的16 个扇区。对于其他类型的文件系统,你只需要获取一个扇区,但获取多个扇区
+ 也是没问题的。
+
+步骤 2. 执行这些命令:
+
+ bootlace.com --floppy=Y --sectors-per-track=S --heads=H --start-sector=B --total-sectors=C --vfat --ext2 --ntfs MYPART.TMP
+
+ 这里我们假定 MYPART.TMP 是从 (hdx,y) 获取的而且分区号 Y 必须在--floppy=Y 选项中被指定。
+
+ 注意:对于FAT12/16/32/NTFS等分区,你可以省略这些选项:
+ --sectors-per-track, --heads, --start-sector, --total-sectors,
+ --vfat and --ext2.
+
+ 对于 NTFS 分区,你必须指定 --ntfs 选项。
+
+ 对于 ext2 分区,你可以省略 --vfat, --ntfs he --ext2 选项,但是其他选项必须被指定。
+
+步骤 3. 将 MYPART.TMP 写回你原来分区(hdx,y)的引导扇区。
+
+注意:现在只有一些文件系统(FAT12/16/32/NTFS/ext2/ext3)被支持。
+
+注意2:在Linux 下你可以对分区直接写。也就是说,步骤1 和步骤3 是不需要的。简单使用
+ 它的设备名代替 MYPART.TMP 即可。
+
+注意3:grubinst 具有把 grldr 的自举代码安装到分区引导扇区的功能。
+
+******************************************************************************
+*** Use a single key to select menu item ***
+******************************************************************************
+ 使用一个单一的键来选择菜单项
+
+一些机器具有简化的键盘。这些键盘可能只有数字键 0 到 9 ,外加少数几个其他键。当
+菜单还未显示时,使用者可以按下某个键 8 次。当菜单控制模块发现一个连续的单一按
+键时,它将认为使用者希望使用这个键来选择菜单和启动。这个单一的键可以充当右方向
+键来为使用者选择菜单。然后在使用者停止按键的 5 秒之后,被选择的菜单项将自动启
+动。任何的标准键可以被作为单一的键来达到这个目的,除了少数功能键,比如 b ,e ,
+回车键,等等。一旦另外的键被按下,单键选择特性将立即消失。
+
+
+******************************************************************************
+*** Parameter file for bootlace running under DOS ***
+******************************************************************************
+
+你可以把所有或部分的命令行参数放到一个文件中。这个文件可以有多行。就像空格
+和制表符一样,回车符和换行符也可以在参数文件中分割命令行参数。
+
+示例:
+ bootlace < my_parafile
+ bootlace --read-only my_mbr < my_other_options
+
+注意: 不能使用管道符"|"。你必须使用输入重定向符 (<) 。
+
+******************************************************************************
+*** Use bootlace to create a triple MBR ***
+******************************************************************************
+ 使用 bootlace 来建立一个三重的 MBR
+
+虽然这也能用于硬盘,但是它典型的使用是被用于 USB 设备。
+创建三重的 MBR 的步骤:
+
+1. 使用一个新版的 FDISK 分区软件来建立一个从第 95 扇区开始的FAT12或16或32 的分区
+(这里是 LBA 扇区表示法,起始扇区(MBR)是 0 扇区。)
+
+2. 安装 grldr 的引导扇区到这个分区的引导扇区。参见上面的“使用 bootlace.com 来安装分区引导记录”
+
+3. 获取从起始扇区 0 扇区(MBR)开始的96个扇区,然后保存到一个文件 MYMBR96.TMP 中。
+
+4. 运行 bootlace.com:
+ bootlace.com MYMBR96.TMP
+5. 将 MYMBR96.TMP 从MBR (0 扇区)开始回写到驱动器上。
+
+注意: 如果驱动器已经是一个三重的 MBR ,那么 bootlace 会删除它并且恢复为原本的分区布局。
+
+******************************************************************************
+*** Use 'pxe detect' in preset-menu ***
+******************************************************************************
+ 在预置菜单中使用 'pxe detect' 命令
+
+现在“pxe”命令有了个新的子命令“detect”:
+ pxe detect [BLOCK_SIZE] [MENU_FILE]
+ 包大小选项 菜单文件选项
+
+BLOCK_SIZE 选项指定出 pxe 包的大小。如果它没有被指定或者是被指定为 0 ,那么
+grub4dos将通过一个侦测过程来获取数据传送包的一个恰当的的值。
+
+MENU_FILE 选项指定出 PXE 服务器上的配置文件。如果它被省略,在 menu.lst 子目录
+中的标准配置文件将获得控制。关于menu.lst 子目录中的配置文件的描述,请查阅上面
+的“GRLDR 作为 PXE 启动文件”一节。
+
+如果MENU_FILE 是以"/"开始的,那么PXE 服务器上的 MENU_FILE 将获得控制,否则
+(如果MENU_FILE不是以"/"开始)将没有菜单被执行。
+
+在你的系统用 512 字节的默认包大小不能运行时,通常你应该在访问(pd)设备之前
+使用一条 "pxe blksize ..." 或 一条 "pxe detect ..."命令。
+
+******************************************************************************
+*** Use 'configfile' in preset-menu ***
+******************************************************************************
+ 在预置菜单中使用 'configfile'命令
+
+现在预置菜单具有最高控制权。它将在启动设备上的 menu.lst 之前获得控制。如果
+'configfile' 命令在初始化命令组中出现,那么控制将转到启动设备上的menu.lst文件。
+
+******************************************************************************
+*** New command 'dd' to copy files ***
+******************************************************************************
+ 复制文件的新命令 'dd'
+
+用法:
+
+dd if=IF of=OF [bs=BS] [count=C] [skip=IN] [seek=OUT] [buf=ADDR] [buflen=SIZE]
+
+将 IF(源文件)复制到OF (目标文件)中。BS 是以字节计数的一个块的大小,默认
+值是512 。C 是复制的块数,默认值是源文件中的总块数。IN 指定在读取时跳过的块
+数,默认值是 0 。OUT 指定在写入时跳过的块数,默认值是0 。已跳过的块不会被改
+变。源文件和目标文件必须是存在的。
+译注:新增参数buf表示dd所用的读写缓存的起始地址,buflen表示缓存的长度,即大小。
+
+源文件和目标文件必须以设备名开头,即,`(...)'的格式。对于当前根设备你应该使用`()'。
+
+dd 命令既不扩大也不减小目标文件的大小,源文件尾部剩余的部分将被丢弃。目标
+文件不能是gzip压缩过的文件。如果源文件是gzip 压缩过的文件,它将在复制时被
+自动解压。
+
+dd 具有危险性,使用风险由你自己的承担。作为一种安全方面的考虑,你应当只使
+用 dd 来写入一个内存中的文件。
+
+某些情况下在写入NTFS 中的文件的时,dd 可能会失败。
+
+假如你尝试在菜单中执行dd命令来写入一个不是内存中的设备或者块文件时,你会被安全的拒绝:-)
+(更新:现在不再限制)
+
+更新: 新选项实现了让使用者自定义dd 命令的读写缓存。默认读写缓存起始于地
+址0x50000,长度为0x10000 (即64KB)。你不能指定起始地址ADDR 低于0x100000
+(即 1 MB)的缓存位置。此外,你必须指定参数SIZE 大于0x10000(即64K)。
+通常,你需要令ADDR大于或等于0x1000000 (16MB),并且 SIZE 也要大于或等于16MB 。
+增大 SIZE 的值能够加快 dd 的读写速度。
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
+!!!! Caution! Both IF and OF can be a device name which stands for !!!!
+!!!! all the sectors on the device. Take utmost care! !!!!
+!!!!______________________________________________________________________!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ 警告!IF 和 OF 都可以是一个设备名,即它代表了设备上全部的扇区。慎之又慎!
+
+******************************************************************************
+*** New command 'uuid' to identify partitions ***
+******************************************************************************
+ 确认分区的新命令 'uuid'
+
+用法:
+
+ uuid [DEVICE] [UUID]
+
+如果 DEVICE 选项未被指定,将在所有分区中搜索指定的 UUID 号的文件系统,
+然后把包含这个文件系统的分区设置为新的根 (如果 uuid 被指定时),或者只列举所
+有设备上的文件系统的 uuid 号(如果 uuid 未被指定时)。
+如果 DEVICE 选项被指定了,将返回 真 或 假 ,对应于指定的设备是否与指定的 UUID
+号相符(如果uuid被指定时),或者仅仅列举指定设备的uuid 号(uuid 未被指定时)。
+
+示例 1:
+ find --set-root uuid () 7f95820f-5e33-4e6c-8f50-0760bf06d79c
+
+这将查找 uuid 等于 7f95820f-5e33-4e6c-8f50-0760bf06d79c的分区,然后将这个找到的分区设置为根。
+
+示例 2:
+ uuid ()
+这将显示当前根设备的 uuid 号。
+
+******************************************************************************
+*** gfxmenu support in grub4dos ***
+******************************************************************************
+ grub4dos 的 gfxmenu 支持
+
+gfxmenu 支持已经被增加到 grub4dos 当中。使用它,你首先需要找到一个你需要的mesage
+文件,然后在menu.lst中用类似这样的命令来装载它:
+
+ gfxmenu /message
+
+这是一个全局命令,也就是说,不能放入任何的菜单项中。同时,它只能被使用于配置文件
+中,而在控制台模式中执行它是无效的。
+
+gfxmenu 不能与全局密码保护功能同时使用。
+
+message 文件有两个主要的格式。老的格式是通过gfxboot 3.2版或更旧的版本创建的
+(message文件的大小通常只能是150 k),当采用 gfxboot 3.3 版或更新的版本创建
+新格式时,(message文件的大小通常可以超过 300K)。这两种格式在grub4dos 中都
+已被支持。
+
+******************************************************************************
+*** Use 'write' to write a string into a device or file ***
+******************************************************************************
+ 使用 'write' 命令将字符串写入设备或文件中
+
+用法:
+
+ write [--offset=SKIP] ADDR_OR_FILE INTEGER_OR_STRING
+
+SKIP 是一个整数默认值是 0 。
+
+如果 ADDR_OR_FILE选项 被指定为一个整数,那么它被作为一个内存地址对待,并且
+INTEGER_OR_STRING选项也必须是一个整数值。整数 INTEGER_OR_STRING 将被写
+入(ADDR_OR_FILE 加上 SKIP 值)的地址处。
+
+如果 ADDR_OR_FILE选项 指定的是一个设备或一个文件,那么INTEGER_OR_STRING 选
+项将被作为一个字符串对待,它将被写入跳过 SKIP 个字节(字节计数)的指定的设
+备或文件当中。
+
+字符串不需要被引用,也就是说,不需要单引号(') 也不用 双引号(") 来引用它。
+
+空格符必须被反斜杠(\)引用。(更新:现在不需要了)
+(译注:如果字符串以空格开头,开头的这个空格符还是需要反斜杠引用)
+
+单引号(')和双引号(")不用特别说明并且可以直接使用到字符串中。
+
+下面是一些 C 语言风格的引用序列说明:
+
+ \NNN (1到3位)八进制值 NNN 表示的字符
+ \\ 反斜杠
+ \a 警报 (声音)
+ \b 退格符
+ \f 换页符
+ \n 换行符
+ \r 回车符
+ \t 水平制表符
+ \v 垂直制表符
+ \xHH (1到2位)十六进制值为 HH 的字节
+
+就像 dd 命令一样,write 命令既不扩大也不缩小目标文件的文件大小,字符串的
+剩余部分将被丢弃。目标文件也不能是一个压缩过的文件。
+
+还是和 dd 类似,write 命令也具有危险性,使用风险你自己承担。作为一种安全
+方面的考虑,你应当只向内存中的文件写入。
+
+某些情况下当写入 NTFS 中的文件时,write命令可能失败。
+
+假如你尝试在菜单中执行 write 命令来写入一个不是内存中的设备或者块文件时,
+你会被安全的拒绝:-) (更新:现在不再限制)
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
+!!!! Caution! The file to write can be a device name which stands !!!!
+!!!! for all the sectors on the device. Take utmost care! !!!!
+!!!!______________________________________________________________________!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ 警告!被write 命令写入的文件可以是一个设备名,即它代表了设备上的所有
+ 扇区。慎之又慎!
+
+
+******************************************************************************
+*** Item-by-item help text for menu entries ***
+******************************************************************************
+ 为菜单项添加提示信息
+
+当你选择一个菜单项时,屏幕底部的提示信息将发生变化。
+
+你可以在标题行中添加你的提示信息。必须用"\n" 开头,示例:
+ title This is the title\nThis is the help text.\nAnd this is the 2nd line of the help text.
+
+一些 C 语言风格的引用符号在请看前面章节的说明。
+
+******************************************************************************
+*** initrd can load multiple cpio files for Linux 2.6 kernels ***
+******************************************************************************
+ inird 命令可以为Linux 2.6 核心装载多个cpio 格式的文件
+
+用法:
+ initrd FILE [FILE ...]
+
+注意 1:你不能用这种方法装载多于一个的老式磁盘镜像,因为Linux 核心不支持。
+注意 2:其中的 FILE 必须和在syslinux中使用的顺序一样。
+
+******************************************************************************
+*** access some internel variables at a fixed location ***
+******************************************************************************
+ 在固定位置访问一些内部变量
+地址 长度 说明
+========= ======== ==============================================
+0000:8208 4字节(即双字) 启动分区号 install_partition (the boot partition)
+0000:8280 4字节(即双字) 启动驱动器号(boot_drive)
+0000:8284 4字节(即双字) pxe 客户端 ip (即本地ip)
+0000:8288 4字节(即双字) pxe 服务器 ip
+0000:828C 4字节(即双字) pxe 网关 ip
+0000:8290 8字节(即四字) 最后访问的文件的大小(是执行"cat --length=0"后的文件大小)
+0000:8298 4字节(即双字) 可用的扩展内存大小(以 KB 为单位)
+0000:829C 4字节(即双字) 当前根分区号(current root partition)
+0000:82A0 4字节(即双字) 当前根所在的驱动器(current root drive)
+0000:82A4 4字节(即双字) 解压标志 (gzip非自动解压),非0时不自动解压
+0000:82A8 8字节(即四字) 最后访问的分区的起始扇区号
+0000:82B0 8字节(即四字) 最后访问的分区的扇区总数
+0000:8278 4字节(即双字) GRUB4DOS编译的日期十进制数.
+ 以下命令用于判断当前使用的GRUB是否在2010-12-30日编译的。
+ checkrange 20101230 read 0x8278
+
+注意 1:Filesize 通过执行 "cat --length=0 FILE" 来初始化和修改。
+注意 2:尽量不要改写这些变量(应该只是读取)。
+注意 3:你可以使用内存地址6000:0000开始的 1K空间作为你自己的变量区(参见注意4)。
+注意 4:read 命令现在从指定的地址处返回32位整数值。
+注意 5:grub4dos 还没有变量扩展的功能。你只能使用整数变量。你不需要申明它们,就
+ 可以直接使用这些内存地址。通常你需要通过一个逻辑值或者一个条件测试命令
+ 来使用这些变量,即,类似这种格式:"checkrange RANGE read ADDR"
+注意 6:内部变量no_decompression, saved_drive and saved_partition 是可写的。
+
+******************************************************************************
+*** possibility to run another menu.lst after gfxmenu ***
+******************************************************************************
+ 在 gfxmenu 之后后运行其它 menu.lst
+
+注意下面是在 GFXMENU 之后使用 CONFIGILE 的示例:
+
+ # The menu.lst file for gfxmenu
+ default=0
+ timeout=5
+ gfxmenu /message
+ configfile /another.lst
+ title 0..........
+ ................
+ title 1..........
+ ................
+ title 2..........
+ ................
+ # End of menu.lst
+
+ # Begin another.lst
+ default=0
+ timeout=5
+ title 0..........
+ ................
+ title 1..........
+ ................
+ title 2..........
+ ................
+ # End of another.lst
+
+会首先尝试执行 gfxmenu 命令。当它退出时(或者失败时)控制会转到 another.lst 菜单。
+
+******************************************************************************
+*** a range of drives can be unmapped ***
+******************************************************************************
+
+用法:
+ map --unmap=RANGE
+
+其中的 RANGE 是一个已被映射的 BIOS 驱动器域。BIOS 驱动器号 0 表示第一软驱,1 表示
+第二软驱;0x80 表示第一硬盘,0x81 表示第二硬盘,等等;虚拟光盘(hd32) 对应于
+BIOS 驱动器号 0xA0 ,(hd33) 对应于0xA1 ,等等。
+
+关于RANGE 的说明,请参阅前述的“新命令 CHECKRANGE ”这节。
+
+示例 1:
+ map --unmap=0,0x80,0xff
+
+这将反映射虚拟软驱 (fd0),虚拟硬盘(hd0)和虚拟光盘(0xff)。
+
+示例 2:
+ map --unmap=0:0xff
+
+这将反映射所有的虚拟软驱,所有的虚拟硬盘和所有的虚拟光盘。
+
+注意 1:通常,一条‘map’命令将在驱动器映射表中为虚拟驱动器增加一个表项。而
+ ‘--unmap’意味着在驱动器映射表中(具体是指虚拟驱动器)的表项会被删除。
+
+Note 2: The --unhook option only breaks the INT13 hook(to the inerrupt
+ vector table). It will not affect the drive map table. And later on
+ execution of a `boot' command, the INT13 disk emulation routine will
+ automatically get hooked(to the interrupt vector table) when needed
+ (e.g., the drive map table is non-empty) even if it has been unhooked.
+注意 2:--unhook 选项仅仅是断开 INT13 的挂钩(在中断矢量表中)。它不会影响到驱
+ 动器映射表。而且在执行了一个‘boot’命令之后,即使是它已经被反映射了的
+ 时候,INT13磁盘仿真程序也会在需要的时候(即,驱动器映射表非空时)自动建立挂钩。
+
+注意 3:通常你需要在已经改变了驱动器映射表之后执行一条`map --rehook'命令。
+
+******************************************************************************
+*** geometry tune and sync ***
+******************************************************************************
+ 磁盘几何参数的修正和同步
+
+当一个USB 存储设备被连接到一台(或者是不同的)机器上时,分区表中或 BPB 中的磁盘
+几何参数值可能是无效的,并且这个机器可能在启动时死机。因此你需要为驱动器找到一个
+正确的磁盘几何参数(使用 `geometry --tune'),然后更新分区表或 BPB 中的磁盘
+几何参数(使用`geometry --sync')。
+
+假如你想启动到DOS,那上面的步骤是必要的,因为 DOS 要求有正确的磁盘几何参数在分区
+表和BPB 中。Windows 及 Linux 应该也需要,因为引导程序运行在实模式中。
+
+******************************************************************************
+*** 版本编号 ***
+******************************************************************************
+
+我们添加了一个字符 'a', 'b', 'c' or 'p' 到版本编号(e.g., 0.4.5).
+所以现在版本编号是 0.4.5a, 0.4.5b, 0.4.5c, 0.4.5 or 0.4.5p.
+
+'a' - alpha test. 不稳定, 尤其是在有已知BUG的情况下。
+'b' - beta test. 测试版,开发人员觉得这个版本没有bug,希望有一个长期的测试。
+'c' - 候选发布版,相对比较稳定。
+''(nothing) - 正式版,比较稳定。
+'p' - 修补版,对于在正式版中发现的一些问题进行修正.
+
+******************************************************************************
+*** Running User Programs(外部命令,供开发人员参考) ***
+******************************************************************************
+
+从0.4.5起,用户可以自行编写程序以在GRUB4DOS中运行。
+该可执行程序文件必须以8字节grub4dos EXEC签名结尾。
+ 0x05, 0x18, 0x05, 0x03, 0xBA, 0xA7, 0xBA, 0xBC
+
+The executable must have no relocations, and the entry point is at the very
+beginning of the file, just like a DOS .com file(but the grub4dos executable
+is 32-bit).
+程序的入口点在文件头,和DOS的.com文件很像(但我们是32位的程序)。
+
+注:因为使用了linux gcc的特性,所以程序只能在linux下使用gcc进行编译。
+
+附上一个简单的echo.c源码,供参考。
+/*================ begin echo.c ================*/
+
+/*
+ * 编译:
+gcc -nostdlib -fno-zero-initialized-in-bss -fno-function-cse -fno-jump-tables -Wl,-N -fPIE echo.c
+
+ * disassemble: objdump -d a.out
+ * confirm no relocation: readelf -r a.out
+ * generate executable: objcopy -O binary a.out echo
+ * 经过这一步之后生成的echo文件就是可以在grub4dos中运行的程序。
+ * and then the resultant echo will be grub4dos executable.
+ */
+
+/*
+ * This is a simple ECHO command, running under grub4dos.
+ */
+#define sprintf ((int (*)(char *, const char *, ...))((*(int **)0x8300)[0]))
+#define printf(...) sprintf(NULL, __VA_ARGS__)
+
+int i = 0x66666666; /* 这是必要的,看下面的注释。*/
+/* gcc treat the following as data only if a global initialization like the
+ * above line occurs.
+ */
+
+/* GRUB4DOS可执行程序结尾必须有以下8个字节(EXEC签名) */
+asm(".long 0x03051805");
+asm(".long 0xBCBAA7BA");
+/* 感谢上帝, gcc 会把上面的8个字按兵不动放在最终程序的最后面。
+ * 不要在这里插入其它任何代码.
+ */
+
+int main(char *arg,int flags)
+{
+ return printf("%s\n",arg);
+}
+/*================ end echo.c ================*/
+
+0x8300 是 grub4dos 系统函数(API)的入口点. 你可以在 asm.S 源码中找到它的定义.
+
+目前可以使用的函数和变量:
+ http://grubutils.googlecode.com/svn/trunk/src/include/grub4dos.h
+
+******************************************************************************
+*** Map options added by Karyonix ***
+******************************************************************************
+
+(from boot-land.net) Karyonix's note:
+注:boot-land.net网站已经改成 reboot.pro
+map --add-mbt= option to be used with --mem. If =0 master boot track will not
+ be added automatically.
+ 配合--mem 使用. 如果=0 则不会自动添加主引导磁道.
+ 说明:默认情况下把一个分区镜像map为一个硬盘时会自动添加一个主引导磁道.
+ 使用该参数可以禁止GRUB4DOS自动添加。一般不需要使用这个参数。
+
+map --top option to be used with --mem. map --mem will try to allocate memory
+ at highest available address.
+ 配合--mem 使用. 如果=0 则不会自动添加主引导磁道.
+ 说明:默认情况下把一个分区镜像map为一个硬盘时会自动添加一个主引导磁道.
+ 使用该参数可以禁止GRUB4DOS自动添加。一般不需要使用这个参数。
+map --mem-max=, map --mem-min options to be used before map --mem. Allow user
+ to manually limit range of address that map --mem can use.
+
+safe_parse_maxint_with_suffix function parses K,M,G,T suffix after number.
+注:更新的GRUB4DOS版本中已经使用这个参数替换了默认的safe_parse_maxint函数。
+所以只要支持数值的命令行都可以使用以上特性。比如:
+read 0x100000 //读取内存1MB处的数值
+可以写成如下方式,方便使用。
+read 1m
+其它的命令只要支持数值输入的都可以使用这个特性。
+
+******************************************************************************
+*** Graphics mode 6A: 800x600 with 16 colors ***
+******************************************************************************
+
+现在有两2种可选的图形模式,默认的是640x480模式.
+新的是800x600模式(对一些机子支持不是很好,有可能会死机)。
+
+使用以下方法可以切换图形显示模式。
+
+1. 确定目前是在控制台模式,你可以执行命令 "terminal console" 进行切换。
+2. 使用命令"graphicsmode 0x6a" 设置图形模式为0x6A。
+3. 进入图形模式,你可以使用命令"terminal graphics".
+ 如果在切换之前不是图形模式,那该命令无效,你可以使用splashimg或fontfile命令。
+
+注: 1. 如果想换回默认的640x480,把上面的第2步改成"graphicsmode 0x12".
+ 2. 经过改进,更新的版本,可以直接改变,只要上面第2步一条命令就可以搞定。
+ 例子:
+ 在默认图形模式中(使用splashimage或fontfile命令都会进入图形模式).
+ 输入以下命令可以直接切换到800x600.
+ graphicsmode 0x6a
+
+*****************************************************************************
+***** GRUB4DOS的变量支持 *****
+*****************************************************************************
+
+新的版本支持变量,用法和MSDOS一样。
+关键命令:
+ set [/p] [/a|/A] [/l|/u] [VARIABLE=[STRING]]
+
+ variable 指定环境变量名(最长8个字符)。
+ string 指定要指派给变量的一系列字符串(最长512个字符)。
+
+ 不带参数的 SET命令会显示当前变量。
+
+ 要删除某个变量,只需要让=后面为空就可以
+ set myvar=
+ 将会删除变量myvar
+
+ 显示已使用的名称的所有变量的值。例如:
+ set ex_
+ 会显示所有以ex_开头的变量,如果没有任何匹配返回0.
+
+注:1.使用和MSDOS一样的处理方用户法,一整行的命令会在执行前先进行变量替换。
+ 2.变量名必须使用字母或_开头。否则你将无法访问你的变量。
+ 3.长度限制请看前面说明。
+ 4.输入"set *"可以清除所有已设置的变量。
+ 5./a 后面的STRING是一个表达式,将调用CALC进行计算,保存结果为10进制数。
+ 6./A 同上,但保存结果为16进制数。
+ 7./l|/u 大小写转换。
+ 8./p 显示一个提示STRING并获取用户的输入内容并设置为变量VARIABLE的值。
+
+
+新增的命令if
+ if [/I] [NOT] STRING1==STRING2 [COMMAND]
+ if [NOT] exist VARIABLE|FILENAME [COMMAND]
+ 1.如果STRING1==STRING2 字符串匹配,执行后面的COMMAND(如果有指定的话)。
+ 否则返回TRUE。
+ 2./I 参数指写不区分大小写匹配。
+ 3.[NOT] 相反,如果STRING1==STRING2不匹配。
+ 4.exist 用于判断变量VARIABLE或文件FILENAME是否存在(filename必须以"/"或"("开头).
+
+ 例子:
+ 1.判断字符串是否相等,并且不区分大小写。
+ if /i test==%myvar% echo this is a test
+ 2.判断字符是否为空。
+ if %myvar%#==# echo variable myvar not defined.
+ 注:我们使用了一个#不防止空操作,当然也可以使用其它字符,如
+ if "%myvar%"=="" echo variable myvar not defined.
+
+使用方法举例:
+ 1.显示一个包括变量的串。
+ echo myvar = %myvar%
+ 2.使用一个变量代替命令。
+ set print=echo
+ %print% This a test.
+ 3.你可以使用一个“^”来阻此被变被扩展,例子
+ echo %myvar^%
+ 或
+ echo %my^var%
+ 将会显示 %myvar%而不是扩展myvar之后的字符。
+ 总之,只要出现了^那就不会扩展这个变量。
+
+注:我们只处理在%%之间的^符号。
+
+*****************************************************************************
+***** GRUB4DOS的批处理脚本支持 *****
+*****************************************************************************
+
+新的版本支持运行一个批处理脚本,语法和MS-DOS的批处理几乎一模一样。
+你不需要学习新的知识就可以应用GRUB4DOS的批处理,唯一要做的就是学习GRUB4DOS命令。
+
+例子一个简单的脚本(看一下是不是和MS-DOS一样):
+ =========GRUB4DOS BATCH SCRIPT START===============================
+ !BAT #注:文件头!BAT是必须的用于识别这是一个GRUB4DOS批处理脚本
+ echo %0
+ echo Your type: %1 %2 %3 %4 %5 %6 %7 %8 %9
+ call :label1 This is a test string
+ goto :label2
+ :label1
+ echo %1 %2 %3 %4 %5 %6 %7 %8 %9
+ goto :eof
+ :label2
+ echo end of batch script.
+ =========GRUB4DOS BATCH SCRIPT END===============================
+
+一些区别说明:
+ 1.出现错误时将停止执行。
+ 2.如果需要中途停止批处理脚本的运行可以用exit 1
+ 3.%9是指剩下的所有参数。
+ 4.支持shift命令。
+ 5.可扩展参数
+ %~d0 扩展%0到磁盘号.例如:(hd0,0),默认是()。
+ %~p0 扩展%0到一个路径。
+ %~n0 扩展%0到一个文件名.
+ %~x0 扩展%0到一个文件扩展名。
+ %~f0 扩展%0到一个完整的文件路径名(相当于%~dpnx0).
+ %~z0 扩展%0到文件大小.
+ 6.其它用法请参考CMD的批处理。
+在这里可以找到一些脚本
+http://chenall.net/post/tag/grub4dos/
+
+********************************************************************************
+ 条件菜单(iftitle)
+********************************************************************************
+自2011-12-04的版本开始支持条件菜单,可以根据某个特定的条件来决定是否显示某个菜单。
+为了区别之前的普通菜单,使用新的参数iftitle。
+语法如下:
+ iftitle [<command>] Actual Title displayed\nOptional help line
+ iftitle [<command>] 菜单标题\n菜单帮助
+
+注意:
+ 1.command必须是一个合法的GRUB4DOS命令,支持调用外部命令。
+ 注:像echo/pause之类的命令在条件菜单命令中被禁用。
+ 大部份的命令都可以使用,如果碰到不能使用的不要奇怪,非要使用可以提交BUG。
+ 2.菜单标题前至少要保留一个空格.
+ 3.[]是必须的,不可少。
+ 4.如果[]里面的内容为空相当于title即不判断。
+ 5.你可以使用该功能来快速注释整个菜单的内容(不显示菜单),只需要使用一个非法的命令即可。 \ No newline at end of file
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/badgrub.exe b/client/shared/lib/grub4dos/grub4dos-0.4.5b/badgrub.exe
new file mode 100644
index 00000000..213d401b
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/badgrub.exe
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/bootlace.com b/client/shared/lib/grub4dos/grub4dos-0.4.5b/bootlace.com
new file mode 100755
index 00000000..1e514853
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/bootlace.com
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/config.sys b/client/shared/lib/grub4dos/grub4dos-0.4.5b/config.sys
new file mode 100644
index 00000000..9aa253ef
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/config.sys
@@ -0,0 +1,6 @@
+rem load grub.exe before emm386.exe
+device=grub.exe --bypass --time-out=5 --config-file="color black/cyan yellow/cyan;timeout 60;default 0;title find and load NTLDR of Windows NT/2K/XP;find --set-root /ntldr;chainloader /ntldr;title find and load CMLDR, the Recovery Console of Windows NT/2K/XP;find --set-root /cmldr;chainloader /cmldr;write 0x7C03 0x63646D63;write 0x7C07 0x00736E6F;title find and load IO.SYS of Windows 9x/Me;find --set-root /io.sys;chainloader /io.sys;title floppy (fd0);chainloader (fd0)+1;rootnoverify (fd0);title find and boot Linux with menu.lst already installed;find --set-root /sbin/init;configfile /boot/grub/menu.lst;title find and boot Mandriva with menu.lst already installed;find --set-root /etc/mandriva-release;configfile /boot/grub/menu.lst;title back to dos;quit;title commandline;commandline;title reboot;reboot;title halt;halt;"
+
+device=c:\windows\himem.sys
+device=c:\windows\emm386.exe
+
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/default b/client/shared/lib/grub4dos/grub4dos-0.4.5b/default
new file mode 100644
index 00000000..689c3c8b
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/default
@@ -0,0 +1,46 @@
+
+#
+#
+#
+#
+#
+#
+#
+#
+#
+#
+# !!!!!!! The file size is 2048 bytes. Don't change the file size !!!!!!!
+# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# WARNING: If you want to edit this file directly, do not remove any line
+# from this file, including this warning. XXXXXXXXXXXXXXXXXXXXXXXXXXX
+# XXXXXXXXXXXXXXXXXXXXX
+# !!!!!!! The file size is 2048 bytes. Don't change the file size !!!!!!!
+# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr
new file mode 100644
index 00000000..50e25d53
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr.mbr b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr.mbr
new file mode 100644
index 00000000..69c013ab
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grldr.mbr
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.exe b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.exe
new file mode 100644
index 00000000..4f23b566
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.exe
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.pif b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.pif
new file mode 100644
index 00000000..28b43805
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/grub.pif
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/hmload.com b/client/shared/lib/grub4dos/grub4dos-0.4.5b/hmload.com
new file mode 100644
index 00000000..04c794c3
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/hmload.com
Binary files differ
diff --git a/client/shared/lib/grub4dos/grub4dos-0.4.5b/menu.lst b/client/shared/lib/grub4dos/grub4dos-0.4.5b/menu.lst
new file mode 100644
index 00000000..12436167
--- /dev/null
+++ b/client/shared/lib/grub4dos/grub4dos-0.4.5b/menu.lst
@@ -0,0 +1,132 @@
+# This is a sample menu.lst file. You should make some changes to it.
+# The old install method of booting via the stage-files has been removed.
+# Please install GRLDR boot strap code to MBR with the bootlace.com
+# utility under DOS/Win9x or Linux.
+
+color blue/green yellow/red white/magenta white/magenta
+timeout 30
+## menu border color
+color border=0xEEFFEE
+## set vbe mode
+graphicsmode -1 640 480:800
+## loading splashimage
+splashimage /boot/grub/splashimage.xpm || splashimage /boot/grub/splashimage.bmp
+default /default
+## Menu AutoNumber
+write 0x8274 0x2001
+
+title find and load NTLDR of Windows NT/2K/XP\n find and load NTLDR of Windows NT/2K/XP
+fallback 1
+find --set-root --ignore-floppies --ignore-cd /ntldr
+map () (hd0)
+map (hd0) ()
+map --rehook
+find --set-root --ignore-floppies --ignore-cd /ntldr
+chainloader /ntldr
+savedefault --wait=2
+
+#iftitle only show when command in [] returns true
+# set a variable named bootmgr where /bootmgr is found.
+iftitle [find --set-root --devices=h /bootmgr && call set bootmgr=%@root^%] load BOOTMGR of Windows VISTA/WIN7/WIN2008 on %bootmgr%
+chainloader %bootmgr%/bootmgr
+savedefault --wait=2
+
+title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
+fallback 3
+find --set-root --ignore-floppies --ignore-cd /cmldr
+map () (hd0)
+map (hd0) ()
+map --rehook
+find --set-root --ignore-floppies --ignore-cd /cmldr
+chainloader /cmldr
+#####################################################################
+# write string "cmdcons" to memory 0000:7C03 in 2 steps:
+#####################################################################
+# step 1. Write 4 chars "cmdc" at 0000:7C03
+#write 0x7C03 0x63646D63
+# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
+#write 0x7C07 0x00736E6F
+
+# or.
+#write --offset=3 (md)0x3e+1 cmdcons
+# or
+calc *0x7c03=0x00736E6F63646D63
+
+savedefault --wait=2
+
+title find and load IO.SYS of Windows 9x/Me
+fallback 4
+find --set-root /io.sys
+chainloader /io.sys
+savedefault --wait=2
+# you can also use below commands.
+# find --set-root chainloader /io.sys
+# boot
+# the boot is necessary,
+# please see "Delimitors or comments between titles" in grub4dos_readme.txt.
+
+title find and boot 0PE.ISO
+fallback 5
+find --set-root /0PE/0PE.ISO
+map /0PE/0PE.ISO (0xff) || map --mem /0PE/0PE.ISO (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title find and boot MicroPE.ISO
+fallback 6
+find --set-root /boot/MicroPE.ISO
+map /boot/MicroPE.ISO (0xff) || map --mem /boot/MicroPE.ISO (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title Parted Magic ISO
+fallback 7
+find --set-root /pmagic.iso
+map /pmagic.iso (0xff) || map --mem /pmagic.iso (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title Ultimate Boot CD ISO
+fallback 8
+find --set-root /ubcd.iso
+map /ubcd.iso (0xff) || map --mem /ubcd.iso (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title SliTaz ISO
+find --set-root /slitaz.iso
+map /slitaz.iso (0xff) || map --mem /slitaz.iso (0xff)
+map --hook
+chainloader (0xff)
+
+title commandline
+commandline
+
+title floppy (fd0)
+chainloader (fd0)+1
+rootnoverify (fd0)
+# or use below commands.
+# rootnoverify (fd0)
+# chainloader +1
+
+title back to dos
+quit
+
+title reboot
+reboot
+
+title halt
+halt
+
+title MAXDOS.IMG
+find --set-root --ignore-floppies /boot/MAXDOS.IMG
+map --mem /boot/MAXDOS.IMG (fd0)
+map --hook
+chainloader (fd0)+1
+rootnoverify (fd0)
+
+