Chinaunix首页 | 论坛 | 博客
  • 博客访问: 610526
  • 博文数量: 142
  • 博客积分: 116
  • 博客等级: 入伍新兵
  • 技术积分: 1445
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-28 08:37
文章分类

全部博文(142)

文章存档

2017年(7)

2016年(57)

2015年(48)

2014年(30)

我的朋友

分类: WINDOWS

2014-05-30 16:43:54

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


阅读(1263) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~