From 72da86a252730c9bf32d1a72ea1dfdbce04081f6 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 27 Jan 2022 02:24:24 +0500 Subject: [PATCH] Disable interrupts, initialize segment registers and stack --- src/x86_stage1.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/x86_stage1.S b/src/x86_stage1.S index f788d1e..037ac20 100644 --- a/src/x86_stage1.S +++ b/src/x86_stage1.S @@ -5,6 +5,15 @@ .global _start .section .text _start: + cli + xor %ax, %ax + mov %ax, %ss + mov %ax, %ds + mov %ax, %es + mov %ax, %fs + mov %ax, %gs + mov $0x2000, %sp + mov $0x02, %ah mov $1, %al /* Sectors count */ mov $0x80, %dl /* Drive */