Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bootloader-coreboot
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
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
redox-os
bootloader-coreboot
Commits
951ca9fe
Verified
Commit
951ca9fe
authored
6 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Conditional kernel inclusion
parent
962004fc
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
Makefile
+11
-2
11 additions, 2 deletions
Makefile
src/nasm/startup.asm
+7
-1
7 additions, 1 deletion
src/nasm/startup.asm
with
18 additions
and
3 deletions
Makefile
+
11
−
2
View file @
951ca9fe
...
...
@@ -4,18 +4,27 @@ TARGET=$(ARCH)-unknown-none
export
LD
=
ld
export
OBJCOPY
=
objcopy
export
RUST_TARGET_PATH
=
$(
CURDIR
)
/targets
export
XARGO_HOME
=
$(
CURDIR
)
/
build
/xargo
export
XARGO_HOME
=
$(
CURDIR
)
/
target
/xargo
all
:
build/bootloader
build/libstartup.o
:
src/nasm/startup.asm src/nasm/* build/kernel
clean
:
rm
-rf
build
build/libstartup.o
:
src/nasm/startup.asm src/nasm/*
mkdir
-p
build
ifeq
($(KERNEL),)
nasm
-f
elf32
$<
-I
src/nasm/
-o
$@
else
nasm
-f
elf32
$<
-I
src/nasm/
-D
KERNEL
=
$(
KERNEL
)
-o
$@
endif
build/libbootloader.a
:
Cargo.lock Cargo.toml src/* src/*/* src/*/*/* src/*/*/*/*
mkdir
-p
build
xargo rustc
--lib
--target
$(
TARGET
)
--release
--
-C
soft-float
-C
debuginfo
=
2
--emit
link
=
$@
build/bootloader
:
linkers/$(ARCH).ld build/libstartup.o build/libbootloader.a
mkdir
-p
build
$(
LD
)
-m
elf_i386
--gc-sections
-z
max-page-size
=
0x1000
-T
$<
-o
$@
build/libstartup.o build/libbootloader.a
&&
\
$(
OBJCOPY
)
--only-keep-debug
$@
$@
.sym
&&
\
$(
OBJCOPY
)
--strip-debug
$@
This diff is collapsed.
Click to expand it.
src/nasm/startup.asm
+
7
−
1
View file @
951ca9fe
...
...
@@ -43,6 +43,7 @@ long_mode:
mov
gs
,
rax
mov
ss
,
rax
%ifdef KERNEL
; set kernel size
mov
rax
,
__kernel_end
sub
rax
,
__kernel
...
...
@@ -61,6 +62,8 @@ long_mode:
; entry point
mov
rax
,
[
args.kernel_base
]
call
[
rax
+
0x18
]
%endif
.halt:
cli
hlt
...
...
@@ -111,6 +114,9 @@ iend
.end
equ
$
-
gdt
SECTION
.kernel
%ifdef KERNEL
__kernel:
INCBIN
"
build
/
kernel
"
%defstr KERNEL_STR %[KERNEL]
INCBIN
KERNEL_STR
__kernel_end:
%endif
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