flat assembler
Message board for the users of flat assembler.

Index > OS Construction > SMRAM SMM Driver

Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 31 Aug 2023, 07:33
Hi
I need to save few bytes by custom SMM Driver. I know almost nothing about it.
If I try to call to get IP for own data section the mobo going to brick. Seems like the stack is non setup yet. I tried to setup it temporary on Save State but Windows freezing on load
Code:
use16
org 0
start:
        DefineStack:
        mov     ebx,[cs:0xFF84]
        mov     eax,[cs:0xFF84+4]
        mov     [cs:0xFF84],ss
        mov     [cs:0xFF84+4],esp
        mov     cx,cs
        mov     ss,cx
        mov     edx,[cs:0xFF7C]
        mov     ecx,[cs:0xFF7C+4]
        mov     esp,0xFF84
;       call    getIP
;       jmp     RestoreStack
;       DataOffset      dw 0x07EB
;                       dw 0
;                       dw 0
;                       dw 0
;       getIP:
;       ret
        RestoreStack:
        mov     ss,[cs:0xFF84]
        mov     esp,[cs:0xFF84+4]
        mov     [cs:0xFF84+4],eax
        mov     [cs:0xFF84],ebx
        mov     ebx,[cs:0xFF7C+4]       ;DataOffset
        mov     [cs:0xFF7C+4],ecx
        mov     [cs:0xFF7C],edx
    

Where can I use some few bytes in SMRAM (or anywhere else)?
Or maybe some example how to setup SMM Driver via DXE. It will be fine too as I'll be happy to configure SMM at DXE stage.
Post 31 Aug 2023, 07:33
View user's profile Send private message Visit poster's website 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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.