Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Krishna Vinnakota
CSEP551
Commits
1e8035be
Commit
1e8035be
authored
14 years ago
by
Austin Clements
Browse files
Options
Downloads
Patches
Plain Diff
Infer qemu path, just like in JOS
parent
0f0456ec
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+22
-5
22 additions, 5 deletions
Makefile
with
22 additions
and
5 deletions
Makefile
+
22
−
5
View file @
1e8035be
...
...
@@ -49,6 +49,23 @@ TOOLPREFIX := $(shell if i386-jos-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/d
echo
"***"
1>&2
;
exit
1
;
fi
)
endif
# If the makefile can't find QEMU, specify its path here
#QEMU =
# Try to infer the correct QEMU
ifndef
QEMU
QEMU
=
$(
shell
if
which qemu
>
/dev/null
;
\
then
echo
qemu
;
exit
;
\
else
\
qemu
=
/Applications/Q.app/Contents/MacOS/i386-softmmu.app/Contents/MacOS/i386-softmmu
;
\
if
test
-x
$$
qemu
;
then
echo
$$
qemu
;
exit
;
fi
;
fi
;
\
echo
"***"
1>&2
;
\
echo
"*** Error: Couldn't find a working QEMU executable."
1>&2
;
\
echo
"*** Is the directory containing the qemu binary in your PATH"
1>&2
;
\
echo
"*** or have you tried setting the QEMU variable in Makefile?"
1>&2
;
\
echo
"***"
1>&2
;
exit
1
)
endif
CC
=
$(
TOOLPREFIX
)
gcc
AS
=
$(
TOOLPREFIX
)
gas
LD
=
$(
TOOLPREFIX
)
ld
...
...
@@ -159,27 +176,27 @@ bochs : fs.img xv6.img
# try to generate a unique GDB port
GDBPORT
=
$(
shell
expr
`
id
-u
`
% 5000 + 25000
)
# QEMU's gdb stub command line changed in 0.11
QEMUGDB
=
$(
shell
if
qemu
-help
|
grep
-q
'^-gdb'
;
\
QEMUGDB
=
$(
shell
if
$(
QEMU
)
-help
|
grep
-q
'^-gdb'
;
\
then
echo
"-gdb tcp::
$(
GDBPORT
)
"
;
\
else
echo
"-s -p
$(
GDBPORT
)
"
;
fi
)
QEMUOPTS
=
-smp
2
-hdb
fs.img xv6.img
qemu
:
fs.img xv6.img
qemu
-serial
mon:stdio
$(
QEMUOPTS
)
$(
QEMU
)
-serial
mon:stdio
$(
QEMUOPTS
)
qemu-nox
:
fs.img xv6.img
qemu
-nographic
$(
QEMUOPTS
)
$(
QEMU
)
-nographic
$(
QEMUOPTS
)
.gdbinit
:
.gdbinit.tmpl
sed
"s/localhost:1234/localhost:
$(
GDBPORT
)
/"
<
$^
>
$@
qemu-gdb
:
fs.img xv6.img .gdbinit
@
echo
"*** Now run 'gdb'."
1>&2
qemu
-serial
mon:stdio
$(
QEMUOPTS
)
-S
$(
QEMUGDB
)
$(
QEMU
)
-serial
mon:stdio
$(
QEMUOPTS
)
-S
$(
QEMUGDB
)
qemu-nox-gdb
:
fs.img xv6.img .gdbinit
@
echo
"*** Now run 'gdb'."
1>&2
qemu
-nographic
$(
QEMUOPTS
)
-S
$(
QEMUGDB
)
$(
QEMU
)
-nographic
$(
QEMUOPTS
)
-S
$(
QEMUGDB
)
# CUT HERE
# prepare dist for students
...
...
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