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: Fri, 16 Dec 2016 09:45:14 -0800

   Yes I mean the function called RGB and I found the function. It looks
   close to the documentation example that I saw.
   6:09 AM, December 16, 2016, Andrei Borzenkov <address@hidden>:

     On Fri, Dec 16, 2016 at 7:21 AM, Tristan ross
     <address@hidden> wrote:

     Â Link to code:
     Â [2]https://github.com/SpaceboyRoss01/ronix/blob/master/src/Kernel/
     system/graphics.c
     Â Function is rgb

     There is no function with this name. Assuming you mean function RGB
     and assuming you are trying to create binary pixel value for frame
     buffer (and not to simply get 16777215 as result), you can look at
     grub_video_fb_map_rgb() in grub sources to get the idea how it can
     be
     done, except this obviously depends on representation of individual
     color value which you did not explain as well ...

     Â 8:16 PM, December 15, 2016, Andrei Borzenkov
     <address@hidden>:
      16.12.2016 07:02, Tristan ross пишет:
     Â Â I use GRUB2 to boot up and set graphical mode. The function
     reads the
     Â multiboot
     Â Â headers and uses it to render.
     Â Please post you code in plain text without any extra characters so
     it is
     Â readable. Or post direct link to your code.
     Â Â 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][5]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_siz
     e) - r) <<
     Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics_mbi->framebuffer_red_field_po
     sition;
                    Â Â Â Â Â Â Â Â Â Â Â color
     += ((g <<
     Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics_mbi->framebuffer_green_mask_s
     ize) - g) <<
     Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics_mbi->framebuffer_green_field_
     position;
                    Â Â Â Â Â Â Â Â Â Â Â color
     += ((b <<
     Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics_mbi->framebuffer_blue_mask_si
     ze) - b) <<
     Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics_mbi->framebuffer_blue_field_p
     osition;
                    Â Â Â Â Â Â Â Â Â Â Â
     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.
     [6]https://github.com/SpaceboyRoss01/ronix
     Â Â Â Â Â Â Â Â Â Â Â Â ____________________________________________
     ___
     Â Â Â Â Â Â Â Â Â Â Â Â Help-grub mailing list
     Â Â Â Â Â Â Â Â Â Â address@hidden
     <mailto:address@hidden>
     Â Â Â Â Â Â Â Â Â Â [9]https://lists.gnu.org/mailman/listinfo/help-g
     rub
     Â Â --
     Â Â Sent from Yandex.Mail for mobile
     Â --
     Â Sent from Yandex.Mail for mobile

   --
   Sent from Yandex.Mail for mobile

References

   1. mailto:address@hidden
   2. 
https://github.com/SpaceboyRoss01/ronix/blob/master/src/Kernel/system/graphics.c
   3. mailto:address@hidden
   4. mailto:address@hidden
   5. https://github.com/SpaceboyRoss01/ronix
   6. https://github.com/SpaceboyRoss01/ronix
   7. mailto:address@hidden
   8. mailto:address@hidden
   9. https://lists.gnu.org/mailman/listinfo/help-grub


reply via email to

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