public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* EDK debug question
@ 2018-01-24  6:31 JUNWEN JIA
  2018-01-24  6:55 ` Andrew Fish
  0 siblings, 1 reply; 5+ messages in thread
From: JUNWEN JIA @ 2018-01-24  6:31 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Andrew Fish

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 版邮件应用



^ permalink raw reply	[flat|nested] 5+ messages in thread
* EDK debug question
@ 2018-01-24  8:30 JUNWEN JIA
  0 siblings, 0 replies; 5+ messages in thread
From: JUNWEN JIA @ 2018-01-24  8:30 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Andrew Fish

Hi, Andrew:
     Thanks a lot and I really appreciate your suggestion. But the assembly language code is for getting started, 
and I may have to write C language embedded with assembly language and compile through EDK. That is why 
I have to use assembly language to achieve the restart function. 
    And I have some doubts, if I call functions that already exists in BaseLib->Ia32,for example:
     #include<Library/BaseLib.h>
 Void main()
 {
 WriteMsr64(0,0);
 }
 This can be compiled successfully and .efi file can be generated.
 
 Best regards!
 

发送自 Windows 10 版邮件应用



^ permalink raw reply	[flat|nested] 5+ messages in thread
* EDK debug question
@ 2018-01-24  2:23 JUNWEN JIA
  2018-01-24  3:00 ` Andrew Fish
  0 siblings, 1 reply; 5+ messages in thread
From: JUNWEN JIA @ 2018-01-24  2:23 UTC (permalink / raw)
  To: edk2-devel@lists.01.org 

Hi:
Thanks for your replies. I referred to some examples in baselib, for example,WriteMsr64.asm, WriteMsr64.nasm, 
WriteMsr64.c and create Reboot.asm, Reboot.nasm, Reboot.c file in MdePkg->Library->BaseLib-> Ia32. I also made some 
corresponding Changes in BaseLib.inf and other files. And I did avoid to use X64 arch. So my cmos.c source file in AppPkg is like 
this:
#include<Library/BaseLib.h>
Void main()
{
Reboot();
}
But the compiled result is Reboot.lib(Reboot.obj):error LNK2001:
####\DEBUG\cmos.dll:fatal error LINK1120:1

The picture is the compiled result, and I wonder if I missed to create or modify some files?

Thanks for helping !
Best Regards!


发送自 Windows 10 版邮件应用



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-24  8:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24  6:31 EDK debug question JUNWEN JIA
2018-01-24  6:55 ` Andrew Fish
  -- strict thread matches above, loose matches on Subject: below --
2018-01-24  8:30 JUNWEN JIA
2018-01-24  2:23 JUNWEN JIA
2018-01-24  3:00 ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox