Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-28668-2608132
YuanShen OS-3680
Commits
7ed0b017
Commit
7ed0b017
authored
6 months ago
by
bourbaki0404
Browse files
Options
Download
Patches
Plain Diff
error repaired by adding page fault handler to kerneltrap
parent
6591df7f
main
feature/add-bigfiles-and-symbolic-links
feature/demand_paging
feature/fat32
feature/slub_allocator
repair
xinyu
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
kernel/exec.c
+1
-1
kernel/exec.c
kernel/string.c
+3
-1
kernel/string.c
kernel/trap.c
+6
-2
kernel/trap.c
packets.pcap
+0
-0
packets.pcap
user/_usertests
+0
-0
user/_usertests
with
10 additions
and
4 deletions
+10
-4
kernel/exec.c
+
1
−
1
View file @
7ed0b017
...
...
@@ -113,7 +113,7 @@ exec(char *path, char **argv)
goto
bad
;
if
(
copyout
(
pagetable
,
sp
,
(
char
*
)
ustack
,
(
argc
+
1
)
*
sizeof
(
uint64
))
<
0
)
goto
bad
;
copyPgtblToKernel
(
p
->
kpagetable
,
pagetable
,
sz
,
0
);
// arguments to user main(argc, argv)
// argc is returned via the system call return
// value, which goes in a0.
...
...
This diff is collapsed.
Click to expand it.
kernel/string.c
+
3
−
1
View file @
7ed0b017
#include
"types.h"
#include
"defs.h"
#include
"proc.h"
void
*
memset
(
void
*
dst
,
int
c
,
uint
n
)
{
...
...
@@ -30,6 +31,7 @@ memcmp(const void *v1, const void *v2, uint n)
void
*
memmove
(
void
*
dst
,
const
void
*
src
,
uint
n
)
{
// printf("addr:%p, n:%d\n", dst, n);
const
char
*
s
;
char
*
d
;
...
...
This diff is collapsed.
Click to expand it.
kernel/trap.c
+
6
−
2
View file @
7ed0b017
...
...
@@ -169,8 +169,12 @@ kerneltrap()
panic
(
"kerneltrap: not from supervisor mode"
);
if
(
intr_get
()
!=
0
)
panic
(
"kerneltrap: interrupts enabled"
);
if
((
which_dev
=
devintr
())
==
0
){
else
if
((
r_scause
()
==
13
||
r_scause
()
==
15
)
&&
checkcowpage
(
r_stval
()))
{
struct
proc
*
p
=
myproc
();
if
(
uvmcowcopy
(
r_stval
())
==
-
1
){
// 如果内存不足,则杀死进程
p
->
killed
=
1
;
}
}
else
if
((
which_dev
=
devintr
())
==
0
){
// interrupt or trap from an unknown source
printf
(
"scause=0x%lx sepc=0x%lx stval=0x%lx
\n
"
,
scause
,
r_sepc
(),
r_stval
());
panic
(
"kerneltrap"
);
...
...
This diff is collapsed.
Click to expand it.
packets.pcap
+
0
−
0
View file @
7ed0b017
No preview for this file type
This diff is collapsed.
Click to expand it.
user/_usertests
0 → 100755
+
0
−
0
View file @
7ed0b017
File added
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets