From: Ben Pfaff Date: Wed, 1 Sep 2004 22:52:13 +0000 (+0000) Subject: Set CR0_WP in CR0. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a7d29213915c9ccb975f4710e17aa9ac6194121;p=pintos-anon Set CR0_WP in CR0. --- 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: