Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

operating system - How get vesa infos ? In c in low level

I search how can I get information in struct about vesa. I want to complete this struct, I prefer do it in c but I also open to do this with assembly.


The vesa struct

typedef struct _vbeInfoBlock {
    uint8_t  signature[4];     // “VESA”
    uint16_t version;          // Either 0x0200 (VBE 2.0) or 0x0300 (VBE 3.0)
    uint32_t oemString;        // Far pointer to OEM name
    uint8_t  capabilities[4];  // capabilities
    uint32_t videoModesPtr;    // Far pointer to video mode list
    uint16_t totalMemory;      // Memory size in 64K blocks
    uint16_t oemSoftwareRev;
    uint32_t oemVenderNamePtr;
    uint32_t oemProductNamePtr;
    uint32_t oemProductRevPtr;
    uint8_t  reserved [222];
    uint8_t  oemData [256];
 }vbeInfoBlock;

I found this script on brokenthorn

I tried this code but I can’t put the struct

get_vesa_info:
push ebp
 mov  ebp, esp
 mov ax, 0x4f00
 mov di, ebp 
 int 0x10
 ret
If:
    CMP AX, 0x004F
    JNZ Else

Then: 
    JMP EndIF   
Else:
    MOV eax,0

EndIF:  
    mov eax, di
    pop ebp

Thank you for your help ;)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...