OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Sep 18, 2019 8:25 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: drawing with VGA
PostPosted: Thu Oct 11, 2018 9:30 am 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
so, if the max VGA resolution is 640x480x16 then i wont write a non vga driver, only for a 800x600 resolution.Thanks!


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Sat Dec 29, 2018 3:52 am 
Offline

Joined: Sat Dec 29, 2018 3:09 am
Posts: 10
Check out the below article, depending on your hardware your video ram should either be at 0xB8000 or 0xB0000. How you go about writing to your video ram depends on what mode your CPU is operating in, ex. if your in real mode you have to use segment registers. One other thing to keep in mind (this is mentioned in the below article) is that when writing to vram, 2 bytes are used to represent a character, one byte is for the actual character itself, and another byte is for the color of the character.

https://wiki.osdev.org/Printing_To_Screen


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 7:41 am 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
i already know that...i was wondering for graphics mode, which actually works for 320x200x16, but not for 640x480 and 720x480, the drawing function is broke, it draws lines(it should fill the screen) with different colors than the expected(generally white).i've said for a 800x600 mode because in http://www.ctyme.com/intr/rb-0069.htm, the mode 0x6A(listed as 6Ah), sets a 800x600 normally, almost in qemu.but i actually cant make a table for it and use a 800x600 mode.anyway dont worry about text mode

Thanks!

PD:also, 'cause i'm using graphic mode, the ram pointer is at 0xA0000


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 11:54 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 478
How are you changing the video mode? I assume you are in protected mode, and I seem to recall you use mulitboot? The problem is that using 0xA0000 as a base for video output, the region is using planar modes for some of the higher resolutions. You only have access part of the overall graphics memory. What you want to do is get the address of the Linear Frame Buffer (LFB) and use that address as the base for video memory.


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 1:31 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
im changing the video mode with the VGA ports, its in the repo in vga.h and vga.c.
MichaelPetch wrote:
I assume you are in protected mode, and I seem to recall you use mulitboot?.
if by multiboot you say grub, then yes.0xA0000 is base for video output ok no problem, but then the problem is that i'm not accessing all the video ram for doing 640x480 or 720x480?how can i get the LFB?

PD:if it's possible i wish to not use BIOS interrupts...i'd want to get the less amount of VM86 instructions, so i can take it out of the VM86 code and use paging correctly...

Thanks!


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 2:28 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 478
By VM86 do you mean running in a V8086 task? Or switching from protected mode to real mode (and then back? V8086 task run in protected mode and should work with paging if properly set up.


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 2:32 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
a V8086 task, it doesn't work when paging is enabled...which(for E.G) leaves me without the shutdown by the APM method, so qemu wont shutdown properly.so i want to have the less V8086 task running while paging enabled, which is just a little bit after the kmain function is loaded


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 2:38 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 478
You can get GRUB to switch to a graphics mode at boot (based on specifying a width, height,and color depth of a video mode you want) and have it return a structure that includes the linear frame address of the video memory region in the multiboot information structure.


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 2:39 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 478
If paging doesn't work with your V8086 task then your code is faulty. Do you have the code available that you are using for your v8086 task? I assume you have a V8086 monitor.


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 2:45 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
MichaelPetch wrote:
You can get GRUB to switch to a graphics mode at boot (based on specifying a width, height,and color depth of a video mode you want) and have it return a structure that includes the linear frame address of the video memory region in the multiboot information structure.
first:how do i change the video mode at boot?. 2:where i have a list of how to declare the structure so i can fill it?.
MichaelPetch wrote:
If paging doesn't work with your V8086 task then your code is faulty. Do you have the code available that you are using for your v8086 task? I assume you have a V8086 monitor.
the code is in https://github.com/alberinfo/Slidoor-OS, in 'include', 'VM86'.se https://forum.osdev.org/viewtopic.php?f=1&t=33350, and you'll se why it fails, but i dont know how to idmap the below 1mb.


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 4:11 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 478
The multiboot v1 documentation can be found here: https://www.gnu.org/software/grub/manua ... iboot.html . A header file (for C) that defines the structures use: https://www.gnu.org/software/grub/manua ... 002eh.html . An example multiboot header (and a link to some code) can be found here: viewtopic.php?f=1&t=27504


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Wed Jan 09, 2019 5:56 pm 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
Thank you very much!!!
but dont know how to fill it with the grub data..do i have to copy ebx to the multiboot.h file?


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Thu Jan 10, 2019 11:37 am 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
well, i filled the table...but i'm not giving VBE data...i have set the 1<<2 flag(video flag) in 'FLAGS', and with mode set as auto(no preference).also the apm isn't fill, but other things like the segment, offset, or length of vbe_interface, are fill, but i don't know if they are correct.the boot_loader_name is correct.

Thanks!


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Thu Jan 10, 2019 11:41 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 478
1<<2 or 1<<12?


Top
 Profile  
 
 Post subject: Re: drawing with VGA
PostPosted: Thu Jan 10, 2019 11:43 am 
Offline
Member
Member

Joined: Wed Aug 29, 2018 4:42 pm
Posts: 122
1<<2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 7 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