|
http://bbs.wuyou.net/forum.php?mod=viewthread&tid=200929 原贴
要怎样可以开机通过下面的批处理文件自动修改BOIS日期为指定日期后进入系统?
能不能把这批处理文件运行直接更改BOIS日期为指定日期。
或许先运行这个批处理文件后再加载menu.lst菜单文件。
在menu.lst修改先运行下面批处理文件再加载别的可以吗?
!BAT
::datefunc for grub4dos by chenall 2011-10-08
setlocal
debug off
set edi=0x60000
set esi=0x60004
set ebp=0x60008
set esp=0x6000C
set ebx=0x60010
set bx=0x60010
set edx=0x60014
set dx=0x60014
set ecx=0x60018
set cx=0x60018
set eax=0x6001C
set ax=0x6001C
set gs=0x60020
set fs=0x60024
set es=0x60028
set ds=0x6002c
set ss=0x60030
set eip=0x60034
set cs=0x60038
set eflags=0x60003c
::时钟服务(Clock Service——INT 1AH)
::04H —读取日期
call :BIOS_INT 1A ax=0x400
set date=%*
if exist date && goto :SET_DATE
call Fn.0 0 "%%04X%%04X" *%cx% *%dx% | set date=
echo -n The current date is: %date:~0,4%-%date:~4,2%-%date:~6%
set /p date=Enter the new date: (yyyy-mm-dd)
:SET_DATE 调用BIOS中断修改日期
::05H —设置日期
call :BIOS_INT 1A ax=0x500 cx=0x%date:~0,4% dx=0x%date:~5,2%%%date:~8,2%
exit
:BIOS_INT
::初始化系统参数
echo -n > (md)0x300+1
write %cs% -1
write %ss% -1
write %esp% -1
write %eflags% -1
write %ds% -1
write %es% -1
write %fs% -1
write %gs% -1
write %eip% 0xFFFF%1CD
shift 1
::设置参数
:参数
if "%2"=="" goto :realmode_run
write %%%1% %2
shift 1
shift 1
goto :参数
:realmode_run
call Fn.53 0x60000
exit
[ 本帖最后由 幻想ζ风 于 2012-6-10 08:17 编辑 ] |
|