diff options
Diffstat (limited to 'src/stage1_functions.asm')
-rw-r--r-- | src/stage1_functions.asm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/stage1_functions.asm b/src/stage1_functions.asm index 2ca3eb2..859ee66 100644 --- a/src/stage1_functions.asm +++ b/src/stage1_functions.asm @@ -1,3 +1,9 @@ +; number of sectors to be read +; this is 512 (the bootloader stage1) + +; N * 1024 for bootloader stage2 and the kernel code +; (note: the first sector gets loaded by the BIOS) +NOF_LOAD_SECTORS equ 4 + ; IN bx: begin of memory area to dump ; IN ax: number of words to dump dump_range: @@ -103,7 +109,7 @@ read_from_disk: mov ah, 0x02 ; read sectors from drive - mov al, 2 ; read 1 sector + mov al, NOF_LOAD_SECTORS ; read 1 sector mov ch, 0 ; select first cylinder mov dh, 0 ; first head mov cl, 2 ; second sector after boot sector @@ -116,7 +122,7 @@ read_from_disk: jc read_error - cmp al, 2 ; 1 sector read? + cmp al, NOF_LOAD_SECTORS ; 1 sector read? jne short_read ; if not, short read ret |