Yea don't do that. 1st off EFI does not assume the PC hardware from 1984 exists in your system like the old PC BIOS.
There are EFI services that abstract these hardware features. gRT->SetWakeupTime() gRT->ResetSystem() You can lookup in the Services - Runtime Services chapter of the UEFI Spec for details. To use gRT you will need to #include <Library/UefiRuntimeServicesTableLib.h> and list UefiRuntimeServicesTableLib in the [LibraryClasses] section of the .INF file to make the gRT global compile and link in your App. Also even though you should NOT do this you could write your RTC code using the IoLib via inb is IoRead8() and outb is IoWrite8() C API and you don't have to write it in assembler. Thanks, Andrew Fish > On Jan 23, 2018, at 10:31 PM, JUNWEN JIA <jiajunwen...@gmail.com> wrote: > > Hi, Andrew: > Thanks for your reply. What I was trying is to restart my computer after 1 > minute shutdown in shell. That is why I need to get .efi file through EDK. > The following is the assembly language I wrote in Reboot.asm, and I put this > file in BaseLib->Ia32,along with Reboot.asm, Reboot.c. > .code > Reboot PROC > mov al,0bh > out 70h,al > mov al,20h > out 71h,al ;enable RTC interrupt > mov al,01h > out 70h,al > mov al,00h > out 71h,al > mov al,03h > out 70h,al > mov al,01h > out 71h,al > mov al,05h > out 70h,al > mov al,12h > out 71h,al ;wirte cmos alarm > mov al,00h > out 70h,al > mov al,00h > out 71h,al > mov al,02h > out 70h,al > mov al,00h > out 71h,al > mov al,04h > out 70h,al > mov al,12h > out 71h,al ;set cmos time > ret > Reboot ENDP > END > > > Best regards! > > 发送自 Windows 10 版邮件应用 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel