Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bootOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Kirsch
bootOS
Commits
968259f5
Commit
968259f5
authored
5 years ago
by
Jakob Kirsch
Browse files
Options
Downloads
Patches
Plain Diff
add symbols map
parent
e84bb355
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUIDE
+4
-1
4 additions, 1 deletion
GUIDE
Makefile
+4
-0
4 additions, 0 deletions
Makefile
symbols.py
+38
-0
38 additions, 0 deletions
symbols.py
with
46 additions
and
1 deletion
GUIDE
+
4
−
1
View file @
968259f5
...
@@ -85,5 +85,8 @@ Section 2:
...
@@ -85,5 +85,8 @@ Section 2:
2.4 The breakpoint
2.4 The breakpoint
If you want your code to run every loop before the "int int_input_line", you can replace the
If you want your code to run every loop before the "int int_input_line", you can replace the
interrupt 0x27 with your code. This is used in the clock as you can see.
interrupt 0x27 with your code. This is used in the clock as you can see.
2.5 sysmap.inc
sysmap.inc can be generated with "make symbols" and can be used to link your program
to the running system. You just have to add "%include sysmap.inc" to use the labels.
will be expanded...
will be expanded...
This diff is collapsed.
Click to expand it.
Makefile
+
4
−
0
View file @
968259f5
...
@@ -14,6 +14,7 @@ help:
...
@@ -14,6 +14,7 @@ help:
@
echo
installer: make installer
@
echo
installer: make installer
@
echo
cdimg: make
cd
image
@
echo
cdimg: make
cd
image
@
echo
strip: strip image
@
echo
strip: strip image
@
echo
symbols: create sysmap.inc
@
echo
================
@
echo
================
.PHONY
:
all
.PHONY
:
all
...
@@ -26,6 +27,7 @@ clean:
...
@@ -26,6 +27,7 @@ clean:
$(
RM
)
*
.img
$(
RM
)
*
.img
$(
RM
)
*
.lst
$(
RM
)
*
.lst
$(
RM
)
lst/
*
.lst
$(
RM
)
lst/
*
.lst
$(
RM
)
*
.inc
.PHONY
:
run
.PHONY
:
run
run
:
os.img
run
:
os.img
...
@@ -78,3 +80,5 @@ strip: os.img
...
@@ -78,3 +80,5 @@ strip: os.img
.PHONY
:
runkvm
.PHONY
:
runkvm
runkvm
:
os.img
runkvm
:
os.img
qemu-system-x86_64
-drive
file
=
$<
,format
=
raw
--enable-kvm
-serial
stdio
qemu-system-x86_64
-drive
file
=
$<
,format
=
raw
--enable-kvm
-serial
stdio
.PHONY
:
symbols
python3 symbols.py
This diff is collapsed.
Click to expand it.
symbols.py
0 → 100644
+
38
−
0
View file @
968259f5
import
os
content
=
""
with
open
(
"
os.asm
"
,
"
r
"
)
as
file
:
for
line
in
file
.
readlines
():
if
line
.
startswith
(
"
%
"
):
continue
if
"
:
"
in
line
:
ln
=
line
line
=
line
.
split
(
"
;
"
)[
0
]
if
line
==
""
:
content
+=
ln
continue
line
=
line
.
split
(
"
:
"
)[
0
]
+
"
\n
"
content
+=
ln
+
"
%assign __
"
+
line
.
replace
(
"
\n
"
,
""
)
+
"
$ - $$
\n
%warning _
"
+
line
.
replace
(
"
\n
"
,
""
)
+
"
__
"
+
line
else
:
content
+=
line
with
open
(
"
sysmap.asm
"
,
"
w
"
)
as
file
:
file
.
write
(
content
)
os
.
system
(
"
nasm -f bin -o tmp.img sysmap.asm 2> sysmap.txt
"
)
os
.
system
(
"
rm sysmap.asm tmp.img
"
)
content
=
""
with
open
(
"
sysmap.txt
"
,
"
r
"
)
as
file
:
for
line
in
file
.
readlines
():
ln
=
line
line
=
(
"
_
"
.
join
(
line
.
split
(
"
_
"
)[
1
:])).
split
(
"
"
)[:
2
]
try
:
content
+=
"
%define
"
+
line
[
0
][
1
:]
+
"
"
+
hex
(
0x7a00
+
int
(
line
[
1
]))
+
"
\n
"
except
:
pass
with
open
(
"
sysmap.inc
"
,
"
w
"
)
as
file
:
file
.
write
(
content
)
os
.
system
(
"
rm sysmap.txt
"
)
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