help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub2 Graphics In OS


From: Tristan ross
Subject: Re: Grub2 Graphics In OS
Date: Thu, 15 Dec 2016 20:02:06 -0800

   I use GRUB2 to boot up and set graphical mode. The function reads the
   multiboot headers and uses it to render.
   7:45 PM, December 15, 2016, Andrei Borzenkov <address@hidden>:

     15.12.2016 22:29, Tristan ross пишет:

     Â Â Â Â Hey, I've got my os to boot with grub2 and it goes into
     graphics mode.

     "It" - grub or os?

     Â Â Â Â I'm trying to set the rgb color of pixels but I just get
     blue when I
     Â Â Â Â run my function to generate an rgb color.

     How is your function related to grub?

     Â Â Â Â Code is at [1][1]https://github.com/SpaceboyRoss01/ronix

     There is no single commit message there to understand what you are
     doing.

         Â
     Â Â Â Â Code to generate color:
     Â Â Â Â unsigned int graphics_color(int r,int g,int b) {
         Â Â Â unsigned int color = ((r*1000)+(g*100)+(b*10));

     This is unreadable and in any case, posting random snippet without
     telling where this snippet comes from is useless. Please post in
     plain
     text and explain, where this code comes from and what you are
     attempting
     to do.

         Â Â Â switch(graphics_mbi->framebuffer_type) {
         Â Â Â Â Â Â Â case MULTIBOOT_FRAMEBUFFER_TYPE_RGB:
         Â Â Â Â Â Â Â Â Â Â Â color = ((r <<
     Â Â Â Â graphics_mbi->framebuffer_red_mask_size) - r) <<
     Â Â Â Â graphics_mbi->framebuffer_red_field_position;
         Â Â Â Â Â Â Â Â Â Â Â color += ((g <<
     Â Â Â Â graphics_mbi->framebuffer_green_mask_size) - g) <<
     Â Â Â Â graphics_mbi->framebuffer_green_field_position;
         Â Â Â Â Â Â Â Â Â Â Â color += ((b <<
     Â Â Â Â graphics_mbi->framebuffer_blue_mask_size) - b) <<
     Â Â Â Â graphics_mbi->framebuffer_blue_field_position;
         Â Â Â Â Â Â Â Â Â Â Â break;
         Â Â Â Â Â Â Â case
     MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT:
         Â Â Â Â Â Â Â Â Â Â color = '\\' |
     ((r*1000)+(g*100)+(b*10));
         Â Â Â Â Â Â Â Â Â Â break;
         Â Â Â }
         Â Â Â #ifdef DEBUG
         Â Â Â debugf("RGB(%d,%d,%d) = %d\n",r,g,b,color);
         Â Â Â #endif
         Â Â Â return color;
     Â Â Â Â }
         Â
     Â Â Â Â I'm running graphics_color(255,255,255) which returns
     -50200321
     Â Â Â Â How do I fix this so it returns 16777215
     Â Â Â Â I used the grub2 multiboot documentation.
     Â References
     Â Â Â Â 1. [2]https://github.com/SpaceboyRoss01/ronix
     Â _______________________________________________
     Â Help-grub mailing list
     Â address@hidden
     Â [4]https://lists.gnu.org/mailman/listinfo/help-grub

   --
   Sent from Yandex.Mail for mobile

References

   1. https://github.com/SpaceboyRoss01/ronix
   2. https://github.com/SpaceboyRoss01/ronix
   3. mailto:address@hidden
   4. https://lists.gnu.org/mailman/listinfo/help-grub


reply via email to

[Prev in Thread] Current Thread [Next in Thread]