Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xv6-19au
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
csep551
xv6-19au
Commits
c60a3551
Commit
c60a3551
authored
13 years ago
by
Frans Kaashoek
Browse files
Options
Downloads
Patches
Plain Diff
Separate more clearly bootloader from xv6 by renaming multiboot.S to entry.S etc.
Maybe the string boot shouldn't appear in xv6 code?
parent
c95ce31c
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+10
-10
10 additions, 10 deletions
Makefile
entry.S
+0
-0
0 additions, 0 deletions
entry.S
entryother.S
+1
-1
1 addition, 1 deletion
entryother.S
main.c
+11
-11
11 additions, 11 deletions
main.c
with
22 additions
and
22 deletions
Makefile
+
10
−
10
View file @
c60a3551
...
...
@@ -97,11 +97,11 @@ bootblock: bootasm.S bootmain.c
$(
OBJCOPY
)
-S
-O
binary
-j
.text bootblock.o bootblock
./sign.pl bootblock
boot
other
:
boot
other.S
$(
CC
)
$(
CFLAGS
)
-fno-pic
-nostdinc
-I
.
-c
boot
other.S
$(
LD
)
$(
LDFLAGS
)
-N
-e
start
-Ttext
0x7000
-o
bootblockother.o
boot
other.o
$(
OBJCOPY
)
-S
-O
binary
-j
.text bootblockother.o
boot
other
$(
OBJDUMP
)
-S
bootblockother.o
>
boot
other.asm
entry
other
:
entry
other.S
$(
CC
)
$(
CFLAGS
)
-fno-pic
-nostdinc
-I
.
-c
entry
other.S
$(
LD
)
$(
LDFLAGS
)
-N
-e
start
-Ttext
0x7000
-o
bootblockother.o
entry
other.o
$(
OBJCOPY
)
-S
-O
binary
-j
.text bootblockother.o
entry
other
$(
OBJDUMP
)
-S
bootblockother.o
>
entry
other.asm
initcode
:
initcode.S
$(
CC
)
$(
CFLAGS
)
-nostdinc
-I
.
-c
initcode.S
...
...
@@ -109,8 +109,8 @@ initcode: initcode.S
$(
OBJCOPY
)
-S
-O
binary initcode.out initcode
$(
OBJDUMP
)
-S
initcode.o
>
initcode.asm
kernel
:
$(OBJS)
multiboot
.o data.o
boot
other initcode
$(
LD
)
$(
LDFLAGS
)
-T
kernel.ld
-e
multiboot_entry
-o
kernel
multiboot
.o data.o
$(
OBJS
)
-b
binary initcode
boot
other
kernel
:
$(OBJS)
entry
.o data.o
entry
other initcode
$(
LD
)
$(
LDFLAGS
)
-T
kernel.ld
-e
multiboot_entry
-o
kernel
entry
.o data.o
$(
OBJS
)
-b
binary initcode
entry
other
$(
OBJDUMP
)
-S
kernel
>
kernel.asm
$(
OBJDUMP
)
-t
kernel |
sed
'1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d'
>
kernel.sym
...
...
@@ -121,12 +121,12 @@ kernel: $(OBJS) multiboot.o data.o bootother initcode
# great for testing the kernel on real hardware without
# needing a scratch disk.
MEMFSOBJS
=
$(
filter-out ide.o,
$(
OBJS
))
memide.o
kernelmemfs
:
$(MEMFSOBJS)
multiboot
.o data.o
boot
other initcode fs.img
$(
LD
)
$(
LDFLAGS
)
-Ttext
0x100000
-e
main
-o
kernelmemfs
multiboot
.o data.o
$(
MEMFSOBJS
)
-b
binary initcode
boot
other fs.img
kernelmemfs
:
$(MEMFSOBJS)
entry
.o data.o
entry
other initcode fs.img
$(
LD
)
$(
LDFLAGS
)
-Ttext
0x100000
-e
main
-o
kernelmemfs
entry
.o data.o
$(
MEMFSOBJS
)
-b
binary initcode
entry
other fs.img
$(
OBJDUMP
)
-S
kernelmemfs
>
kernelmemfs.asm
$(
OBJDUMP
)
-t
kernelmemfs |
sed
'1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d'
>
kernelmemfs.sym
tags
:
$(OBJS)
boot
other.S _init
tags
:
$(OBJS)
entry
other.S _init
etags
*
.S
*
.c
vectors.S
:
vectors.pl
...
...
This diff is collapsed.
Click to expand it.
multiboot
.S
→
entry
.S
+
0
−
0
View file @
c60a3551
File moved
This diff is collapsed.
Click to expand it.
boot
other.S
→
entry
other.S
+
1
−
1
View file @
c60a3551
...
...
@@ -58,7 +58,7 @@ start32:
orl
$
(
CR0_PE|CR0_PG|CR0_WP
),
%
eax
movl
%
eax
,
%
cr0
#
Switch
to
the
stack
allocated
by
boot
others
()
#
Switch
to
the
stack
allocated
by
entry
others
()
movl
(
start
-
4
),
%
esp
#
Call
mpboot
()
call
*(
start
-
8
)
...
...
This diff is collapsed.
Click to expand it.
main.c
+
11
−
11
View file @
c60a3551
...
...
@@ -6,7 +6,7 @@
#include
"proc.h"
#include
"x86.h"
static
void
boot
others
(
void
);
static
void
enter
others
(
void
);
static
void
mpmain
(
void
)
__attribute__
((
noreturn
));
extern
pde_t
*
kpgdir
;
...
...
@@ -33,14 +33,14 @@ main(void)
ideinit
();
// disk
if
(
!
ismp
)
timerinit
();
// uniprocessor timer
boot
others
();
// start other processors (must come before kinit; must use boot_alloc)
enter
others
();
// start other processors (must come before kinit; must use boot_alloc)
kinit
();
// initialize memory allocator
userinit
();
// first user process (must come after kinit)
// Finish setting up this processor in mpmain.
mpmain
();
}
// Other CPUs jump here from
boot
other.S.
// Other CPUs jump here from
entry
other.S.
static
void
mpboot
(
void
)
{
...
...
@@ -56,7 +56,7 @@ mpmain(void)
{
cprintf
(
"cpu%d: starting
\n
"
,
cpu
->
id
);
idtinit
();
// load idt register
xchg
(
&
cpu
->
booted
,
1
);
// tell
boot
others() we're up
xchg
(
&
cpu
->
booted
,
1
);
// tell
enter
others() we're up
scheduler
();
// start running processes
}
...
...
@@ -64,24 +64,24 @@ pde_t bootpgdir[];
// Start the non-boot processors.
static
void
boot
others
(
void
)
enter
others
(
void
)
{
extern
uchar
_binary_
boot
other_start
[],
_binary_
boot
other_size
[];
extern
uchar
_binary_
entry
other_start
[],
_binary_
entry
other_size
[];
uchar
*
code
;
struct
cpu
*
c
;
char
*
stack
;
// Write bootstrap code to unused memory at 0x7000.
// The linker has placed the image of
boot
other.S in
// _binary_
boot
other_start.
// The linker has placed the image of
entry
other.S in
// _binary_
entry
other_start.
code
=
p2v
(
0x7000
);
memmove
(
code
,
_binary_
boot
other_start
,
(
uint
)
_binary_
boot
other_size
);
memmove
(
code
,
_binary_
entry
other_start
,
(
uint
)
_binary_
entry
other_size
);
for
(
c
=
cpus
;
c
<
cpus
+
ncpu
;
c
++
){
if
(
c
==
cpus
+
cpunum
())
// We've started already.
continue
;
// Tell
boot
other.S what stack to use, the address of mpboot and pgdir;
// Tell
entry
other.S what stack to use, the address of mpboot and pgdir;
// We cannot use kpgdir yet, because the AP processor is running in low
// memory, so we use bootpgdir for the APs too. kalloc can return addresses
// above 4Mbyte (the machine may have much more physical memory than 4Mbyte), which
...
...
@@ -101,7 +101,7 @@ bootothers(void)
}
}
// Boot page table used in multiboot.S and
boot
other.S.
// Boot page table used in multiboot.S and
entry
other.S.
// Page directories (and page tables), must start on a page boundary,
// hence the "__aligned__" attribute. Also, because of restrictions
// related to linking and static initializers, we use "x + PTE_P"
...
...
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