projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fbedf1
)
Set CR0_WP in CR0.
author
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 1 Sep 2004 22:52:13 +0000
(22:52 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 1 Sep 2004 22:52:13 +0000
(22:52 +0000)
src/threads/loader.S
patch
|
blob
|
history
diff --git
a/src/threads/loader.S
b/src/threads/loader.S
index 535c442c4f1f39a0d59cf43aa51c0e3cc8beee33..41289d1281f82ac3ccd6a62a2199f9ecbbaa2d8c 100644
(file)
--- 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_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
.globl start # Entry point
start: .code16 # This runs in real mode
@@
-165,9
+166,9
@@
read_sector:
addl $0x1000, %eax
loop 1b
addl $0x1000, %eax
loop 1b
- # Turn on paging.
+ # Turn on paging
and kernel write-protect
.
movl %cr0, %eax
movl %cr0, %eax
- orl $CR0_PG, %eax
+ orl $CR0_PG
| CR0_WP
, %eax
movl %eax, %cr0
jmp 1f
1:
movl %eax, %cr0
jmp 1f
1: