Hey. I apologize for this stupid question.With the text output in text mode, when working in protected mode, writing 2 bits(character + color) in with 0x000B8000 I figured out. But how do I work in SVGA mode? I want access to pixels or something. To create a drawing. To work, as I understand it, you have in memory from 0x000A0000. How's the recording going? Where to read about it?

To create a drawing. To work, as I understand it, you have in memory from 0x000A0000

That's only for VGA Graphics mode, let me explain. In VGA modes, you have memory from 0xB0000-0xB7FFF(monochrome text), 0xB8000-0xBFFFF(color text, the one you were using) and 0xA0000-0xAFFFF(VGA Graphics mode). However, for SVGA there is a framebuffer address, and you won't know the exact address since it might change, for example: the qemu framebuffer address is 0xFD000000, the bochs fb address is 0xE0000000. The address can be given pretty much the same way you'd set a video mode. In grub, you'll pass a flag wich will give you the fb address, or can be also given through the bios int 0x10.

Well, if you say that you start your computer and instantly you have a video mode, then not. But if you say by setting it up with grub or your own bootloader, then yes.

mrjbom wrote:

How do I do this with GRUB?

For grub, it depends what multiboot specification you use. If multiboot one, you'll need to add the 1 << 2 flag, and then below the checksum, you'll need to pass the options for the flag, which are:

Code:

dd 0dd 0dd 0dd 0dd 0

Those are for other flags, which you can see in the mboot specification 1.

Then you have 4 options more. The first one, will indicate grub if it haves to use graphics mode or text mode. put

Code:

dd 1

for text mode, and

Code:

dd 0

for graphics mode. The next will indicate the width of the video mode, in case of

Code:

dd 0

, that means no preference to you. The same goes to the next option, but with the width. and the last option, is the bpp(bits per pixel), wich an zero means no preference(note that all the last 4 options have to be with "dd" and then the value.)

For multiboot 2, you need to declare a separate header wich you'll need to include. The header needs to be declared like this:

Code:

dw 5dw 0dd 20

And the last three as dd, wich will declare the width, height and bpp. I strongly recommend you to read the specification that i gave you.

btw http://www.ctyme.com/intr/int.htm there you have a page with all the interrupts. in 0x10, search for svga, and you'll have what you can do with the bios int 0x10.

see how you do align 4, and then you have a header with all you need. also, the last three lines will set up an 800*600 mode with 8 bpp, but you can use the modes available for vesa.(you can see them into the interrupt list, int 0x10, ax 0x4F02)

It doesn't work. In kernel.asm file I put 800x600 32 bbp. I copied the putpixel function and try to call it like this: putpixel(0xFD000000, 1, 1, 0x7800); I should see a red pixel in the top left corner. But I don't see him.

Who is online

Users browsing this forum: No registered users and 8 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum