Page 1 of 1
Direct loading from disk to video memory
Posted: Sat Oct 12, 2013 11:27 am
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?
Re: Direct loading from disk to video memory
Posted: Sat Oct 12, 2013 1:25 pm
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.
Re: Direct loading from disk to video memory
Posted: Sat Oct 12, 2013 1:43 pm
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.
Re: Direct loading from disk to video memory
Posted: Sat Oct 12, 2013 2:04 pm
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.
Re: Direct loading from disk to video memory
Posted: Sat Oct 12, 2013 3:37 pm
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.