Masm32 SDK description, downloads and other helpful links
Started by Biterider, June 04, 2022, 07:10:58 AM
Quote from: Biterider on June 04, 2022, 07:10:58 AMTARGET_PLATFORM = UEFITARGET_BIN_FORMAT = DLLTARGET_BITNESS = 64
TARGET_USER_INTERFACE = USER_INTERFACE_NONE
Quote from: Biterider on June 04, 2022, 07:10:58 AMThese new procedures will be prefixed with "UEFI_"
Quote from: Biterider on June 04, 2022, 07:10:58 AMUnsolved are precompiled objects with modified memory management.
QuotePrefix is a so bad idea that I think you say that to force participation .
StrAllocA proto :DWORDStrAllocW proto :DWORDUEFI_StrAllocA proto :DWORDUEFI_StrAllocW proto :DWORDif TARGET_PLATFORM eq PLATFORM_WINDOWS if TARGET_STR_TYPE eq STR_TYPE_ANSI StrAlloc textequ <StrAllocA> elseif TARGET_STR_TYPE eq STR_TYPE_WIDE StrAlloc textequ <StrAllocW> else echo Warning: incompatible TARGET_STR_TYPE endifelseif TARGET_PLATFORM eq PLATFORM_UEFI if TARGET_STR_TYPE eq STR_TYPE_ANSI StrAlloc textequ <UEFI_StrAllocA> elseif TARGET_STR_TYPE eq STR_TYPE_WIDE StrAlloc textequ <UEFI_StrAllocW> else echo Warning: incompatible TARGET_STR_TYPE endifendif
; Procedure: UEFI_StrAllocW; Purpose: Allocate space for a WIDE string with n characters.; Arguments: Arg1: Character count without the ZTC.; Return: rax -> New allocated WIDE string or NULL if failed.align ALIGN_CODEUEFI_StrAllocW proc dChars:DWORD local pBuffer:POINTER lea edx, [2*ecx + 2] ;Make room for the ZTC mov r8, pBootServices invoke [r8].EFI_BOOT_SERVICES.AllocatePool, EFI_MEMORY_UC, edx, addr pBuffer ;Not cacheable .if rax == EFI_SUCCESS mov rax, pBuffer m2z CHRW ptr [rax] ;Set the ZTC .else xor eax, eax .endif retUEFI_StrAllocW endp
Quote from: Biterider on June 04, 2022, 08:53:29 PMNothing has changed from a programmer's point of view. The prefix is hidden in the alias.
Quote from: HSE on June 03, 2015, 12:22:15 AMThe documentation is non existing, and we need to understand the use from the code. Very funny but slow.
Quote from: Biterider on June 04, 2022, 08:53:29 PMWhat worries me is that getting UEFI into the model is a lot of work, but nothing too complicated. It's just going to take some time.Understanding UEFI is complex, but we'll get through it.
Quote from: Biterider on June 09, 2022, 08:00:27 AMAs far as I can tell, a lot of things have changed to help the programmer since the early days of ObjAsm.
Quote from: Biterider on June 09, 2022, 08:00:27 AMAdditionally, there are some examples of increasing level of complexity and an API help file for RadAsm (see attached image). To better understand the object hierarchy and to read the object method documentation quickly, you have the OA_ObjExplorer in the project folder.Maybe some tools are not perfect or incomplete, but I'm open to discuss changes to improve them.
Quote from: Biterider on June 09, 2022, 08:00:27 AMAs you suggested, I will change the original approach and use UEFI procedures with a posfix. These procs will be aliased like the string procedures.
invoke StrNew, $OfsCStr("Complete", 13, 10)
Quote from: Biterider on June 24, 2022, 04:04:59 AMI failed to check the logic of the code and the missing comments make it difficult for me to follow.
Quote from: Biterider on June 24, 2022, 04:04:59 AMI ran the code through my code formatter
Quote from: Biterider on June 24, 2022, 04:04:59 AMThe UEFI specification explicitly says about EFI_BOOT_SERVICES.Exit that the ExitData must be allocated from a pool, which is what StrNew does https://uefi-d.dpldocs.info/uefi.spec.EFI_EXIT.html#:~:text=The%20ExitData%20buffer%20must%20be%20allocated%20by%20calling%20AllocatePool().
invoke [xbx].EFI_BOOT_SERVICES.Exit, ImageHandle, EFI_SUCCESS, 0, NULL
Quote from: Biterider on June 24, 2022, 04:04:59 AMIt would be cool if you have some time if you could double check the code. I uploaded a lot of changes to the ObjMem library yesterday, so it would be a good idea to sync the code.
Quote from: Biterider on June 24, 2022, 07:29:20 AMThe caller of this function is responsible for returning the ExitData buffer to the pool by calling FreePool() when the buffer is no longer needed.