From a5702bd92e1d2644e402fe44277882cbeef1f9a3 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Sat, 21 Sep 2024 12:32:49 -0400 Subject: [PATCH] partially revert change, sti is still in init --- src/mbr/mbr.nasm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mbr/mbr.nasm b/src/mbr/mbr.nasm index bb9475c..c6b57e4 100755 --- a/src/mbr/mbr.nasm +++ b/src/mbr/mbr.nasm @@ -34,6 +34,12 @@ init: mov ss, ax ; Set Stack Segment to 0 mov sp, STACK_START + + mov ch, 0x01 ; 256 WORDs in MBR (512 bytes), 0x0100 in cx + mov si, 0x7C00 ; Current MBR Address (loaded here by BIOS) + mov di, MBR_ENTRY ; New MBR Address (our new relocation address) + rep movsw ; copy 512 bytes from 0x0000:7c00 to 0x0000:MBR_ENTRY (7A00 as of writing) + sti jmp 0:main