From 8a7d29213915c9ccb975f4710e17aa9ac6194121 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 1 Sep 2004 22:52:13 +0000 Subject: [PATCH] Set CR0_WP in CR0. --- src/threads/loader.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/threads/loader.S b/src/threads/loader.S index 535c442..41289d1 100644 --- a/src/threads/loader.S +++ b/src/threads/loader.S @@ -17,6 +17,7 @@ #define CR0_PE 0x00000001 /* Protection Enable. */ #define CR0_EM 0x00000004 /* (Floating-point) Emulation. */ #define CR0_PG 0x80000000 /* Paging. */ +#define CR0_WP 0x00010000 /* Write-Protect enable in kernel mode. */ .globl start # Entry point start: .code16 # This runs in real mode @@ -165,9 +166,9 @@ read_sector: addl $0x1000, %eax loop 1b - # Turn on paging. + # Turn on paging and kernel write-protect. movl %cr0, %eax - orl $CR0_PG, %eax + orl $CR0_PG | CR0_WP, %eax movl %eax, %cr0 jmp 1f 1: -- 2.30.2