From 35f3e16135b371e11d540a8b6bd5395cb40b2c96 Mon Sep 17 00:00:00 2001 From: kotorifan Date: Sat, 31 Jan 2026 17:13:17 +0100 Subject: Whatever... --- src/boot/boot.stage2.pm.asm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/boot/boot.stage2.pm.asm') diff --git a/src/boot/boot.stage2.pm.asm b/src/boot/boot.stage2.pm.asm index 77f5f61..8897be6 100644 --- a/src/boot/boot.stage2.pm.asm +++ b/src/boot/boot.stage2.pm.asm @@ -4,9 +4,25 @@ [bits 16] %include "boot.stage2.gdt32.asm" -_ +_enable_pm: cli lgdt [GDT32_ptr] - ;; Enable Protected Mode + mov eax, cr0 + or eax, 1 + mov cr0, eax + + jmp CODE_SEG32:_protected_mode + +[bits 32] +_protected_mode: + mov ax, DATA_SEG32 + mov ds, ax + mov ss, ax + mov es, ax + mov fs, ax + mov gs, ax + + ret + -- cgit v1.3