Page 2 of 2

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 4:44 am
by abcdef4bfd
omarrx024 wrote:Read this carefully. :roll:
Readed, but how to get pixelwidth? In VBE Mode Info structure there's no this entry.

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 4:51 am
by BrightLight
The VBE mode information structure contains the width in pixels, height in pixels, bitdepth in bits, which should be 1024x768x32 as it is what you're using. The pitch means bytes per line. You need to use that as well. My GitHub repository has some graphical code in kernel/gdi.asm and kernel/vesa.asm. It's in assembly language, but shouldn't be too hard to convert to C.
EDIT: Forgot to say this, "pixelwidth" is just "bitdepth/8".

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 5:24 am
by abcdef4bfd
omarrx024 wrote:The VBE mode information structure contains the width in pixels, height in pixels, bitdepth in bits, which should be 1024x768x32 as it is what you're using. The pitch means bytes per line. You need to use that as well. My GitHub repository has some graphical code in kernel/gdi.asm and kernel/vesa.asm. It's in assembly language, but shouldn't be too hard to convert to C.
EDIT: Forgot to say this, "pixelwidth" is just "bitdepth/8".
I don't know assembly memory access, so what I should do?

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 5:52 am
by glauxosdever
Hi,

catnikita255 wrote:
omarrx024 wrote:The VBE mode information structure contains the width in pixels, height in pixels, bitdepth in bits, which should be 1024x768x32 as it is what you're using. The pitch means bytes per line. You need to use that as well. My GitHub repository has some graphical code in kernel/gdi.asm and kernel/vesa.asm. It's in assembly language, but shouldn't be too hard to convert to C.
EDIT: Forgot to say this, "pixelwidth" is just "bitdepth/8".
I don't know assembly memory access, so what I should do?
For a start, check out the multiboot info structure here, the one described in the multiboot specification is severely outdated. Then try to write some code which will be able to put pixels. If you don't seem to get it right, see here. But, please, try your best before asking here again, and when you get it working, please understand if it is working properly or not, and why happens that.


Regards,
glauxosdever

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 5:57 am
by abcdef4bfd
glauxosdever wrote:Hi,

catnikita255 wrote:
omarrx024 wrote:The VBE mode information structure contains the width in pixels, height in pixels, bitdepth in bits, which should be 1024x768x32 as it is what you're using. The pitch means bytes per line. You need to use that as well. My GitHub repository has some graphical code in kernel/gdi.asm and kernel/vesa.asm. It's in assembly language, but shouldn't be too hard to convert to C.
EDIT: Forgot to say this, "pixelwidth" is just "bitdepth/8".
I don't know assembly memory access, so what I should do?
For a start, check out the multiboot info structure here, the one described in the multiboot specification is severely outdated. Then try to write some code which will be able to put pixels. If you don't seem to get it right, see here. But, please, try your best before asking here again, and when you get it working, please understand if it is working properly or not, and why happens that.


Regards,
glauxosdever
OK.

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 8:57 am
by abcdef4bfd
Nothing is working. Code of putpixel:

Code: Select all

   unsigned long pixindex=y*vbeMode.pitch+x*(vbeMode.bpp/8);
   framebuffer[pixindex+0]=color;
   framebuffer[pixindex+1]=color>>8;
   framebuffer[pixindex+1]=color>>16;

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 10:03 am
by glauxosdever
Hi,

catnikita255 wrote:Nothing is working. Code of putpixel:

Code: Select all

   unsigned long pixindex=y*vbeMode.pitch+x*(vbeMode.bpp/8);
   framebuffer[pixindex+0]=color;
   framebuffer[pixindex+1]=color>>8;
   framebuffer[pixindex+1]=color>>16;
Well, what have you tried until now? You say it's not working, what are the exact results?


Regards,
glauxosdever

Re: Setting VBE modes with GRUB2

Posted: Sat Oct 17, 2015 10:07 am
by abcdef4bfd
glauxosdever wrote:Hi,

catnikita255 wrote:Nothing is working. Code of putpixel:

Code: Select all

   unsigned long pixindex=y*vbeMode.pitch+x*(vbeMode.bpp/8);
   framebuffer[pixindex+0]=color;
   framebuffer[pixindex+1]=color>>8;
   framebuffer[pixindex+1]=color>>16;
Well, what have you tried until now? You say it's not working, what are the exact results?


Regards,
glauxosdever
I tried only this, and my mind are not having any other solvings of this problem. Nothing is displaying, just black screen.

Re: Setting VBE modes with GRUB2

Posted: Sun Oct 18, 2015 12:10 am
by abcdef4bfd
Is anybody here? I still have this problem.

Re: Setting VBE modes with GRUB2

Posted: Sun Oct 18, 2015 12:20 am
by abcdef4bfd
Close the thread, I'll create new named "Putting pixels in VBE 1024*768*32 mode".