flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > The distinction between BIOS and UEFI

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 12 May 2024, 17:54
Could you please tell me how to check whether MenuetOS was booted using BIOS or UEFI ?

How to use function #26 (get general system info, rbx = 5 - BIOS/UEFI memory map) ?

Thanks.

_________________
smaller is better
Post 12 May 2024, 17:54
View user's profile Send private message Reply with quote
bzt



Joined: 09 Nov 2018
Posts: 77
bzt 12 May 2024, 21:49
As fas as I know, MenuetOS can only be booted on UEFI with Easyboot. Now that boot loader puts a lot of effort into making your life easier, so it does you a favour to transparently convert the memory map for you.

Therefore there's no difference in the BIOS/UEFI memory map as far as MenuetOS concerned, all you'll ever see is E820 area type codes. (FYI, there's no difference in the framebuffer, VBE/GOP, the ACPI pointer etc. either, It Just Works (TM), the actual firmware is Somebody Else's Problem (TM)).
Post 12 May 2024, 21:49
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 302
Ville 13 May 2024, 11:33
Here. Instead of 26/5, Im using 26/15 so its easier to detect the size of the e820 formatted memory map.
Code:
read_parameters:

    ; Read and display memory map

    mov   rdx , 20 shl 32 + 50
    mov   r15 , 0
  newread:
    mov   rax , 26
    mov   rbx , 15
    mov   rcx , r15
    int   0x60
    mov   rcx , rax
    mov   rax , 47
    mov   rbx , 16*65536+256
    mov   rsi , 0
    int   0x60
    add   r15 , 8
    add   rdx , 12
    cmp   rcx , -1
    jne   newread

    ; Read and display BIOS/UEFI boot

    mov   rax , 26
    mov   rbx , 13
    mov   rcx , 0x100
    int   0x60
    mov   rbx , string_bios
    mov   rcx , string_uefi
    cmp   rax , 1
    cmove rbx , rcx
    mov   rax , 4   
    mov   rcx , 150
    mov   rdx , 50 
    mov   rsi , 0x000000
    mov   r9  , 1        
    int   0x60

    ret


string_bios: db 'BIOS boot',0
string_uefi: db 'UEFI boot',0


    
Post 13 May 2024, 11:33
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 13 May 2024, 20:19
Thanks Ville.

Is the structure returned in the case of UEFI (system function 26/15) also 3 * QWord ?

To check how it works, please run NDN and select from the main menu ->
Utilities -> Memory Map

https://megawrzuta.pl/download/b463e8b707f681749417e6861d25addd.html
Post 13 May 2024, 20:19
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 302
Ville 13 May 2024, 22:06
It seems that Chrome prevents me from downloading the file (security reasons). But yes, the format is the same for both BIOS and UEFI - 3 x Qword.
Post 13 May 2024, 22:06
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 can attach files in this forum
You can download files in this forum


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

Website powered by rwasa.