From 7b1e9eb8bcb8f1b7ffb23903fbb8a735f561449a Mon Sep 17 00:00:00 2001 From: cqb Date: Sun, 1 Feb 2026 17:46:28 +0100 Subject: [PATCH] arch/x86_64: replaced loop construct with rep movsb Replaces inefficient loop construct with rep movsb string instruction. Signed-off-by: cqb --- arch/x86_64/src/common/multiboot1.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/x86_64/src/common/multiboot1.S b/arch/x86_64/src/common/multiboot1.S index 36365b86f21..9d0ba73bc0f 100644 --- a/arch/x86_64/src/common/multiboot1.S +++ b/arch/x86_64/src/common/multiboot1.S @@ -54,15 +54,9 @@ _start: movl $realmode_start, %esi movl $0, %edi -copy_loop: - /* Copy by bytes, make sure the addresses are not overlapped */ - - movb (%esi), %al - movb %al, (%edi) - inc %esi - inc %edi - loop copy_loop + cld + rep movsb /* Jump to bin_start + 0x30, skip the multiboot1 header */