Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
cm-projects
RIOT
Commits
a76c029e
Commit
a76c029e
authored
10 years ago
by
René Kijewski
Browse files
Options
Downloads
Patches
Plain Diff
x86: Fix `make term` for BOARD=qemu-i386
Fixes #2184. QEMU has changed its command line arguments.
parent
a17d89fb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boards/qemu-i386/Makefile.include
+1
-1
1 addition, 1 deletion
boards/qemu-i386/Makefile.include
boards/qemu-i386/dist/term.py
+30
-8
30 additions, 8 deletions
boards/qemu-i386/dist/term.py
with
31 additions
and
9 deletions
boards/qemu-i386/Makefile.include
+
1
−
1
View file @
a76c029e
...
@@ -3,7 +3,7 @@ include $(RIOTBOARD)/x86-multiboot-common/Makefile.include
...
@@ -3,7 +3,7 @@ include $(RIOTBOARD)/x86-multiboot-common/Makefile.include
CFLAGS
+=
-march
=
i686
-mtune
=
i686
CFLAGS
+=
-march
=
i686
-mtune
=
i686
CFLAGS
+=
-I
$(
RIOTBOARD
)
/qemu-i386/include
CFLAGS
+=
-I
$(
RIOTBOARD
)
/qemu-i386/include
TERMPROG
=
exec
$(
RIOTBOARD
)
/qemu-i386/dist/term.py
"
qemu-system-i386
-m 512m"
$(
BINDIRBASE
)
$(
HEXFILE
)
TERMPROG
=
exec
$(
RIOTBOARD
)
/qemu-i386/dist/term.py qemu-system-i386
$(
BINDIRBASE
)
$(
HEXFILE
)
FLASHER
=
true
FLASHER
=
true
...
...
This diff is collapsed.
Click to expand it.
boards/qemu-i386/dist/term.py
+
30
−
8
View file @
a76c029e
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
import
atexit
import
atexit
import
os
import
os
import
re
import
readline
import
readline
import
socket
import
socket
import
signal
import
signal
...
@@ -27,16 +28,25 @@ import termios
...
@@ -27,16 +28,25 @@ import termios
import
threading
import
threading
from
datetime
import
datetime
from
datetime
import
datetime
from
distutils.util
import
split
_quoted
from
shlex
import
split
from
time
import
time
from
time
import
time
try
:
from
shlex
import
quote
except
ImportError
:
from
pipes
import
quote
def
join_quoted
(
args
):
return
'
'
.
join
(
quote
(
arg
)
for
arg
in
args
)
_null
=
open
(
os
.
devnull
,
'
wb
'
,
0
)
def
get_timestamp
():
def
get_timestamp
():
return
datetime
.
fromtimestamp
(
time
()).
strftime
(
'
%Y-%m-%d %H:%M:%S.%f
'
)
return
datetime
.
fromtimestamp
(
time
()).
strftime
(
'
%Y-%m-%d %H:%M:%S.%f
'
)
def
popen
(
args
,
**
kw
):
def
popen
(
args
,
**
kw
):
null
=
open
(
os
.
devnull
,
'
wb
'
,
0
)
return
subprocess
.
Popen
(
args
,
stdin
=
_null
,
stdout
=
_null
,
stderr
=
_null
,
**
kw
)
return
subprocess
.
Popen
(
args
,
stdin
=
null
,
stdout
=
null
,
stderr
=
null
,
**
kw
)
def
main
(
QEMU
,
BINDIRBASE
,
HEXFILE
,
DEBUGGER
=
None
):
def
main
(
QEMU
,
BINDIRBASE
,
HEXFILE
,
DEBUGGER
=
None
):
def
run_shell
():
def
run_shell
():
...
@@ -54,12 +64,19 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
...
@@ -54,12 +64,19 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
def
read_terminal
():
def
read_terminal
():
for
line
in
client_file
:
for
line
in
client_file
:
print
(
'
{}: {}
'
.
format
(
get_timestamp
(),
line
.
decode
(
'
UTF-8
'
,
'
replace
'
).
rstrip
(
"
\r\n
"
)))
sys
.
stderr
.
write
(
get_timestamp
()
+
'
:
'
)
sys
.
stderr
.
flush
()
sys
.
stdout
.
write
(
line
.
decode
(
'
UTF-8
'
,
'
replace
'
).
rstrip
(
'
\r\n
'
)
+
'
\n
'
)
sys
.
stdout
.
flush
()
if
isinstance
(
QEMU
,
str
):
if
isinstance
(
QEMU
,
str
):
QEMU
=
split
_quoted
(
QEMU
)
QEMU
=
split
(
QEMU
)
if
DEBUGGER
and
isinstance
(
DEBUGGER
,
str
):
if
DEBUGGER
and
isinstance
(
DEBUGGER
,
str
):
DEBUGGER
=
split_quoted
(
DEBUGGER
)
DEBUGGER
=
split
(
DEBUGGER
)
qemu_version
=
subprocess
.
check_output
(
QEMU
+
[
'
-version
'
],
stdin
=
_null
,
stderr
=
_null
)
qemu_version
=
re
.
match
(
br
'
.*version ((?:\d+\.?)+).*
'
,
qemu_version
).
group
(
1
).
split
(
b
'
.
'
)
qemu_version
=
list
(
int
(
v
)
for
v
in
qemu_version
)
histfile
=
os
.
path
.
join
(
BINDIRBASE
,
'
.qemu-term.hist
'
)
histfile
=
os
.
path
.
join
(
BINDIRBASE
,
'
.qemu-term.hist
'
)
try
:
try
:
...
@@ -81,10 +98,15 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
...
@@ -81,10 +98,15 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
'
-monitor
'
,
'
/dev/null
'
,
'
-monitor
'
,
'
/dev/null
'
,
'
-kernel
'
,
HEXFILE
,
'
-kernel
'
,
HEXFILE
,
]
]
if
qemu_version
>=
[
2
,
1
]:
args
+=
[
'
-m
'
,
'
size=512
'
]
else
:
args
+=
[
'
-m
'
,
'
512m
'
]
if
DEBUGGER
:
if
DEBUGGER
:
args
+=
[
'
-s
'
,
'
-S
'
]
args
+=
[
'
-s
'
,
'
-S
'
]
try
:
try
:
sys
.
stderr
.
write
(
'
Starting QEMU: {}
\n\n
'
.
format
(
join_quoted
(
args
)))
qemu
=
popen
(
args
)
qemu
=
popen
(
args
)
if
DEBUGGER
:
if
DEBUGGER
:
...
@@ -101,7 +123,7 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
...
@@ -101,7 +123,7 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
try
:
try
:
result
=
qemu
.
wait
()
and
result
result
=
qemu
.
wait
()
and
result
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
print
(
'
Interrupted ...
'
)
sys
.
stderr
.
write
(
'
\n
Interrupted ...
\n
'
)
result
=
0
result
=
0
finally
:
finally
:
try
:
try
:
...
@@ -122,7 +144,7 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
...
@@ -122,7 +144,7 @@ def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None):
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
print
(
"
Type
'
exit
'
to exit.
"
)
sys
.
stderr
.
write
(
"
Type
'
exit
'
to exit.
\n
"
)
atexit
.
register
(
termios
.
tcsetattr
,
0
,
termios
.
TCSAFLUSH
,
termios
.
tcgetattr
(
0
))
atexit
.
register
(
termios
.
tcsetattr
,
0
,
termios
.
TCSAFLUSH
,
termios
.
tcgetattr
(
0
))
...
...
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