confusion about segment offset addressing
Posted: Fri Feb 19, 2010 1:20 pm
hello...i am new to this site
Here is my query:
In Tutorial 4 of Operating System Development series (Bootloaders 2) there is a portion in segment offset addressing
And in tutorial 5 at the Reading and loading a sector part:
i think according to segment offset addressing 0x1000:0x0 should be converted to address 0x10000. But if that happens it is going to be copied at 1MB th position of RAM. please correct me. i am confused.
Here is my query:
In Tutorial 4 of Operating System Development series (Bootloaders 2) there is a portion in segment offset addressing
Code: Select all
base address = base address * segment size (16) + offset
07C0:0000 = 07C0 * 16 (decimal) + 0
= 07C00 + 0 = 0x7C00
Code: Select all
.Read:
mov ah, 0x02 ; function 2
mov al, 1 ; read 1 sector
mov ch, 1 ; we are reading the second sector past us, so its still on track 1
mov cl, 2 ; sector to read (The second sector)
mov dh, 0 ; head number
mov dl, 0 ; drive number. Remember Drive 0 is floppy drive.
int 0x13 ; call BIOS - Read the sector
jc .Read ; Error, so try again
jmp 0x1000:0x0 ; jump to execute the sector!