flat assembler
Message board for the users of flat assembler.

Index > OS Construction > (U)EFI GUID include files

Author
Thread Post new topic Reply to topic
I



Joined: 19 May 2022
Posts: 58
I 12 Jul 2022, 05:13
Is this worth having or not?
Post 12 Jul 2022, 05:13
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 12 Jul 2022, 05:22
UEFI has lots of protocols, each with a GUID, so yes, they come in handy.
Post 12 Jul 2022, 05:22
View user's profile Send private message Reply with quote
I



Joined: 19 May 2022
Posts: 58
I 12 Jul 2022, 06:24
I was thinking along the lines of a macro
Code:
 struc GUID def
 {
   match d1-d2-d3-d4-d5, def
    \{
      .Data1 dd 0x\#d1
      .Data2 dw 0x\#d2
      .Data3 dw 0x\#d3
      .Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh
      .Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh
    \}
 }    
placed somewhere, either directly in the source code or other include file. Not being a master of macro's I don't now how to include the curly brackets one often sees encapsulating the GUID so might be something like having an inc file as
Code:
EFI_MPS_TABLE_GUID                                         equ eb9d2d2f-2d88-11d3-9a16-0090273fc14d
EFI_MP_SERVICES_PROTOCOL_GUID                              equ 3fdda605-a76e-4f46-ad29-12f4531b3d08
... and so on    
Source asm could be something like
Code:
        mov     [SysTable],rdx
        mov     rax,[rdx+EFI_SYSTEM_TABLE.BootServices] ; EFI_BOOT_SERVICES
        mov     [EBS],rax
...
        lea     r8,[MPProtocol]
        xor     edx,edx
        lea     rcx,[_EFI_MP_SERVICES_PROTOCOL_GUID]
        mov     rax,[EBS]
        call    [rax+EFI_BOOT_SERVICES_TABLE.LocateProtocol]
...
section '.data' data readable writeable 

_EFI_MP_SERVICES_PROTOCOL_GUID  GUID EFI_MP_SERVICES_PROTOCOL_GUID

...
    

Macro can also be used for non-EFI GUID's too.

Seems some names have different GUID's such as the EDK service one above vs AMI one so separate inc files I think. Attached EDK GUID's sample. Not sure what's a good way so suggestions welcome.

Edit: As there's no discussion off the bat I'll attach the other incs. Probably EDK one will be most used.


Description: Other (U)EFI GUID includes
Download
Filename: GUID_inc.7z
Filesize: 27.83 KB
Downloaded: 384 Time(s)

Description: GUID_EDK.inc
Download
Filename: GUID_EDK.7z
Filesize: 24.18 KB
Downloaded: 392 Time(s)

Post 12 Jul 2022, 06:24
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.