Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bootloader-coreboot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
bootloader-coreboot
Commits
951ca9fe
Verified
Commit
951ca9fe
authored
Feb 24, 2019
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditional kernel inclusion
parent
962004fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
Makefile
Makefile
+11
-2
src/nasm/startup.asm
src/nasm/startup.asm
+7
-1
No files found.
Makefile
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
$@
src/nasm/startup.asm
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment