++++++++ The new increase ++++++++
0bh 2 Bytes per sector
0dh 1 Sectors per cluster
0eh 4 Data start Absolute sector
12h 4 The current cluster the absolute sector in fat table
16h 2 EIOS Mark Bit 7 EIOS
18h 2 Sectors per track
1ah 2 Number of heads
1ch 4 Retention
20h 4 Retention
24h 1 Drive numbe
25h 1 Partition number
26h 2 Retention
28h 4 FAT table start absolute sector number
2ch 4 Retention
++++++++ The new increase ++++++++
以下内容供开发人员参考.....
******************************************************************************
*** grldr.mbr - Details about the control bytes ***
******************************************************************************
grldr.mbr - 其控制字节的详述
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
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
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
******************************************************************************
*** 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 。
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
例子:
1.以下命令输出的是1234
set a=1234
set a=abcd && echo %a%
2.以下命令输出的是abcd
set a=1234
set a=abcd &; echo %a%
3.一个比较有用的例子,获取hd0,0的UUID,必须使用带;的符号,因为需要读取实时变量.
uuid (hd0,0) &; set UUID=%?%
DEBUG 命令现在可以用来控制冗余的命令输出:
debug [ on | off | normal | status | INTEGER ]
0 或者 off 指定为静默模式
1 或者 normal 指定为标准模式
从 2 到 0x7fffffff 或者 on 指定为冗余模式
(调试报告BUG时请使用该模式,可以获得更详细的信息)
******************************************************************************
*** GRUB4DOS 与 Windows Vista ***
******************************************************************************
首先,使用以下命令来建立一个启动项:
bcdedit /create /d "GRUB for DOS" /application bootsector
执行结果看起来类似这样:
The entry {05d33150-3fde-11dc-a457-00021cf82fb0} was successfully created.
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
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
******************************************************************************
*** Parameter file for bootlace running under DOS ***
******************************************************************************
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
!!!! Caution! Both IF and OF can be a device name which stands for !!!!
!!!! all the sectors on the device. Take utmost care! !!!!
!!!!______________________________________________________________________!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
警告!IF 和 OF 都可以是一个设备名,即它代表了设备上全部的扇区。慎之又慎!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
!!!! Caution! The file to write can be a device name which stands !!!!
!!!! for all the sectors on the device. Take utmost care! !!!!
!!!!______________________________________________________________________!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
警告!被write 命令写入的文件可以是一个设备名,即它代表了设备上的所有
扇区。慎之又慎!
# 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
******************************************************************************
*** a range of drives can be unmapped ***
******************************************************************************
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磁盘仿真程序也会在需要的时候(即,驱动器映射表非空时)自动建立挂钩。
******************************************************************************
*** Map options added by Karyonix ***
******************************************************************************
注: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
其它的命令只要支持数值输入的都可以使用这个特性。
新增的命令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之后的字符。
总之,只要出现了^那就不会扩展这个变量。
********************************************************************************
条件菜单(iftitle)
********************************************************************************
自2011-12-04的版本开始支持条件菜单,可以根据某个特定的条件来决定是否显示某个菜单。
为了区别之前的普通菜单,使用新的参数iftitle。
语法如下:
iftitle [<command>] Actual Title displayed\nOptional help line
iftitle [<command>] 菜单标题\n菜单帮助