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.
AH = 42h
DL = drive number
DS:SI -> disk address packet
for an extended read , LBA ?
the thing I don't understand about this is no value to point to the data is being specified and if the value is DS:SI then where is the value that says where to load it into memory
Many thanks
If you look at the page you got that from (assuming http://www.ctyme.com/intr/rb-0708.htm given the format) and scroll down a little bit, you will see a heading: "Format of disk address packet:" which coincidentally matches up with what the input to DS:SI is....
- Monk
P.S. You MUST be able to read english to do OSDev, and continuing to ask questions like this that can be solved by simply googling, or scrolling further down in a page will earn you the animosity of most people here. That is not something you want to do if you expect to be able to come back here and get help when you run into a real/legitimate problem.
AH = 42h
DL = drive number
DS:SI -> disk address packet
for an extended read , LBA ?
the thing I don't understand about this is no value to point to the data is being specified and if the value is DS:SI then where is the value that says where to load it into memory
The address points to a 16-byte "disk packet". This is just a list of parameters in memory, it contains:
The LBA address to read the data from.
The memory address to place the data.
The number of sectors to read (some BIOSes have a limit of 127 sectors).
So basically, BIOS LBA functions have all their fields stored in memory rather than using up all your registers.
There is also a nice explanation of the disk packet on the OSDev Wiki, there is even an example packet. Once again, it's available on the ATA in Real Mode article.
TachyonOS - Violates causality on 95% of attempts. Runs at approximately 1.5c.
Hi I have looked at the articles you gave me and have tried for some time to work out the problem sorry for bothering you again. I am trying to load the first sector into memory address 0x7e00. I then use qemu to view the data at 0x7e00 and it should be a clone of the data at 0x7c00 but its not. Please note I am only loading the first sector to get more of an understanding.
It looks as if you're loading in sector LBA 1 rather than LBA 0. If you were still using CHS it would be correct to use the sector value 1 to load the boot sector, but with LBA it's 0 that you need.
I don't know what kind of disk you're booting from or how you're writing your code to it, but if you're doing it via a hex editor, make sure you've written your code to the physical disk and not a logical disk. Also, use the drive number passed to you in DL by the BIOS rather than just assuming it will be 80h.
Another problem is your use of CS to load other segment registers. You don't know what CS contains, so don't use it that way. Set the other segment registers to values chosen by you rather than by the one put in CS by the BIOS.
You'd also do well to set SS to something before setting SP - you currently have no idea where your stack is in memory because SS could contain any value, potentially resulting in your stack damaging something like the EBDA or overwriting your code if you're unlucky.