flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Accessing Liner frame Buffer from long mode

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Feryno



Joined: 23 Mar 2005
Posts: 454
Location: Czech republic, Slovak republic
Feryno
thanks for the tests guys, good to read that the sample works in more PCs than in mine

the posted demo is the smallest sample of doing something with LFB, I developped it a bit further, I posted about 1 year old version so you needn't to cut of a lot of bullshits...

1 warning - don't try to read from LFB (1 wasted about 1 day to figure it out) - writing into LFB is extremelly fast (perhaps at speed approx 1 GB per second - I did tests), but the reading from LFB is veeeery slooooooowwwwww (about 4 MB per second, I did tests and measured it approximatelly)
- so for doing e.g. scrolling, don't try to read from LFB, use this solution:
make a shadow back buffer in RAM, do operations in it and copy it into LFB at the end

the linked sample demonstrates the fast way with shadow backbuffer, the bootable floppy image is the file test15_f.img
it tries to scan hard disks (including SATA) so use at your own risk (uses only ata_identify command so shouldn't modify anything on harddisks)
http://fdbg.x86asm.net/k0rman0D.zip

I just wonder where the LFB is in PC with e.g. 8 GB RAM and 2 GB LFB memory, this config theoretically can't fit into VESA int 10h specification (dword limit), but then the LFB and its ammount can be scanned through PCI correctly (PCI specification handles 64-bit memory references) (need to solve a problem if you have e.g. 2 graphic cards...)

AMD64 has 2 registers something like top_of_mem_1, top_of_mem_2
there are 2 possibilities

1. top_of_mem registers disabled
RAM 00000000_00000000 - 00000001_FFFFFFFF
LFB e.g. FFFFC000_00000000 - FFFFC000_7FFFFFFF
BIOS e.g. FFFFFFFF_00000000 - ...

2. top_of_mem registers enabled
e.g. top_of_mem_1 = 00000000_80000000
top_of_mem_2 = C0000000_00000000
RAM 00000000_00000000 - 00000000_7FFFFFFF (only 2 GB)
LFB e.g. 00000000_80000000 - 00000000_EFFFFFFF (only part of LFB)
BIOS e.g. 00000000_F0000000 - .....
RAM 00000001_00000000 - ... (remaining RAM)
LFB C0000000_00000000 - ..... (remaining video memory)
Post 14 Mar 2008, 07:47
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Thanks again for the info and code snips, there's some great info in there.
Post 14 Mar 2008, 13:57
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
Feryno wrote:
thanks for the tests guys, good to read that the sample works in more PCs than in mine


You're welcome.

Feryno wrote:

1 warning - don't try to read from LFB (1 wasted about 1 day to figure it out) - writing into LFB is extremelly fast (perhaps at speed approx 1 GB per second - I did tests), but the reading from LFB is veeeery slooooooowwwwww (about 4 MB per second, I did tests and measured it approximatelly)
- so for doing e.g. scrolling, don't try to read from LFB, use this solution:
make a shadow back buffer in RAM, do operations in it and copy it into LFB at the end


Yeah! Spending 10 mb of memory for shadow back buffer does not hurt. Everybody's having 512 Mb or more memory.
Eg. 1600*1200*32bit video mode consumes 7500 kb of back buffer memory

I downloaded your latter example as well..

regards,
Mac2004
Post 14 Mar 2008, 17:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.