Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
dd4438b4
Commit
dd4438b4
authored
13 years ago
by
Austin Clements
Browse files
Options
Downloads
Patches
Plain Diff
Nuke data.S, since we do have a custom linker script.
parent
ce6dd9de
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+4
-4
4 additions, 4 deletions
Makefile
data.S
+0
-26
0 additions, 26 deletions
data.S
kernel.ld
+8
-0
8 additions, 0 deletions
kernel.ld
vm.c
+1
-1
1 addition, 1 deletion
vm.c
with
13 additions
and
31 deletions
Makefile
+
4
−
4
View file @
dd4438b4
...
...
@@ -109,8 +109,8 @@ initcode: initcode.S
$(
OBJCOPY
)
-S
-O
binary initcode.out initcode
$(
OBJDUMP
)
-S
initcode.o
>
initcode.asm
kernel
:
$(OBJS) entry.o
data.o
entryother initcode
$(
LD
)
$(
LDFLAGS
)
-T
kernel.ld
-e
entry
-o
kernel entry.o
data.o
$(
OBJS
)
-b
binary initcode entryother
kernel
:
$(OBJS) entry.o entryother initcode
$(
LD
)
$(
LDFLAGS
)
-T
kernel.ld
-e
entry
-o
kernel entry.o
$(
OBJS
)
-b
binary initcode entryother
$(
OBJDUMP
)
-S
kernel
>
kernel.asm
$(
OBJDUMP
)
-t
kernel |
sed
'1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d'
>
kernel.sym
...
...
@@ -121,8 +121,8 @@ kernel: $(OBJS) entry.o data.o entryother initcode
# great for testing the kernel on real hardware without
# needing a scratch disk.
MEMFSOBJS
=
$(
filter-out ide.o,
$(
OBJS
))
memide.o
kernelmemfs
:
$(MEMFSOBJS) entry.o
data.o
entryother initcode fs.img
$(
LD
)
$(
LDFLAGS
)
-Ttext
0x100000
-e
main
-o
kernelmemfs entry.o
data.o
$(
MEMFSOBJS
)
-b
binary initcode entryother fs.img
kernelmemfs
:
$(MEMFSOBJS) entry.o entryother initcode fs.img
$(
LD
)
$(
LDFLAGS
)
-Ttext
0x100000
-e
main
-o
kernelmemfs entry.o
$(
MEMFSOBJS
)
-b
binary initcode entryother fs.img
$(
OBJDUMP
)
-S
kernelmemfs
>
kernelmemfs.asm
$(
OBJDUMP
)
-t
kernelmemfs |
sed
'1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d'
>
kernelmemfs.sym
...
...
This diff is collapsed.
Click to expand it.
data.S
deleted
100644 → 0
+
0
−
26
View file @
ce6dd9de
//
The
kernel
layout
is
:
//
//
text
//
rodata
//
data
//
bss
//
//
Conventionally
,
Unix
linkers
provide
pseudo
-
symbols
//
etext
,
edata
,
and
end
,
at
the
end
of
the
text
,
data
,
and
bss
.
//
For
the
kernel
mapping
,
we
need
the
address
at
the
beginning
//
of
the
data
section
,
but
that
's not one of the conventional
//
symbols
,
because
the
convention
started
before
there
was
a
//
read
-
only
rodata
section
between
text
and
data
.
//
//
To
get
the
address
of
the
data
section
,
we
define
a
symbol
//
named
data
and
make
sure
this
is
the
first
object
passed
to
//
the
linker
,
so
that
it
will
be
the
first
symbol
in
the
data
section
.
//
//
Alternative
approaches
would
be
to
parse
our
own
ELF
header
//
or
to
write
a
linker
script
,
but
this
is
simplest
.
.
data
.
align
4096
.
globl
data
data
:
.
word
1
This diff is collapsed.
Click to expand it.
kernel.ld
+
8
−
0
View file @
dd4438b4
...
...
@@ -41,6 +41,14 @@ SECTIONS
/* Adjust the address for the data segment to the next page */
. = ALIGN(0x1000);
/* Conventionally, Unix linkers provide pseudo-symbols
* etext, edata, and end, at the end of the text, data, and bss.
* For the kernel mapping, we need the address at the beginning
* of the data section, but that's not one of the conventional
* symbols, because the convention started before there was a
* read-only rodata section between text and data. */
PROVIDE(data = .);
/* The data segment */
.data : {
*(.data)
...
...
This diff is collapsed.
Click to expand it.
vm.c
+
1
−
1
View file @
dd4438b4
...
...
@@ -7,7 +7,7 @@
#include
"proc.h"
#include
"elf.h"
extern
char
data
[];
// defined
in data.S
extern
char
data
[];
// defined
by kernel.ld
pde_t
*
kpgdir
;
// for use in scheduler()
struct
segdesc
gdt
[
NSEGS
];
...
...
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