I would look into that. It sounds funny. Why would the first letter of the string, 8 bytes away, be copied into start_sec.
1) Assembler has a bug (doubtful)
2) You have a pointer issue somewhere
3) You are loading the code and skipping something.
4) Just about anything.
I would run it through Bochs, set a break point for when that byte gets changed, and see where you are.
Just for fun, you don't have to set up a separate place for the DAP. You can use the stack. For an example, see my code at
https://github.com/fysnet/FYSOS/blob/ma ... ad_ext.inc.
Code: Select all
// edx:eax = LBA to read
// ebx = physical address to read it to
// cx = count of sectors to read (should not be more than 7Fh, as well as this makes CH = 0)
push edx ; offset 12
push eax ; offset 8
shl ebx,12
shr bx,12
push ebx ; offset 4
push cx ; offset 2 (ch = 0)
push 10h ; offset 0
mov si,sp
mov ah,42h ; read
mov dl, ...
int 13h
Just make sure you adjust the stack afterward. ( add sp,16 )
You can call another service to see if the MSEXT services are available.
Depending on the BIOS manufacturer, I have seen this service available for floppies as well, go figure. Most BIOSes will return the carry set when checking for this service when DL points to a floppy, but will return TRUE (carry clear and BX=sig, etc.) when DL points to a hard drive.
Ben
-
http://www.fysnet.net/osdesign_book_series.htm