From: Duje Mihanović Date: Tue, 22 Aug 2023 21:23:19 +0000 (+0200) Subject: x86: mbr: Copy by dword during relocation X-Git-Url: https://git.dujemihanovic.xyz/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=fb402cd052e9b9e9eaf30a7c14244a00e3cfe42a;p=nameless-os.git x86: mbr: Copy by dword during relocation --- 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: