News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Unified Extensible Firmware Interface (UEFI) Example

Started by LiaoMi, June 29, 2019, 04:04:18 AM

Previous topic - Next topic

jj2007

It works, Timo :thumbsup:

1750 ms  Uasm64msvcrt, ML 6.15 & 10.0
1500 ms  Uasm64
1400 ms  Uasm64libc
1150 ms  AsmC

johnsa

I get a general failure using this libc version on some of my test pieces

TimoVJL

#62
 :sad:
May the source be with you

TimoVJL

#63
 :sad:
May the source be with you

aw27

I turned the internal macros into external MACROS (see below) to debug better, but the error is not related to the macros, as I thought initially. I.e, the internal macros are good.

The error will disappear if we uncomment the line 'pConsole         PCONOUT 0' (see below), i.e the origin of the error 'Invalid use of pointer operator' is tracked and makes sense:


.x64p
OPTION WIN64:15
OPTION STACKBASE:Rsp
OPTION LITERALS:ON
OPTION ARCH:AVX
OPTION CASEMAP:NONE

RAWINTERFACE MACRO CName:REQ
curClass TEXTEQU <CName>
% __&CName&_size = 0
@CatStr(CName, < RAWSTRUCT >)
ptrDefS TEXTEQU <psr>
ptrDefS CATSTR ptrDefS, <&curClass&>, < TYPEDEF PTR >, <&curClass&>
% ptrDefS
;% echo _ptrDefS= ptrDefS
ENDM

ENDRAWINTERFACE MACRO
curClass ENDS
.data
% _stat&curClass& curClass <>
ENDM

STDFUNC MACRO method:REQ, retType:REQ, protoDef:VARARG
LOCAL sz1, sz2
pDef CATSTR <TYPEDEF PROTO >,<(&retType&) >
;% echo _pedef= pDef
IFNB <protoDef>
pDef CATSTR pDef, <, >, <&protoDef>
ENDIF
sz2 CATSTR <_>, curClass, <_&method>, <Pto>
% &sz2 &pDef
% sz1 typedef PTR &sz2
% method sz1 0
% __&curClass&_size = __&curClass&_size + 8
fnex TEXTEQU <_>
fnex CATSTR fnex, curClass, <_>, <&method&>, < PROTO >, <(&retType&) >

IFNB <&protoDef>
fnex CATSTR fnex, <, >, <&protoDef&>
ELSE
ENDIF
fnex
; % echo _fnex= fnex
ENDM

CHAR16     TYPEDEF WORD
P_CHAR16   TYPEDEF PTR CHAR16

RAWINTERFACE ConOut
STDFUNC OutputString, <voidarg>, pThis:PTR _ConOut, pStr:P_CHAR16
ENDRAWINTERFACE
PCONOUT TYPEDEF PTR ConOut

.data

;pConsole         PCONOUT 0 ; If we uncomment NO error
hexSTR dw 20 DUP (0)


.code

main PROC FRAME pConsoleOut:PCONOUT
pConsole->OutputString(pConsole, &hexSTR)
ret
main ENDP

END

jj2007

Works fine but AsmC is a tick faster (1400 vs 1050 ms for 21k lines test case) :thumbsup:

TimoVJL

#66
Why: no site interest, so i save site space :sad:
Experts should fix obvious things, so why i bother :undecided:
May the source be with you

johnsa

I've applied Timo's fixes in 2.50 branch now as well and can confirm it solves the bug AW showed last. A proper error is now reporting when pConsole is not defined, and assembly completes as expected when it is defined.

TimoVJL

May the source be with you

HSE

Hi johnsa!

Efi.inc line 758 must be:
RAWINTERFACE EFI_BOOT_SERVICES

Regards, HSE.
Equations in Assembly: SmplMath

Gunther

You have to know the facts before you can distort them.

HSE

Hi Gunther!

Quote from: Gunther on April 07, 2022, 03:17:30 PM
Good find!  :thumbsup:

A couple of weeks ago I maked a FreeDos USB because I found a Chourdakis work that allow to make FreeDos multicore, and can be interesting to test if some big simulations can run faster with more machine control. Happen that FreeDos rely on BIOS, and new machines with Intel chips only have UEFI  :biggrin:

Now I'm playing with very simple things. But perhaps is not so dificult to make a like-microOS program, just because a UEFI machine boot from an almost standard windows PE64 file using the X64 calling convention we know. 

Regards, HSE.
Equations in Assembly: SmplMath

HSE

Hi! again  :biggrin:

There is some problem close to Efi.inc line 324:
; *******************************************************
; EFI_FILE_PROTOCOL
; *******************************************************
RAWINTERFACE EFI_FILE_HANDLE


Not sure what the problem is, anyway that must be:
; *******************************************************
; EFI_FILE_PROTOCOL
; *******************************************************
RAWINTERFACE EFI_FILE_PROTOCOL
Equations in Assembly: SmplMath

Gunther

HSE,

Quote from: HSE on April 16, 2022, 08:50:50 AM
Hi! again  :biggrin:

There is some problem close to Efi.inc line 324:
; *******************************************************
; EFI_FILE_PROTOCOL
; *******************************************************
RAWINTERFACE EFI_FILE_HANDLE


Not sure what the problem is, anyway that must be:
; *******************************************************
; EFI_FILE_PROTOCOL
; *******************************************************
RAWINTERFACE EFI_FILE_PROTOCOL


I always notice: You're very aware. Thanks for that. :thumbsup:
You have to know the facts before you can distort them.

HSE

Hi Gunther!

Quote from: Gunther on April 16, 2022, 09:10:12 AM
I always notice: You're very aware. Thanks for that. :thumbsup:

Are you just following the subject, or building some UEFI application?

Equations in Assembly: SmplMath