flat assembler
Message board for the users of flat assembler.

Index > DOS > VESA programming

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
neville wrote:
It was only 74K, but OK, the attached 43K ZIP contains the FASM source above, plus the EXE.
Thanks.
neville wrote:
Actually you will end up with less disk space unless you delete the ZIP after unzipping it Wink
Actually I was referring to the server disk space. It also goes towards your quota of 5MB on this board.
Post 28 Aug 2008, 22:29
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
vid wrote:
What's the deal with banked/nonbanked??? Everything real uses at least one backbuffer anyway, and copying backbuffer to banked buffer is primitively easy.

The deal is banked = paged video buffer access, non-banked = linear buffer access.
Paged access adds significantly more overhead because you have to always check if you need to change the page every time you write a pixel. So it always makes the video update slower to execute. Of course if you don't check, and always set the page every time you write a pixel the code would be v-e-r-y slow. How slow depends on the page granularity of the video buffer, but some video cards use a buffer as small as 4K which is ridiculously slow. Most cards have 64K buffers, but even they are slow enough because, for example, one 1024x768x24-bit image would require at least 36 buffers (page changes) just to update one screen!! A card with a 4K buffer would require 576 page changes for each screen update!!

Linear access avoids all this and allows for direct video RAM access at maximum speed, giving far superior performance.

This argument is similar to the argument for and against "virtual memory" which I have raised previously ... To me, there is no longer any excuse why any operating system should use paged main memory access ... FAMOS doesn't, of course Wink

_________________
FAMOS - the first memory operating system
Post 28 Aug 2008, 22:33
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
revolution wrote:
Quote:
Actually I was referring to the server disk space. It also goes towards your quota of 5MB on this board.

OK thanks, but now I've used up even more of my quota Wink
What happens if you use up your 5MB quota? No more uploads? Can you disable/delete previous uploads to regain some quota?

_________________
FAMOS - the first memory operating system
Post 28 Aug 2008, 22:40
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
neville wrote:
Can you disable/delete previous uploads to regain some quota?


See you profile page:

http://board.flatassembler.net/profile.php?mode=viewprofile&u=3145

At the bottom there is a link to the User Attachment Control Panel (UACP).
Post 28 Aug 2008, 22:47
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
neville, have you tried http://board.flatassembler.net/topic.php?p=55374#55374 for banked VESA yet?

Quote:

What happens if you use up your 5MB quota? No more uploads? Can you disable/delete previous uploads to regain some quota?

Yes, you can edit your post and remove the attachment by pressing the edit button and when you are in editing mode you will have extra controls to add/update/remove attachments.
Post 28 Aug 2008, 22:49
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 693
Location: Adelaide
sinsi
neville wrote:

To me, there is no longer any excuse why any operating system should use paged main memory access

Nowadays, with long mode, you don't have a choice...
Post 29 Aug 2008, 04:38
View user's profile Send private message Reply with quote
Shahada



Joined: 25 Jul 2008
Posts: 77
Shahada
neville wrote:
How slow depends on the page granularity of the video buffer, but some video cards use a buffer as small as 4K which is ridiculously slow. Most cards have 64K buffers, but even they are slow enough because, for example, one 1024x768x24-bit image would require at least 36 buffers (page changes) just to update one screen!! A card with a 4K buffer would require 576 page changes for each screen update!!


neville, you make a confusion between window size and window granularity. Window size is 64K in all implementations , only window granularity could vary, so the number of page changes is the same. The difference would be for example that in case of 64K granularity for writting at video memory offset 65536 you have to set bank 1 and in case of 4K granularity you have to set bank 16, so you will have to set banks 0,16,32 etc. in place of 0,1,2 etc. when blitting a screen buffer, but the blitting is done in 64K chunks also.


Last edited by Shahada on 29 Aug 2008, 10:31; edited 1 time in total
Post 29 Aug 2008, 05:25
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 693
Location: Adelaide
sinsi
Window size is 64K in 99.9% of cases - there was a card or two that were 128k (A000-BFFF), although I never saw one.

If granularity is 64K then the window maps one page at A000.
If granularity is 4K and you select page 0 then the window is filled with page 0..15 - the whole 64K.

That's why I use a var which holds pages per window - it saves unneeded page selecting.
Post 29 Aug 2008, 06:07
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
Shahada wrote:
Quote:
neville, you make a confusion between window size and window granularity. Window size is 64K in all implementations , only window granularity could vary, so the number of page changes is the same. The difference would be for example that in case of 64K granularity for writting at video memory offset 65536 you have to set bank 1 and in case of 4K granularity you have to set bank 16, so you will have to set banks 0,16,32 etc. in place of 0,1,2 etc. when blitting a screen buffer, but the blitting is done in 64K chunks also.

Actually I was trying to clear up the confusion, maybe not very successfully Wink

