Can I draw a pixel without assembly

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Can I draw a pixel without assembly

Post 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
Octocontrabass
Member
Member
Posts: 5695
Joined: Mon Mar 25, 2013 7:01 pm

Re: Can I draw a pixel without assembly

Post 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.
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Re: Can I draw a pixel without assembly

Post 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
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Re: Can I draw a pixel without assembly

Post 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
Octocontrabass
Member
Member
Posts: 5695
Joined: Mon Mar 25, 2013 7:01 pm

Re: Can I draw a pixel without assembly

Post 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.
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Re: Can I draw a pixel without assembly

Post by ShyLittleMeowMeow »

Where I can set bit 2 of the flag ?
User avatar
iansjack
Member
Member
Posts: 4750
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Can I draw a pixel without assembly

Post 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.
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Re: Can I draw a pixel without assembly

Post 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 ?
nullplan
Member
Member
Posts: 1840
Joined: Wed Aug 30, 2017 8:24 am

Re: Can I draw a pixel without assembly

Post 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.
Carpe diem!
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Re: Can I draw a pixel without assembly

Post by ShyLittleMeowMeow »

thanks you guys alot :D
ShyLittleMeowMeow
Posts: 7
Joined: Sat Feb 01, 2025 10:47 pm

Re: Can I draw a pixel without assembly

Post by ShyLittleMeowMeow »

yea and now I don't know how to draw a pixel :(
Klakap
Member
Member
Posts: 314
Joined: Sat Mar 10, 2018 10:16 am

Re: Can I draw a pixel without assembly

Post by Klakap »

Post Reply