From fb402cd052e9b9e9eaf30a7c14244a00e3cfe42a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Duje=20Mihanovi=C4=87?= Date: Tue, 22 Aug 2023 23:23:19 +0200 Subject: [PATCH] x86: mbr: Copy by dword during relocation --- boot/x86/mbr.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boot/x86/mbr.s b/boot/x86/mbr.s index b5d01c9..5319f4b 100644 --- a/boot/x86/mbr.s +++ b/boot/x86/mbr.s @@ -15,10 +15,10 @@ _start: ; perform self-relocation cld - mov si, 0x7c00 - mov di, 0x600 - mov cx, 0x100 ; 256 words = 512 bytes - rep movsw + mov esi, 0x7c00 + mov edi, 0x600 + mov ecx, 0x80 ; 128 dwords = 512 bytes + rep movsd ; some BIOSes may set CS to 0x7c0, work around that jmp 0:real_start real_start: -- 2.39.2