OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 7:17 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [Solved] Cairo is not working
PostPosted: Sat May 27, 2017 2:55 am 
Offline
Member
Member
User avatar

Joined: Sun Nov 20, 2016 7:26 am
Posts: 155
Location: Somewhere
EDIT: Solved. I had to learn some Cairo before testing it :|

_________________
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.


Last edited by Agola on Sat May 27, 2017 3:32 am, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: Cairo is not working
PostPosted: Sat May 27, 2017 3:18 am 
Offline
Member
Member

Joined: Wed Jul 10, 2013 9:11 am
Posts: 51
You say you ported those applications but appear to be trying to run it in kernel space. You're also writing directly to a physical address (instead of using the LFB information Grub/VBE gave you) when you should be mapping that to virtual memory. You're not checking the return value of the cairo functions (I'm assuming they return NULL or something else upon failure).


Top
 Profile  
 
 Post subject: Re: Cairo is not working
PostPosted: Sat May 27, 2017 3:28 am 
Offline
Member
Member
User avatar

Joined: Sun Nov 20, 2016 7:26 am
Posts: 155
Location: Somewhere
goku420 wrote:
You say you ported those applications but appear to be trying to run it in kernel space. You're also writing directly to a physical address (instead of using the LFB information Grub/VBE gave you) when you should be mapping that to virtual memory. You're not checking the return value of the cairo functions (I'm assuming they return NULL or something else upon failure).


It was for a simple test, not for real gui.
I'm working with QEMU, so I assume framebuffer is 0xFD000000.

I fixed the problem, looks I should learn the basics of Cairo. Now everything looks good.

_________________
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.


Last edited by Agola on Sat May 27, 2017 3:30 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Cairo is not working
PostPosted: Sat May 27, 2017 3:29 am 
Offline
Member
Member

Joined: Wed Jul 10, 2013 9:11 am
Posts: 51
Agola wrote:
It is for a simple test, not for real gui.
I'm running my os in QEMU, so I assume framebuffer is 0xFD000000.

I fixed the problem, looks I should learn the basics of Cairo. Now everything looks good.


For the benefit of future readers, what was the problem/solution?


Top
 Profile  
 
 Post subject: Re: Cairo is not working
PostPosted: Sat May 27, 2017 3:31 am 
Offline
Member
Member
User avatar

Joined: Sun Nov 20, 2016 7:26 am
Posts: 155
Location: Somewhere
goku420 wrote:
Agola wrote:
It is for a simple test, not for real gui.
I'm running my os in QEMU, so I assume framebuffer is 0xFD000000.

I fixed the problem, looks I should learn the basics of Cairo. Now everything looks good.


For the benefit of future readers, what was the problem/solution?


Cairo wasn't working.

cairo_format_stride_for_width expects format and width as arguments, but I passed height.
cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 480) had to be cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 640)

_________________
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.


Top
 Profile  
 
 Post subject: Re: [Solved] Cairo is not working
PostPosted: Sat May 27, 2017 5:55 am 
Offline
Member
Member

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 306
Location: Germany
There is a reason editing posts is generally frowned upon.

_________________
managarm


Top
 Profile  
 
 Post subject: Re: [Solved] Cairo is not working
PostPosted: Sat May 27, 2017 10:02 am 
Offline
Member
Member
User avatar

Joined: Sun Nov 20, 2016 7:26 am
Posts: 155
Location: Somewhere
no92 wrote:

Sorry, but I thought it was such a rookie mistake and nobody (except me) can do a mistake like that.

_________________
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 171 guests


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group