You see, I don't mention "window size" or "window granularity"; I only use "page granularity" and "buffer size", which is specific to paged VESA video modes. (I think the "window" you and Sinsi refer to is from the original PC memory map which ALL video cards must implement - graphics memory starts at 0:A0000, monochrome text at B0000, colour text at B8000 etc. Of course video memory MUST stop at BFFFF because video BIOS code starts at C0000.) The VESA documentation I have uses "page" and "window" for the same thing, but does not use "bank". Maybe "bank" is used in translations from languages other than English?

Sorry, I'm not sure I understand your point about page changes, but I know what I've said is true because I've done it. If you get to page 16, then you have to go through pages 0...15 do you not? With 4K granularity page 16 is video offset 65536 (10000h). With 64K granularity, page 16 would be video offset 1048576 (100000h) etc.

Sorry, also I don't understand what is "blitting" please?

Sinsi, did you post some code that calls the VESA BIOS fast Set Window/Page function? I'd like to try that one day... I hope you can see from my code how I've done it. And about long mode - yes I'm very disappointed there is no Flat Real Long Mode (yet... Wink )

Shahada, I've also done this code in 24/32-bit paged VESA modes which works fine in FAMOS, but I just ported it to DOS and it crashes. Some debugging required...

revolution, LocoDelAssembly thanks. Loco your link is about SMSW, not banked/paged/windowed VESA?

_________________
FAMOS - the first memory operating system
Post 29 Aug 2008, 11:26
View user's profile Send private message Visit poster's website Reply with quote
Shahada



Joined: 25 Jul 2008
Posts: 77
Shahada
neville wrote:
You see, I don't mention "window size" or "window granularity"; I only use "page granularity" and "buffer size", which is specific to paged VESA video modes. (I think the "window" you and Sinsi refer to is from the original PC memory map which ALL video cards must implement - graphics memory starts at 0:A0000, monochrome text at B0000, colour text at B8000 etc. Of course video memory MUST stop at BFFFF because video BIOS code starts at C0000.) The VESA documentation I have uses "page" and "window" for the same thing, but does not use "bank". Maybe "bank" is used in translations from languages other than English?


Sorry, my English is very bad, you know that Rolling Eyes . I call 'bank' what you and sinsi call 'page'. Window is a portion of memory which maps part of VRAM, for graphic VESA modes usually its address is at 0xA0000 linear and its size is 64K. Granularity is the step with which you can move this window in VRAM, i. e. the distance in KB between two VRAM offsets which can be mapped at 0xA0000. For example in case of 64K granularity you can map at 0xA0000 offsets 0,65536,131072 etc. of VRAM and in case of 4K granularity you can map offsets 0, 4096, 8192,...65536,... etc. But the window will always map 64K of VRAM, disregarding which the moving step is! I hope this helped you to understand better. Even if granularity is 4K you can fill 64K of VRAM with only one bank/page selection! I called 'blitting' copying a back buffer to screen.
Post 29 Aug 2008, 12:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
neville wrote:
Sorry, also I don't understand what is "blitting" please?
blitting: from BitBLT - Bit Block Transfer. Literally, copying a block of bits from one memory location to another (usually from main RAM onto the graphics card RAM).
Post 29 Aug 2008, 12:30
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

Loco your link is about SMSW, not banked/paged/windowed VESA?

Mostly, but in the explanation there is also "described" a trick to emulate LFB on banked VESA. Wink But, does your OS use paged memory (I mean only paging, not swapping)? If not maybe you could still do the trick by using a separated segment descriptor and changing the base and limit to represent the active FB page. In both cases be careful with unaligned accesses though, if the video card has a granularity of 64 KB I don't see a way to implement this in a safe and easy manner.
Post 29 Aug 2008, 14:16
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
Shahada, thanks your explanation is perfectly correct. If you are new to programming you are learning very fast Wink Maybe only new to assembler? Also your English vocabulary is better than mine - I never knew the meaning of blitting (thanks also revolution & LocoDelAssembly). Now I know I have done a lot of blitting already Cool

Maybe my VESA "page-changing" code could be more efficient? I never really wanted to implement paged VESA because as you know I think LFB mode is infinitely better. But to ensure FAMOS would boot on most machines, I had to make paged mode the default Sad

I discovered that the BIOS page changing code INT 10/AX=4F05 is very slow, affecting the GUI performance. If you look at my code you will see that I always set Page "0", never any other page number. Maybe incrementing the page number could speed it up, but not according to my experiments. One day I might try the WinFuncPtr (fast direct call) at dword[0CH] in the VBE ModeInfoBlock...

Loco, no FAMOS definitely does not use "paged" memory, other than in paged VRAM. Thanks, maybe LFB emulation would make me feel better, but personally I would much prefer the real thing Wink

_________________
FAMOS - the first memory operating system
Post 29 Aug 2008, 20:09
View user's profile Send private message Visit poster's website 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.

Powered by rwasa.