Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ repository = "https://github.com/rust-osdev/bootloader"
edition = "2018"
build = "build.rs"

[[bin]]
name = "bootloader"
required-features = ["binary"]

[dependencies]
xmas-elf = "0.6.2"
x86_64 = "0.7.2"
usize_conversions = "0.2.0"
fixedvec = "0.2.3"
xmas-elf = { version = "0.6.2", optional = true }
x86_64 = { version = "0.7.2", optional = true }
usize_conversions = { version = "0.2.0", optional = true }
fixedvec = { version = "0.2.3", optional = true }

[dependencies.font8x8]
version = "0.2.4"
Expand All @@ -25,6 +29,7 @@ llvm-tools = "0.1"

[features]
default = []
binary = ["xmas-elf", "x86_64", "usize_conversions", "fixedvec"]
vga_320x200 = ["font8x8"]
recursive_page_table = []
map_physical_memory = []
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ As an example, you can build the bootloader with example kernel from the `exampl
cd example-kernel
cargo xbuild
cd ..
KERNEL=example-kernel/target/x86_64-example-kernel/debug/example-kernel cargo xbuild --release
KERNEL=example-kernel/target/x86_64-example-kernel/debug/example-kernel cargo xbuild --release --features binary
```

This results in a bootloader executable at `target/x86_64-bootloader.json/release/bootloader`. This executable is still an ELF file, which can't be run directly.
The `binary` feature is required to enable the dependencies required for compiling the bootloader executable. The command results in a bootloader executable at `target/x86_64-bootloader.json/release/bootloader`. This executable is still an ELF file, which can't be run directly.

## Run

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ steps:
workingDirectory: test-kernel
displayName: 'Build Test Kernel'

- script: cargo xbuild --release
- script: cargo xbuild --bin bootloader --features binary --release
displayName: 'Build Bootloader'
env: { KERNEL: "test-kernel/target/x86_64-test-kernel/debug/test-kernel" }

Expand Down