OSDev.org
https://forum.osdev.org/

Cirrus GD 5446 LFB from PCI
https://forum.osdev.org/viewtopic.php?f=1&t=33366
Page 1 of 1

Author:  tommasop [ Mon Dec 10, 2018 4:19 pm ]
Post subject:  Cirrus GD 5446 LFB from PCI

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.

Author:  nullplan [ Mon Dec 10, 2018 10:44 pm ]
Post subject:  Re: Cirrus GD 5446 LFB from PCI

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.

Author:  Combuster [ Tue Dec 18, 2018 8:24 am ]
Post subject:  Re: Cirrus GD 5446 LFB from PCI

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/