Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cidre-public
Systemes d exploitation
xv6-riscv-tp
Commits
afc2f8e9
Commit
afc2f8e9
authored
Apr 28, 2021
by
Wilke Pierre
Browse files
debug and docker
parent
f686821a
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
afc2f8e9
...
...
@@ -21,4 +21,3 @@ myapi.key
xv6.out*
.vagrant/
submissions/
.vscode/
.vscode/launch.json
0 → 100644
View file @
afc2f8e9
//
{
//
//
Use
IntelliSense
to
learn
about
possible
attributes.
//
//
Hover
to
view
descriptions
of
existing
attributes.
//
//
For
more
information
,
visit:
https://go.microsoft.com/fwlink/?linkid=
830387
{
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"name"
:
"Debug"
,
"type"
:
"cppdbg"
,
"request"
:
"launch"
,
"program"
:
"${workspaceRoot}/kernel/kernel"
,
"cwd"
:
"${workspaceRoot}"
,
"miDebuggerPath"
:
"/usr/bin/gdb-multiarch"
,
"miDebuggerArgs"
:
"--cd=${workspaceRoot} -ex
\"
source .gdbinit
\"
"
,
"launchCompleteCommand"
:
"None"
,
"customLaunchSetupCommands"
:
[],
"MIMode"
:
"gdb"
,
"stopAtEntry"
:
true
,
"logging"
:
{
"engineLogging"
:
true
},
"setupCommands"
:
[
{
"description"
:
"Enable pretty-printing for gdb"
,
"text"
:
"-enable-pretty-printing"
,
"ignoreFailures"
:
true
}
]
}
]
}
Makefile
View file @
afc2f8e9
...
...
@@ -184,6 +184,11 @@ qemu-gdb: $K/kernel .gdbinit fs.img
@
echo
"*** Now run 'gdb' in another window."
1>&2
$(QEMU)
$(QEMUOPTS)
-S
$(QEMUGDB)
docker-qemu
:
docker run
--rm
--user
$(
shell
id
-u
)
:
$(
shell
id
-g
)
--name
os-container
-v
$(
shell
pwd
)
:/data
-it
pwilke/os-infosec
${MAKE}
qemu
${MAKEFLAGS}
docker-qemu-gdb
:
docker run
--rm
--user
$(
shell
id
-u
)
:
$(
shell
id
-g
)
--name
os-container
-p
25000-26500:25000-26500
-v
$(
shell
pwd
)
:/data
-it
pwilke/os-infosec
${MAKE}
qemu-gdb
${MAKEFLAGS}
##
## FOR submitting lab solutions
...
...
@@ -198,75 +203,4 @@ endif
print-gdbport
:
@
echo
$(GDBPORT)
grade
:
@
echo
$(MAKE)
clean
@
$(MAKE)
clean
||
\
(
echo
"'make clean' failed. HINT: Do you have another running instance of xv6?"
&&
exit
1
)
./grade-lab-
$(LAB)
$(GRADEFLAGS)
WEBSUB
:=
https://6828.scripts.mit.edu/2019/handin.py
handin
:
tarball-pref myapi.key
@
SUF
=
$(LAB)
;
\
curl
-f
-F
file
=
@lab-
$$
SUF-handin.tar.gz
-F
key
=
\<
myapi.key
$(WEBSUB)
/upload
\
>
/dev/null
||
{
\
echo
;
\
echo
Submit seems to have failed.
;
\
echo
Please go to
$(WEBSUB)
/ and upload the tarball manually.
;
}
handin-check
:
@
if
!
test
-d
.git
;
then
\
echo
No .git directory, is this a git repository?
;
\
false
;
\
fi
@
if
test
"
$$
(git symbolic-ref HEAD)"
!=
refs/heads/
$(LAB)
;
then
\
git branch
;
\
read
-p
"You are not on the
$(LAB)
branch. Hand-in the current branch? [y/N] "
r
;
\
test
"
$$
r"
=
y
;
\
fi
@
if
!
git diff-files
--quiet
||
!
git diff-index
--quiet
--cached
HEAD
;
then
\
git status
-s
;
\
echo
;
\
echo
"You have uncomitted changes. Please commit or stash them."
;
\
false
;
\
fi
@
if
test
-n
"
`
git status
-s
`
"
;
then
\
git status
-s
;
\
read
-p
"Untracked files will not be handed in. Continue? [y/N] "
r
;
\
test
"
$$
r"
=
y
;
\
fi
UPSTREAM
:=
$(
shell
git remote
-v
|
grep
-m
1
"mit-pdos/xv6-riscv-fall19"
|
awk
'{split($$0,a," "
)
; print a[1]
}
'
)
tarball
:
handin-check
git archive
--format
=
tar
HEAD |
gzip
>
lab-
$(LAB)
-handin
.tar.gz
tarball-pref
:
handin-check
@
SUF
=
$(LAB)
;
\
git archive
--format
=
tar
HEAD
>
lab-
$$
SUF-handin.tar
;
\
git diff
$(UPSTREAM)
/
$(LAB)
>
/tmp/lab-
$$
SUF-diff.patch
;
\
tar
-rf
lab-
$$
SUF-handin.tar /tmp/lab-
$$
SUF-diff.patch
;
\
gzip
-c
lab-
$$
SUF-handin.tar
>
lab-
$$
SUF-handin.tar.gz
;
\
rm
lab-
$$
SUF-handin.tar
;
\
rm
/tmp/lab-
$$
SUF-diff.patch
;
\
myapi.key
:
@
echo
Get an API key
for
yourself by visiting
$(WEBSUB)
/
@
read
-p
"Please enter your API key: "
k
;
\
if
test
`
echo
"
$$
k"
|tr
-d
'\n'
|wc
-c
`
=
32
;
then
\
TF
=
`
mktemp
-t
tmp.XXXXXX
`
;
\
if
test
"x
$$
TF"
!=
"x"
;
then
\
echo
"
$$
k"
|tr
-d
'\n'
>
$$
TF
;
\
mv
-f
$$
TF
$@
;
\
else
\
echo mktemp
failed
;
\
false
;
\
fi
;
\
else
\
echo
Bad API key:
$$
k
;
\
echo
An API key should be 32 characters long.
;
\
false
;
\
fi
;
.PHONY
:
handin tarball tarball-pref clean grade handin-check
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