Page 6 of 7

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:12 am
by DeezRamChips
I meant plotting a pixel :D

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:14 am
by DeezRamChips
At the right position.
Look what happens:
Image

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:18 am
by Octacone
DeezRamChips wrote:At the right position.
Look what happens:
Image
lol, is that a bug?

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:20 am
by DeezRamChips
Well, when you ask grub setting a video mode it can't handle, it set's it to the highest resolution mode possible (wich is 1600x1200x32)

here is a list of the standard GRUB video modes:
http://pierre.baudu.in/other/grub.vga.modes.html

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:24 am
by Octacone
DeezRamChips wrote:Well, when you ask grub setting a video mode it can't handle, it set's it to the highest resolution mode possible (wich is 1600x1200x32)

here is a list of the standard GRUB video modes:
http://pierre.baudu.in/other/grub.vga.modes.html
Yeah I see, I set my mode to 1280x768x32 and it works fine.
By the way, how do you fill you init function. Do you save ebx to a special struct and then call init with those struct values or what?

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:26 am
by dseller
Maybe you can use some kind of instant messaging application instead of using the forum as a chatroom?

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:27 am
by Octacone
dseller wrote:Maybe you can use some kind of instant messaging application instead of using the forum as a chatroom?
That is a very good idea.

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:29 am
by DeezRamChips
in my loader:

Code: Select all

push ebx ; push the multiboot header
push eax ; push the magic numba !
call kstart ; call kernel
in my file types.h, I have the multibootheader structure:

Code: Select all

struct boot_info {
	uint32 flags;
	uint32 mem_lower;
	uint32 mem_upper;
	uint32 boot_device;
	uint32 cmdline;
	uint32 mods_count;
	uint32 mods_addr;
	uint32 num;
	uint32 size;
	uint32 addr;
	uint32 shndx;
	uint32 mmap_length;
	uint32 mmap_addr;
	uint32 drives_length;
	uint32 drives_addr;
	uint32 config_table;
	uint32 boot_loader_name;
	uint32 apm_table;
	uint32 vbe_control_info;
	uint32 vbe_mode_info;
	uint16 vbe_mode;
	uint16 vbe_interface_seg;
	uint16 vbe_interface_off;
	uint16 vbe_interface_len;
	uint64 framebuffer_addr;
	uint32 framebuffer_pitch;
	uint32 framebuffer_width;
	uint32 framebuffer_height;
	uint8 framebuffer_bpp;
	uint8 framebuffer_type;
	union
	{
		struct
		{
			uint32 framebuffer_palette_addr;
			uint16 framebuffer_palette_num_colors;
		};
		struct
		{
			uint8 framebuffer_red_field_position;
			uint8 framebuffer_red_mask_size;
			uint8 framebuffer_green_field_position;
			uint8 framebuffer_green_mask_size;
			uint8 framebuffer_blue_field_position;
			uint8 framebuffer_blue_mask_size;
		};
	};
};
and in my kernel, I have:

Code: Select all

struct boot_info *boot_information;

void kstart(int eax_magic, struct boot_info *mboot){
	boot_information = mboot;
	if(eax_magic!=0x2BADB002)
    {
        panic(itoa(eax_magic));
    }
	else{
		init(mboot->framebuffer_addr, mboot->framebuffer_pitch, mboot->framebuffer_width, mboot->framebuffer_height, mboot->framebuffer_bpp, 1024, 768);
	}
	main();
}
Simple ^_^

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:31 am
by DeezRamChips
It's easyier to post the code here than in a app like skype

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 11:31 am
by Octacone
DeezRamChips wrote:in my loader:

Code: Select all

push ebx ; push the multiboot header
push eax ; push the magic numba !
call kstart ; call kernel
in my file types.h, I have the multibootheader structure:

Code: Select all

struct boot_info {
	uint32 flags;
	uint32 mem_lower;
	uint32 mem_upper;
	uint32 boot_device;
	uint32 cmdline;
	uint32 mods_count;
	uint32 mods_addr;
	uint32 num;
	uint32 size;
	uint32 addr;
	uint32 shndx;
	uint32 mmap_length;
	uint32 mmap_addr;
	uint32 drives_length;
	uint32 drives_addr;
	uint32 config_table;
	uint32 boot_loader_name;
	uint32 apm_table;
	uint32 vbe_control_info;
	uint32 vbe_mode_info;
	uint16 vbe_mode;
	uint16 vbe_interface_seg;
	uint16 vbe_interface_off;
	uint16 vbe_interface_len;
	uint64 framebuffer_addr;
	uint32 framebuffer_pitch;
	uint32 framebuffer_width;
	uint32 framebuffer_height;
	uint8 framebuffer_bpp;
	uint8 framebuffer_type;
	union
	{
		struct
		{
			uint32 framebuffer_palette_addr;
			uint16 framebuffer_palette_num_colors;
		};
		struct
		{
			uint8 framebuffer_red_field_position;
			uint8 framebuffer_red_mask_size;
			uint8 framebuffer_green_field_position;
			uint8 framebuffer_green_mask_size;
			uint8 framebuffer_blue_field_position;
			uint8 framebuffer_blue_mask_size;
		};
	};
};
and in my kernel, I have:

Code: Select all

struct boot_info *boot_information;

void kstart(int eax_magic, struct boot_info *mboot){
	boot_information = mboot;
	if(eax_magic!=0x2BADB002)
    {
        panic(itoa(eax_magic));
    }
	else{
		init(mboot->framebuffer_addr, mboot->framebuffer_pitch, mboot->framebuffer_width, mboot->framebuffer_height, mboot->framebuffer_bpp, 1024, 768);
	}
	main();
}
Simple ^_^
Very similar structure, please lets use inbox instead of this topic.

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 1:51 pm
by glauxosdever
Hi,


Please do some research before posting.

And do not post every 2 minutes.

Regards,
glauxosdever

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 2:17 pm
by dseller
DeezRamChips wrote:It's easyier to post the code here than in a app like skype
This might be true. But you are annoying the rest of the forum users by doing so.

I also hope that you will learn that the easiest route is not necessarily the best.

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 2:21 pm
by Octacone
dseller wrote:
DeezRamChips wrote:It's easyier to post the code here than in a app like skype
This might be true. But you are annoying the rest of the forum users by doing so.

I also hope that you will learn that the easiest route is not necessarily the best.
We are using private messenger so please guys stop. This topic is [CLOSED]
Admins can you please mark this topic as closed/answered?

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 2:44 pm
by sortie
thehardcoreOS, I see from your Makefile that you are not using a cross-compiler. If that's still the case, you might want to read these wiki articles:

http://wiki.osdev.org/Bare_Bones
http://wiki.osdev.org/GCC_Cross-Compiler
http://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler%3F

Re: Setting VESA/VBE Mode

Posted: Fri Jul 15, 2016 2:50 pm
by Octacone
sortie wrote:thehardcoreOS, I see from your Makefile that you are not using a cross-compiler. If that's still the case, you might want to read these wiki articles:

http://wiki.osdev.org/Bare_Bones
http://wiki.osdev.org/GCC_Cross-Compiler
http://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler%3F
Hey sortie, I am not using gcc cross-compiler because it refused to build, I was getting some strange errors while building it...
It is a real pain to make it work since you need to manually move and install all those binutils.