From f609fef964d39e69f9a7199efdca479dc04c9910 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Thu, 2 Jan 2014 13:58:57 +0100 Subject: [PATCH] Fix the stack location to avoid overwriting it --- bootloader/stage2.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootloader/stage2.asm b/bootloader/stage2.asm index feb99a17..6d10250a 100644 --- a/bootloader/stage2.asm +++ b/bootloader/stage2.asm @@ -230,8 +230,8 @@ second_step: mov si, star call print_16 - mov ah, [sectors_per_cluster] - mov byte [DAP.count], ah + movzx ax, [sectors_per_cluster] + mov word [DAP.count], ax mov word [DAP.offset], 0x0 mov ax, [current_segment] @@ -264,7 +264,7 @@ second_step: add ax, bx ; fat_sector ; Read the FAT sector - mov byte [DAP.count], 1 + mov word [DAP.count], 1 mov word [DAP.offset], 0x100 mov word [DAP.segment], 0x0 mov word [DAP.lba], ax