Page 1 of 1

Can I draw a pixel without assembly

Posted: Sat Feb 01, 2025 10:48 pm
by ShyLittleMeowMeow
Hi, I wonder if I can draw a pixel without assembly, I don't know anything about assembly, there's no source to learn, I just clone the Meaty Skeleton then start writing C, oh right. A few days ago I ask how to write memory management, I manage to make it works :D , the point is I just write everything in C, not even a single assembly code. So I can't manage to follow this tutorial as it is requires in this tutorial

https://wiki.osdev.org/User:Omarrx024/VESA_Tutorial

Anyways I have another account is Chu_Meo_E_Then, I sign in this account in another computer then I get blacklisted so I have to use create another account :D

Re: Can I draw a pixel without assembly

Posted: Sat Feb 01, 2025 11:08 pm
by Octocontrabass
ShyLittleMeowMeow wrote: Sat Feb 01, 2025 10:48 pmI don't know anything about assembly,
You need to learn at least a little bit of assembly if you want to write an OS.
ShyLittleMeowMeow wrote: Sat Feb 01, 2025 10:48 pmSo I can't manage to follow this tutorial as it is requires in this tutorial
Forget that tutorial. You're using Multiboot, so you can edit your Multiboot header to request a framebuffer. You'll find the address of the framebuffer in the boot information structure. You don't need to write any assembly to do that.
ShyLittleMeowMeow wrote: Sat Feb 01, 2025 10:48 pmAnyways I have another account is Chu_Meo_E_Then
An account by that name doesn't exist. There is an account named "ChuMeoEThen" but it doesn't appear to be banned.

Re: Can I draw a pixel without assembly

Posted: Sat Feb 01, 2025 11:15 pm
by ShyLittleMeowMeow
An account by that name doesn't exist. There is an account named "ChuMeoEThen" but it doesn't appear to be banned.
True, I don't know why but, I get blacklisted and thanks

Re: Can I draw a pixel without assembly

Posted: Sat Feb 01, 2025 11:22 pm
by ShyLittleMeowMeow
Sorry for annoying but I don't understand what do you mean by "edit your Multiboot header to request a framebuffer" so I hope you can explain it to me #-o

Re: Can I draw a pixel without assembly

Posted: Sat Feb 01, 2025 11:28 pm
by Octocontrabass
ShyLittleMeowMeow wrote: Sat Feb 01, 2025 11:22 pmI don't understand what do you mean by "edit your Multiboot header to request a framebuffer"
Set bit 2 of the flags and fill in whatever you want for mode_type, width, height, and depth. You can read more about it here.

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 12:22 am
by ShyLittleMeowMeow
Where I can set bit 2 of the flag ?

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 12:31 am
by iansjack
Read about the Multiboot header in the specification. Any good C tutorial or book will teach you how to manipulate individual bits using the bitwise logical operators.

This is essential knowledge that you need to master before proceeding.

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 1:39 am
by ShyLittleMeowMeow
So after awhile trying, I set flags into

Code: Select all

.set FLAGS,    1<<2
in boot.S and everything goes black, there's no text. is it still okay ?

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 3:40 am
by nullplan
Of course. This way, you request a framebuffer, so the screen is cleared and switched to graphics mode, and now you can draw to the framebuffer.

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 3:43 am
by ShyLittleMeowMeow
thanks you guys alot :D

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 3:46 am
by ShyLittleMeowMeow
yea and now I don't know how to draw a pixel :(

Re: Can I draw a pixel without assembly

Posted: Sun Feb 02, 2025 7:30 am
by Klakap