OSDev.org
https://forum.osdev.org/

drawing with VGA
https://forum.osdev.org/viewtopic.php?f=1&t=33218
Page 2 of 3

Author:  alberinfo [ Thu Oct 11, 2018 9:30 am ]
Post subject:  Re: drawing with VGA

so, if the max VGA resolution is 640x480x16 then i wont write a non vga driver, only for a 800x600 resolution.Thanks!

Author:  bigboyav [ Sat Dec 29, 2018 3:52 am ]
Post subject:  Re: drawing with VGA

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

Author:  alberinfo [ Wed Jan 09, 2019 7:41 am ]
Post subject:  Re: drawing with VGA

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

Author:  MichaelPetch [ Wed Jan 09, 2019 11:54 am ]
Post subject:  Re: drawing with VGA

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.

Author:  alberinfo [ Wed Jan 09, 2019 1:31 pm ]
Post subject:  Re: drawing with VGA

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!

Author:  MichaelPetch [ Wed Jan 09, 2019 2:28 pm ]
Post subject:  Re: drawing with VGA

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.

Author:  alberinfo [ Wed Jan 09, 2019 2:32 pm ]
Post subject:  Re: drawing with VGA

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

Author:  MichaelPetch [ Wed Jan 09, 2019 2:38 pm ]
Post subject:  Re: drawing with VGA

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.

Author:  MichaelPetch [ Wed Jan 09, 2019 2:39 pm ]
Post subject:  Re: drawing with VGA

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.

Author:  alberinfo [ Wed Jan 09, 2019 2:45 pm ]
Post subject:  Re: drawing with VGA

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.

Author:  MichaelPetch [ Wed Jan 09, 2019 4:11 pm ]
Post subject:  Re: drawing with VGA

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

Author:  alberinfo [ Wed Jan 09, 2019 5:56 pm ]
Post subject:  Re: drawing with VGA

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?

Author:  alberinfo [ Thu Jan 10, 2019 11:37 am ]
Post subject:  Re: drawing with VGA

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!

Author:  MichaelPetch [ Thu Jan 10, 2019 11:41 am ]
Post subject:  Re: drawing with VGA

1<<2 or 1<<12?

Author:  alberinfo [ Thu Jan 10, 2019 11:43 am ]
Post subject:  Re: drawing with VGA

1<<2.

Page 2 of 3 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/