Page 2 of 2
Posted: Mon May 21, 2007 2:43 am
by mathematician
The DMA chips used in the PC are theoretically capable of memory to memory transfer, but the PC's architecture has other uses for DMA channel 0, which makes memory-memory transfer impossible in practice.
Posted: Mon May 21, 2007 2:49 am
by pcmattman
My question is, why use DMA when you can just directly access the memory itself?
Posted: Mon May 21, 2007 3:47 am
by mathematician
Well, if you're in real mode, and you want to move something beyond the 1mb barrier, you have either got to use DMA or else switch into "unreal mode", as it is called. Except that you can't use DMA; at least not on the PC.
Re: Boot loader
Posted: Sun Jan 11, 2009 7:23 am
by djsilence
HI!
I've got a question: if I am in unreal mode then can int 13h read file which size is more than 64kb? I heard that I can load files more than 64kb in size,but need the code has some changes? (I mean file reading function)?
Thanks!
Re: Boot loader
Posted: Sun Jan 11, 2009 10:38 am
by Combuster
The bios will still use real-mode-safe code, and not use any of the advantages of unreal mode. That includes wrapping around a 64k limit.
Also, the bios doesn't know what a file is: You tell it to read sectors. If you read only one sector at a time you can easily load several MB of data because you read less than 64k for each individual call.
Re: Boot loader
Posted: Sun Jan 11, 2009 2:09 pm
by JohnnyTheDon
One option is the EDD hard disk extensions, which can write to a 64-bit (or 32-bit) address and read more than 128 sectors in one shot.
Re: Boot loader
Posted: Mon Jan 12, 2009 11:22 am
by quok
JohnnyTheDon wrote:One option is the EDD hard disk extensions, which can write to a 64-bit (or 32-bit) address and read more than 128 sectors in one shot.
Sorry, no. The EDD spec limits you to reading/writing 127 sectors, as does the implementation in many BIOSes, specifically ones by Phoenix. You're best off just using blocks of no more than 32K at a shot.
Re: Boot loader
Posted: Mon Jan 12, 2009 12:15 pm
by Love4Boobies
The point is that while only 127 sectors (and note that there are 4096-byte sectors - just check) may be read at once, the extended read function provided by the fixed disk subset of EDD can be used to load stuff above the first MiB of RAM (64-bit flat addresses, anyone?). So it's just a matter of using the function more than once for big files.
Re: Boot loader
Posted: Mon Jan 12, 2009 2:59 pm
by JohnnyTheDon
Sorry, no. The EDD spec limits you to reading/writing 127 sectors
Not in EDD 3. There is an extended version of the DAP (Length > 16h) that accepts larger lengths than 127. I'm looking for the spec now, its been a while since I was messing with the BIOS.
Re: Boot loader
Posted: Mon Jan 12, 2009 3:25 pm
by Love4Boobies
Device address packet, EDD 3.0 wrote:
Number of blocks to transfer. This field has a maximum value of 127 (7Fh). A block count of 0 means no data is transferred. If a value greater than 127 is supplied, the request is rejected with CF=1 and AH=01.
Re: Boot loader
Posted: Mon Jan 12, 2009 3:31 pm
by quok
Love4Boobies wrote:Device address packet, EDD 3.0 wrote:
Number of blocks to transfer. This field has a maximum value of 127 (7Fh). A block count of 0 means no data is transferred. If a value greater than 127 is supplied, the request is rejected with CF=1 and AH=01.
Yeah, you beat me to it. That can be found on page 4 of the EDD 3.0 Rev 0.8 document, which equates to section 4.2, table 1. I've seen a rev 0.9 but I don't think it changes anything with regards to the device address packet. There's also supposedly work going on with EDD 4.0, but the draft of it that I've seen only changes int 13h func 48h, and not in ways that I remember.
Additionally, from section 4.2, table 1:
Packet size in bytes. Shall be 16 (10h) or greater. If the packet size is less than 16
the request is rejected with CF=1h and AH=01h. Packet sizes greater than 16 are
not rejected, the additional bytes beyond 16 shall be ignored.
and specifically the extra bytes are at the bottom of the packet:
10h | Quad word | 64 bit flat address of the transfer buffer. The is the buffer which Read/Write
operations will use to transfer the data if the data at offset 4 is invalid.
Re: Boot loader
Posted: Mon Jan 12, 2009 3:42 pm
by Love4Boobies
quok wrote:There's also supposedly work going on with EDD 4.0, but the draft of it that I've seen only changes int 13h func 48h, and not in ways that I remember.
I saw that draft too, on T13's website. However, it hasn't been accepted as a standard (yet?) so whatever the differences are, they're not implemented in any firmware.
Re: Boot loader
Posted: Mon Jan 12, 2009 3:48 pm
by quok
Just in case anyone's now looking for the EDD 3.0 Rev 0.8 spec, it's available at:
http://www.phoenix.com/en/OEM-ODM/Custo ... ations.htm
There's also a lot of other BIOS related specs there, all free of charge from your friends at Phoenix.
And this link in general may be interesting for anyone that wants more white papers:
http://www.phoenix.com/en/OEM-ODM/Custo ... efault.htm
Re: Boot loader
Posted: Mon Jan 12, 2009 3:54 pm
by JohnnyTheDon
You're right, I read an EDD 4.0 draft when I found the DAP length > 10h stuff. Sorry.