OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Aug 25, 2019 6:54 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Cirrus GD 5446 LFB from PCI
PostPosted: Mon Dec 10, 2018 4:19 pm 
Offline

Joined: Fri Oct 13, 2017 10:03 am
Posts: 8
Hi, i was trying to implement a simple driver for the Cirrus GD 5446, i've found a pdf describing all of the bars and what they contains. This is what it says about what i thought it was the LFB:
Image


The first BAR is of type 0 and mapped in memory, i tried reading the last 8 bit of the value i got from PCI device that corresponds to the cirrus card as stated in this docuemntes. It actually had some data but when i tried suing it as an LFB and tried drawing something it actually didn't work. It gave me something like 0x0d. To read the 8 bits i actually right shift the bar of 24 bit and then cast it to uint8_t and then used this value as the LFB. Am i doing something wrong? If so please if you have any resources on how to use the pci bus properly i would very appreciate.

Thanks in advance to everyone.


Top
 Profile  
 
 Post subject: Re: Cirrus GD 5446 LFB from PCI
PostPosted: Mon Dec 10, 2018 10:44 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 227
I would assume you need something like this:

Code:
uintptr_t physbase = pci_read_long(bdf, 0x10);
unsigned char *framebuffer = map_area(physbase, 16<<(20 + isRevisionB), PAGE_READ | PAGE_WRITE | PAGE_SUPER);


And then framebuffer should be usable as 24-bit framebuffer.


Top
 Profile  
 
 Post subject: Re: Cirrus GD 5446 LFB from PCI
PostPosted: Tue Dec 18, 2018 8:24 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9284
Location: On the balcony, watching the Swedish Chef
A cirrus logic card gets booted into text mode - at which point a "linear framebuffer" will not get you any pixels to start with. In comparison, if you're setting a graphics mode with VESA you don't need to read the PCI bus for the framebuffer address because its provided for you.

In other words, there is way too much missing from your story to make even an educated guess as to what you have done, what numbers you actually get and how you are using them and what you are actually expecting from them.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 3 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