Hi gerryg400,
Well you are right. That was supposed to be 0x1000. But anyways i had detected it just after posting that and the result is still the same.
Hi Combuster ,
It has a Cli and Hlt just after the code so that I can check whether the crash will print to the screen. But then It does not, So I have to take it as no error. Both the codes ( supposed to function similarly does not work out and both gives back "no error" result)
First Method:
Code: Select all
Load_Second_Sector:
Mov Ax , 0x1000 ; Segment Address To Copy Sector
Mov Es , Ax
Xor Bx , Bx ; Offset Address To Copy Sector
Mov Ah , 2 ; Copy Sector Function
Mov Al , 1 ; Number Of Sectors to Copy
Mov Ch , 0 ; Track Number
Mov Cl , 2 ; Sector Number
Mov Dh , 0 ; Head Number
mov Dl , [BootDiskNumber] ; Drive Number With Which Bios Was Booted
Int 0x13
Ret
BootDiskNumber: db 0
Second Method:
Code: Select all
DriveRead:
Mov Ax , 0
Mov Ds , Ax
Mov Si , Packet
Mov Ah , 0x42 ; Extended Bios Drive Read Function
Mov Dl , [BootDiskNumber] ; Drive Number With Which Bios Was Booted
Int 0x13
Jnc Continue
Call Display_Error ; Procedure that prints "There is Error" to screen
Continue:
Packet:
db 16 ; Size Of packet
db 0 ; Should Be 0
db 1 ; Number Of Sectors To Be Read
db 0 ; Should Be 0
dw 0 ; Offset (1000:0000)
dw 0x1000 ; Segment
dd 1 , 0 ; Start Of Sector To Be Read (First sector of drive has number 0)
BootDiskNumber: db 0
VirtualBox when booting with Usb works all right with the first method ( I suppose it is because It emulates Usb FDD ), whereas with the second method it displays "There is Error" message as expected with my code ( May be because it doesn't emulate Usb HDD ). But in the real hardware neither causes a error ( My Pc supports only Usb HDD ) but looks as if the area to which the load was made doesn't have the value as expected.
I really cant understand what is going on.. Thabks