Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TP_xv6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fache Charles
TP_xv6
Commits
f737f3cf
Commit
f737f3cf
authored
2 years ago
by
Wilke Pierre
Browse files
Options
Downloads
Patches
Plain Diff
Fix runcmd issue with gcc + configure PMP correctly
parent
b46c2ad2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+3
-0
3 additions, 0 deletions
Makefile
kernel/riscv.h
+12
-0
12 additions, 0 deletions
kernel/riscv.h
kernel/start.c
+5
-0
5 additions, 0 deletions
kernel/start.c
user/sh.c
+1
-0
1 addition, 0 deletions
user/sh.c
with
21 additions
and
0 deletions
Makefile
+
3
−
0
View file @
f737f3cf
...
...
@@ -174,6 +174,9 @@ QEMUOPTS = -machine virt -bios none -kernel $K/kernel -m 128M -smp $(CPUS) -nogr
QEMUOPTS
+=
-drive
file
=
fs.img,if
=
none,format
=
raw,id
=
x0
-device
virtio-blk-device,drive
=
x0,bus
=
virtio-mmio-bus.0
QEMUOPTS
+=
-monitor
telnet:127.0.0.1:12345,server,nowait
qemu-version
:
$(
QEMU
)
--version
qemu
:
$K/kernel fs.img
$(
QEMU
)
$(
QEMUOPTS
)
...
...
This diff is collapsed.
Click to expand it.
kernel/riscv.h
+
12
−
0
View file @
f737f3cf
...
...
@@ -183,6 +183,18 @@ w_mtvec(uint64 x)
asm
volatile
(
"csrw mtvec, %0"
:
:
"r"
(
x
));
}
static
inline
void
w_pmpcfg0
(
uint64
x
)
{
asm
volatile
(
"csrw pmpcfg0, %0"
:
:
"r"
(
x
));
}
static
inline
void
w_pmpaddr0
(
uint64
x
)
{
asm
volatile
(
"csrw pmpaddr0, %0"
:
:
"r"
(
x
));
}
// use riscv's sv39 page table scheme.
#define SATP_SV39 (8L << 60)
...
...
This diff is collapsed.
Click to expand it.
kernel/start.c
+
5
−
0
View file @
f737f3cf
...
...
@@ -38,6 +38,11 @@ start()
w_mideleg
(
0xffff
);
w_sie
(
r_sie
()
|
SIE_SEIE
|
SIE_STIE
|
SIE_SSIE
);
// configure Physical Memory Protection to give supervisor mode
// access to all of physical memory.
w_pmpaddr0
(
0x3fffffffffffffull
);
w_pmpcfg0
(
0xf
);
// ask for clock interrupts.
timerinit
();
...
...
This diff is collapsed.
Click to expand it.
user/sh.c
+
1
−
0
View file @
f737f3cf
...
...
@@ -54,6 +54,7 @@ void panic(char*);
struct
cmd
*
parsecmd
(
char
*
);
// Execute cmd. Never returns.
__attribute__
((
noreturn
))
void
runcmd
(
struct
cmd
*
cmd
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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