Direct loading from disk to video memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
suslik
Member
Member
Posts: 45
Joined: Sun May 27, 2012 1:00 am
Location: Russia

Direct loading from disk to video memory

Post by suslik »

I tried to load image (that I prepaired from BMP) from disk directly to video memory, i.e. for int 0x13 ah=0x42 in Disk Address Packet I set Buffer Segment = 0xa000, Buffer Offset = 0, Sectors Count = 125. All was OK on bochs, but on real hardware - my notebook I saw only black screen but int 0x13 says all is OK :( I tried to load image by one sector to buffer in main memory and then copy buffer to video memory. It works! Why? Why BIOS fails to load directly in video memory? I can't understand this strange behaivour. May be DMA restrictions or something like that?
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Direct loading from disk to video memory

Post by Nable »

DMA copies data (ok, that's not an accurate description) from external device to RAM bypassing chipset's redirecion logic that is triggered by R/W access from CPU side (although it's vendor specific). Btw, I have one funny idea: you've possibly overwritten SMRAM (region of RAM with SMM code and data).
One more idea (that may be more accurate) : direct PCI-PCI transfers may be disabled and only one device can be active on bus at a time. So, WR# strobe for VGA card cannot be asserted at a same time with transfer from HDD.
Octocontrabass
Member
Member
Posts: 5604
Joined: Mon Mar 25, 2013 7:01 pm

Re: Direct loading from disk to video memory

Post by Octocontrabass »

It does work on some hardware, so Bochs isn't necessarily wrong.

I ran into this issue myself when I was playing around with loading an image from a floppy disk. It worked on every computer except the one I wanted it to run on. :lol:
suslik
Member
Member
Posts: 45
Joined: Sun May 27, 2012 1:00 am
Location: Russia

Re: Direct loading from disk to video memory

Post by suslik »

One more idea (that may be more accurate) : direct PCI-PCI transfers may be disabled and only one device can be active on bus at a time. So, WR# strobe for VGA card cannot be asserted at a same time with transfer from HDD.
- it makes sense. Because of these cases I hate "IBM compatibale PC" arch. May be some day I'd solder my own homebilt computer based on 6502 or Z80 and forget about this nightmare of "compatibility", missing hardware details and continious changes of arch.

Subj is closed. Thanks.
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Direct loading from disk to video memory

Post by Nable »

I've almost forgotten to add one thing that may be relevant: on some PCs I've seen "Limiting direct PCI/PCI transfers." message in system log while booting Linux (Random example from the Internet). I've never studied what does this exactly mean but it may be related.
Post Reply