Code: Select all
menuentry "OS365" {
multiboot /boot/os365.bin
set vbemode=1024x768x32
boot
}

Code: Select all
menuentry "OS365" {
multiboot /boot/os365.bin
set vbemode=1024x768x32
boot
}

Thanks, 1024x768x32 mode is now set, but how to get the VBE Mode Info?SapphireOS wrote:There are some flags to set in the multiboot header in the kernel image. Check the muiltiboot specification. https://www.gnu.org/software/grub/manua ... ics-fields

So get what you need from the multiboot structure that is passed by GRUB to your kernel.If bit 11 in the ‘flags’ is set, the graphics table is available. This must only be done if the kernel has indicated in the ‘Multiboot Header’ that it accepts a graphics mode.
The fields ‘vbe_control_info’ and ‘vbe_mode_info’ contain the physical addresses of vbe control information returned by the vbe Function 00h and vbe mode information returned by the vbe Function 01h, respectively.


Seriously, the multiboot specification isn't that hard to read.catnikita255 wrote:OK, now I have a last thing to ask. Is GRUB puts Multiboot info into some register or putting it to the stack? Sorry if I'm really annoying, sorry, I'm new to the GRUB2.

Thanks. That's all. Thank you, I'll add you into my secret authors info.omarrx024 wrote:Seriously, the multiboot specification isn't that hard to read.catnikita255 wrote:OK, now I have a last thing to ask. Is GRUB puts Multiboot info into some register or putting it to the stack? Sorry if I'm really annoying, sorry, I'm new to the GRUB2.
When GRUB gives control to your kernel, the EAX register contains 0x2BADB002 and the EBX register points to the physical location of the multiboot information structure.
Is that a good thing?catnikita255 wrote:Thanks. That's all. Thank you, I'll add you into my secret authors info.

Yes.kiznit wrote:Is that a good thing?catnikita255 wrote:Thanks. That's all. Thank you, I'll add you into my secret authors info.


You write to the VESA framebuffer. VESA 2.0 specs aren't that hard to read either.catnikita255 wrote:And another question: how to write pixels?

I know, but how I need to do this? Just write the RGB value to the framebuffer, or something more complicated?omarrx024 wrote:You write to the VESA framebuffer. VESA 2.0 specs aren't that hard to read either.catnikita255 wrote:And another question: how to write pixels?

Trial and error should get you decent results.catnikita255 wrote:I know, but how I need to do this? Just write the RGB value to the framebuffer, or something more complicated?

I tried it, it displays me black screen.omarrx024 wrote:Trial and error should get you decent results.catnikita255 wrote:I know, but how I need to do this? Just write the RGB value to the framebuffer, or something more complicated?![]()
In 32-bit graphical modes, you simply write a 32-bit RGB value to the framebuffer. For example, red would be 0xFF0000. The uppermost 8 bits should be zero, because they are unused.
Code: Select all
inline void putpixel(int x,int y,uint32_t color)
{
unsigned long pixindex=y*1024+x;
framebuffer[pixindex]=color;
}
