OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Aug 23, 2019 8:23 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: How do you change the display mode after enter protect mode
PostPosted: Fri Aug 09, 2019 8:05 am 
Offline

Joined: Fri Nov 23, 2018 10:53 pm
Posts: 13
Hello every one. I am a OS developer beginner. As we all know we can change the display mode in real mode(X86) like this
Code:
MOV AL, 0x13
MOV AH, 0x00
INT 0x10

The 0x13 means 24bits color mode in BIOS.
But How to change the display mode after you enter protect mode?
And, How to use the video card(GPU) to display picture on screen quickly?
I really like the beautiful GUI. I'd like to add GUI in my OS.


Top
 Profile  
 
 Post subject: Re: How do you change the display mode after enter protect m
PostPosted: Fri Aug 09, 2019 8:12 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 1587
Both of those questions have the same answer: write a driver for the video card.

Writing a driver is a lot of work, though, and you need a separate driver for each kind of video card. If you want to make your GUI now and worry about the drivers later, have your bootloader set up a linear frame buffer.


Top
 Profile  
 
 Post subject: Re: How do you change the display mode after enter protect m
PostPosted: Fri Aug 09, 2019 9:01 am 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 369
Graphics adapter display pretty pictures.

GPU calculates (renders) those pretty pictures.

If you want GPU support, you need hardware specific drivers, as mentioned.

Switching to LFB is relatively easy (lookup BIOS and VESA, or UEFI).

Simply put, don't change graphics mode after boot, instead choose one during boot, Win95 did that IIRC (you had to boot to change resolution). Realistically, by the time this becomes a problem you're OS has millions of users so then it's not an issue anymore.

As for good graphics, you don't need GPU support for that. Games needs GPU support, but your OS won't support pre-existing games for a long time, and if they ever do, it's likely thru emulation/virtualization, and at that point you can also emulate/virtualize drivers from other OS's.

Fast bitblit is relatively easy, so again, no issues there. You don't have to worry about any of the issues here yet.


Top
 Profile  
 
 Post subject: Re: How do you change the display mode after enter protect m
PostPosted: Fri Aug 09, 2019 12:40 pm 
Offline

Joined: Fri Nov 23, 2018 10:53 pm
Posts: 13
Octocontrabass wrote:
Both of those questions have the same answer: write a driver for the video card.

Writing a driver is a lot of work, though, and you need a separate driver for each kind of video card. If you want to make your GUI now and worry about the drivers later, have your bootloader set up a linear frame buffer.

Could you tell me the detials about writing driver and set up the linear frame buffer?


Top
 Profile  
 
 Post subject: Re: How do you change the display mode after enter protect m
PostPosted: Fri Aug 09, 2019 12:42 pm 
Offline

Joined: Fri Nov 23, 2018 10:53 pm
Posts: 13
LtG wrote:
Graphics adapter display pretty pictures.

GPU calculates (renders) those pretty pictures.

If you want GPU support, you need hardware specific drivers, as mentioned.

Switching to LFB is relatively easy (lookup BIOS and VESA, or UEFI).

Simply put, don't change graphics mode after boot, instead choose one during boot, Win95 did that IIRC (you had to boot to change resolution). Realistically, by the time this becomes a problem you're OS has millions of users so then it's not an issue anymore.

As for good graphics, you don't need GPU support for that. Games needs GPU support, but your OS won't support pre-existing games for a long time, and if they ever do, it's likely thru emulation/virtualization, and at that point you can also emulate/virtualize drivers from other OS's.

Fast bitblit is relatively easy, so again, no issues there. You don't have to worry about any of the issues here yet.

Could you tell me the details about the vesa?
and How do I use this?


Top
 Profile  
 
 Post subject: Re: How do you change the display mode after enter protect m
PostPosted: Sat Aug 10, 2019 12:53 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 1587
benji wrote:
Could you tell me the detials about writing driver and set up the linear frame buffer?

To write a driver, find the documentation for the video card you want to write a driver for, then follow that documentation.

Setting up the linear frame buffer depends on the bootloader. If you're using GRUB, set the appropriate bits in your multiboot header and tell GRUB what video mode you would like. If you're writing your own legacy BIOS bootloader, follow the VESA VBE Core specification to set the video mode, and maybe VBE/DDC to detect the attached display. If you're writing your own UEFI bootloader, look for Graphics Output Protocol in the UEFI specification, and maybe Universal Graphics Adapter in the EFI specification if you want to support Apple hardware.


Top
 Profile  
 
 Post subject: Re: How do you change the display mode after enter protect m
PostPosted: Sat Aug 10, 2019 4:02 am 
Offline

Joined: Fri Nov 23, 2018 10:53 pm
Posts: 13
Octocontrabass wrote:
benji wrote:
Could you tell me the detials about writing driver and set up the linear frame buffer?

To write a driver, find the documentation for the video card you want to write a driver for, then follow that documentation.

Setting up the linear frame buffer depends on the bootloader. If you're using GRUB, set the appropriate bits in your multiboot header and tell GRUB what video mode you would like. If you're writing your own legacy BIOS bootloader, follow the VESA VBE Core specification to set the video mode, and maybe VBE/DDC to detect the attached display. If you're writing your own UEFI bootloader, look for Graphics Output Protocol in the UEFI specification, and maybe Universal Graphics Adapter in the EFI specification if you want to support Apple hardware.

Yeah, I see. Now I chose the BIOS bootloader. I am going to search they in google later on. But I slightly confuse about these words. I really really want to know those conception like VESA VBE. Could you tell me the relationship between VESA, VGA, framebuffer and video card driver? And If I want to write a video card driver. How do I do? IHow am I start this program (I am a beginner). If I got those conception, I ensure I can finish my job quickly. Thank you so much!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group