g-bios | An open-source bootrom project | REST library
kandi X-RAY | g-bios Summary
kandi X-RAY | g-bios Summary
An open-source bootrom project (BL0 or BL1)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of g-bios
g-bios Key Features
g-bios Examples and Code Snippets
Community Discussions
Trending Discussions on g-bios
QUESTION
Tools I'm using: nasm, qemu-system-x86_64.
Operating System I'm on: Windows 10.
So I checked out the "Real Mode OS Warning" at https://wiki.osdev.org/Real_Mode_OS_Warning
What the article seems to imply is that everything can be done without using BIOS interrupts whatsoever. I know how to load Long Mode, and so I've done this, but now I am stuck because BIOS interrupts were all I knew until now. I want to do something like set the graphics mode to full-memory-access-mode (might sound familiar if you've seen int 10h / AX = 4F02h / BX = 81FFh
), but since I don't want to use something that's deprecated (BIOS), I have been having trouble searching the web for how to set the graphics mode and then access individual pixels in Long Mode only.
Hopefully it turns out to be possible to answer this question on StackOverflow. I have much faith that "it's too complicated" won't show up as an answer, especially since I was just told by OSDev NOT to use deprecated things. Telling someone it's too difficult assumes what they know and what they're able to learn without even knowing who they are. I just need a starting point to find out how to do this.
To give clarification, things that didn't work for me:
Enter graphics mode without interrupts in assembly
This didn't work for me because the answer gives a link to VGA, which I don't want.
Graphics mode in assembly 8086
This didn't work for me because the question does not ask about Long Mode, but rather about VGA graphics in Real Mode.
How to write data to a graphics card without using BIOS?
This didn't work for me because the answer was essentially "it's too complicated, use the deprecated stuff", which is the opposite of what i'm trying to do and quite contradictory to what I was just told on OSDev.
Drawing directly by graphics card on Intel 8086
This didn't work for me because the answer has nothing to do with setting the graphics mode.
A few x86 Assembly language questions
This didn't work for me because the answers do not say how to set the graphics mode in UEFI. They only talk about deprecated things.
...ANSWER
Answered 2018-Oct-30 at 04:33Here is sample code that uses UEFI to get and print the available graphics modes on the first graphics device and optionally sets the mode.
I used this reference: http://wiki.phoenix.com/wiki/index.php/EFI_GRAPHICS_OUTPUT_PROTOCOL.
Notes on the implementation:
- It calls LocateProtocol to obtain a Graphics Output Protocol. I tried using LocateHandle to obtain all the handles that support Graphics Output Protocol. It returned two handles, but OpenProtocol failed. I haven't had a chance to debug the version with LocateHandle. This version using LocateProtocol works.
- It prints the number of available modes, the current mode, and the characteristics of each mode.
- The parameter to the function is the mode to set. If it is -1, the mode is not changed. Otherwise it must be between 0 and N - 1, where N is the number of graphics modes supported. The parameter is not checked by this function, but the SetMode function checks it.
- It uses Sys V x86-64 function calling conventions, except for calls to UEFI functions, which use the UEFI convention.
- It uses a function called efi_printf, which works just like printf and writes to ConOut using EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
- It relies on the startup code storing a pointer to the EFI Boot Services Table in a global variable named efi_boot_services.
- It is written for gas rather than nasm.
Here is sample output:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install g-bios
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page