nt6以后(vista,win7,2008),引导程序从ntldr变成了bootmgr。
加载过程为
BIOS > MBR > BOOTMGR > BCD > winload.exe
BCD相当于原来的boot.ini,存储了启动菜单等
windows/system32/bcdedit是编剧BCD的工具。
bcdedit /?
bcdedit /? ID
bcdedit /? TYPES DEVOBJECT
bcdedit /? TYPES
set STID=bcd
bcdedit /store %STID% /enum all
bcdedit /createstore %STID%
bcdedit /store %STID% /create {bootmgr} /d "Windows Boot Manager"
bcdedit /store %STID% /set {bootmgr} device boot
bcdedit /store %STID% /timeout 30
bcdedit /store %STID% /set {bootmgr} DISPLAYBOOTMENU yes
bcdedit /store %STID% /create {ramdiskoptions} /d "WinPE"
bcdedit /store %STID% /set {ramdiskoptions} RAMDISKSDIDEVICE boot
bcdedit /store %STID% /set {ramdiskoptions} RAMDISKSDIPATH "\boot\boot.sdi"
bcdedit /store %STID% /create /d "WinPE" /application osloader
;#这里会返回一个GUID
set ID=返回的GUID
bcdedit /store %STID% /set {%ID%} device ramdisk=[boot]\sources\boot.wim,{ramdiskoptions}
bcdedit /store %STID% /set {%ID%} path \windows\system32\boot\winload.exe
bcdedit /store %STID% /set {%ID%} osdevice ramdisk=[boot]\sources\boot.wim,{ramdiskoptions}
bcdedit /store %STID% /set {%ID%} systemroot \windows
bcdedit /store %STID% /set {%ID%} winpe yes
bcdedit /store %STID% /set {%ID%} detecthal yes
bcdedit /store %STID% /displayorder {%ID%} /addlast
;# 引导grub4dos
bcdedit /store %STID% /create /d "GRUB4DOS" /application bootsector
set ID=返回的GUID
bcdedit /store %STID% /set {%ID%} device boot
bcdedit /store %STID% /set {%ID%} path \grldr.mbr
bcdedit /store %STID% /displayorder {%ID%} /addlast
阅读(1337) | 评论(0) | 转发(0) |