projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change bitmap interface, update references.
[pintos-anon]
/
src
/
threads
/
loader.S
diff --git
a/src/threads/loader.S
b/src/threads/loader.S
index 3d440d20d58d2b30c3228c65c278a82cf8d51893..42f489979dff15704d4cd3efa023c9954f03913b 100644
(file)
--- a/
src/threads/loader.S
+++ b/
src/threads/loader.S
@@
-39,7
+39,7
@@
*/
#include "threads/loader.h"
*/
#include "threads/loader.h"
-#include "threads/mmu.h"
+/*#include "threads/mmu.h"*/
#### Kernel loader.
#### Kernel loader.
@@
-59,6
+59,8
@@
# Code runs in real mode, which is a 16-bit segment.
# Code runs in real mode, which is a 16-bit segment.
+.globl start
+start:
.code16
# Disable interrupts.
.code16
# Disable interrupts.
@@
-67,12
+69,16
@@
cli
cld
cli
cld
-# Set up segment registers and stack.
-# Stack grows downward starting from us.
+# Set up data segments and stack.
subw %ax, %ax
movw %ax, %es
movw %ax, %ds
subw %ax, %ax
movw %ax, %es
movw %ax, %ds
+
+# Stack grows downward starting from us.
+# We don't ever use the stack so this is strictly speaking
+# unnecessary.
+
movw %ax, %ss
movw $0x7c00, %sp
movw %ax, %ss
movw $0x7c00, %sp
@@
-127,14
+133,16
@@
rep stosl
# Set PDEs for 0 and LOADER_PHYS_BASE to point to the page table.
rep stosl
# Set PDEs for 0 and LOADER_PHYS_BASE to point to the page table.
+# See comments near the PG_* macros in paging.h for a description of
+# the values stored here.
- movl $0x1100
0 | PG_U | PG_W | PG_P
, %eax
+ movl $0x1100
7
, %eax
movl %eax, %es:0
movl %eax, %es:LOADER_PHYS_BASE >> 20
# Initialize page table.
movl %eax, %es:0
movl %eax, %es:LOADER_PHYS_BASE >> 20
# Initialize page table.
- movl $
PG_U | PG_W | PG_P
, %eax
+ movl $
7
, %eax
movl $0x400, %ecx
1: stosl
addl $0x1000, %eax
movl $0x400, %ecx
1: stosl
addl $0x1000, %eax
@@
-247,9
+255,9
@@
read_sector:
# Transfer sector.
# Transfer sector.
- movl $
512 / 4
, %ecx
+ movl $
256
, %ecx
movl $0x1f0, %edx
movl $0x1f0, %edx
- rep ins
l
+ rep ins
w
# Next sector.
# Next sector.