Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-0.11
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
linux-0.11
Commits
f8d044e0
Commit
f8d044e0
authored
Oct 19, 2014
by
karottc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
给mm/memory.c文件增加注释-done.
parent
bd653947
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
mm/page.s
mm/page.s
+9
-9
No files found.
mm/page.s
View file @
f8d044e0
...
...
@@ -9,28 +9,28 @@
*
the
real
work
is
done
in
mm
.
c
*/
.
globl
page_fault
.
globl
page_fault
#
声明为全局变量。将在
traps
.
c
中用于设置页异常描述符。
page_fault
:
xchgl
%
eax
,(%
esp
)
xchgl
%
eax
,(%
esp
)
#
取出错码到
eax
pushl
%
ecx
pushl
%
edx
push
%
ds
push
%
es
push
%
fs
movl
$
0x10
,%
edx
movl
$
0x10
,%
edx
#
置内核数据段选择符
mov
%
dx
,%
ds
mov
%
dx
,%
es
mov
%
dx
,%
fs
movl
%
cr2
,%
edx
pushl
%
edx
movl
%
cr2
,%
edx
#
取引起页面异常的线性地址
pushl
%
edx
#
将该线性地址和出错码压入栈中,作为将调用函数的参数
pushl
%
eax
testl
$
1
,%
eax
testl
$
1
,%
eax
#
测试页存在标志
P
(为
0
),如果不是缺页引起的异常则跳转
jne
1
f
call
do_no_page
call
do_no_page
#
调用缺页处理函数
jmp
2
f
1
:
call
do_wp_page
2
:
addl
$
8
,%
esp
1
:
call
do_wp_page
#
调用写保护处理函数
2
:
addl
$
8
,%
esp
#
丢弃压入栈的两个参数,弹出栈中寄存器并退出中断。
pop
%
fs
pop
%
es
pop
%
ds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment