Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.11: Redesign config and build system, split into sub-crates, and provide disk image builder #232

Merged
merged 239 commits into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
15ce095
Create a 16-bit 'Hello World'
phil-opp Dec 13, 2019
87c3723
Remove panic! call since it leads to a too large binary
phil-opp Dec 14, 2019
fd1b5be
Enable lto and debug info
phil-opp Dec 20, 2019
37ff520
Split first stage into multiple output sections
phil-opp Dec 20, 2019
9ca6de1
Perform more work in boot.s
phil-opp Dec 20, 2019
1b95736
Set relocation model to static
phil-opp Dec 20, 2019
4d74604
Load a second stage from disk in Rust
phil-opp Dec 20, 2019
2f3bd08
Ignore test.bin
phil-opp Dec 20, 2019
cf9517f
wip
phil-opp Dec 20, 2019
34fc6d0
Use localized symbols
phil-opp Dec 29, 2019
8e9f565
Try to link as ELF64
phil-opp Dec 29, 2019
88af668
Some renaming
phil-opp Dec 29, 2019
c183314
Fix build instructions in readme
phil-opp Apr 24, 2020
382388e
Use `-Zbuildstd
phil-opp Apr 24, 2020
bd12d2c
Create output section of .eh_frame to prevent automatic placing
phil-opp Apr 24, 2020
b3df5e8
Create new `bootloader_api` crate that puts config in ELF section
phil-opp Dec 2, 2021
01ab004
Reexport `BootInfo` struct at top level
phil-opp Dec 2, 2021
e526844
Run cargo fmt
phil-opp Dec 2, 2021
846105f
Remove commented-out build.rs code
phil-opp Dec 23, 2021
b49f018
Replace unstable `split_array` feature with custom function
phil-opp Dec 23, 2021
275e991
Fix import in doc test
phil-opp Dec 23, 2021
14a42c6
The `asm` macro was stabilized as `core::arch::asm`
phil-opp Dec 23, 2021
731d624
Add rustfmt/clippy to rust-toolchain.toml
phil-opp Dec 23, 2021
07781c8
Improve docs
phil-opp Dec 23, 2021
5cd1abf
Fix imports in macro
phil-opp Dec 23, 2021
e2612b4
Remove stabilized asm and global_asm features
phil-opp Dec 23, 2021
adb6fee
Use `bootloader_api::BootInfo` struct in `bootloader`
phil-opp Dec 23, 2021
8cb6d1a
Start migrating tests and examples to bootloader_api (doesn't work yet)
phil-opp Dec 23, 2021
d0f9749
Rename GitHub actions CI workflow file
phil-opp Dec 23, 2021
cfa19ad
Add rust-src and llvm-tools-preview components to rust-toolchain file
phil-opp Dec 23, 2021
aae7f7d
Remove toolchain install action from CI
phil-opp Dec 23, 2021
577aa9c
Run cargo fmt
phil-opp Dec 23, 2021
611ac54
Enable format on save on VSCode
phil-opp Dec 23, 2021
c9adc1d
Document entry point macro and fix macro import
phil-opp Dec 23, 2021
c8cc7bb
Remove old entry point macro
phil-opp Dec 23, 2021
8c7e951
Fully document the api crate
phil-opp Dec 23, 2021
c2674d6
Set up custom build command for rust-analyzer
phil-opp Dec 26, 2021
4e18af7
Remove bootloader build script
phil-opp Dec 26, 2021
6c43cff
Format Cargo.toml
phil-opp Dec 26, 2021
8f8b5ac
Remove compile-time config and kernel byte array completely
phil-opp Dec 26, 2021
db7d4d3
Add and use dependency on api crate
phil-opp Dec 26, 2021
3d169fa
Parse version info in api build script and use it
phil-opp Dec 26, 2021
94c5165
Use `ApiVersion` struct in `BootInfo`
phil-opp Dec 26, 2021
12f2adb
Replace deprecated x86_64 segment methods
phil-opp Dec 26, 2021
33be56e
Use non-exhaustive `api::BootInfo` struct in bootloaader
phil-opp Dec 26, 2021
ce7670b
Make `BootInfo `Copy`-able
phil-opp Dec 27, 2021
72c5d45
Rename `PixelFormat` variants and add `Framebuffer::new` constructor
phil-opp Dec 27, 2021
048b6a0
Add kernel struct for passing BootloaderConfig around and use mappings
phil-opp Dec 27, 2021
a9c8e9e
First prototype implementation of ELF loading and config parsing in U…
phil-opp Dec 27, 2021
9a3470f
Update Cargo.lock for basic_example
phil-opp Dec 28, 2021
e76b7e1
Update builder executable for new bootloader design (UEFI only)
phil-opp Dec 28, 2021
1563a44
First working version of dynamic kernel loading in UEFI bootloader
phil-opp Dec 28, 2021
02d0a0c
Start adjusting first stage for dynamic kernel loading and FAT support
phil-opp Dec 28, 2021
2b7f49e
Move rodata to separate section
phil-opp Dec 29, 2021
e918cc1
Add partition table to output file
phil-opp Dec 29, 2021
708ee38
Use opt level s instead of z
phil-opp Dec 29, 2021
226e55d
Make executable smaller and improve screen output
phil-opp Dec 29, 2021
a333010
Add a basic Readme with build instructions
phil-opp Dec 29, 2021
f6c3d68
Remove unreal mode code from `boot.s`
phil-opp Dec 29, 2021
9b887fc
Merge branch '16-bit-wip' into next
phil-opp Dec 29, 2021
a253b3f
Start integrating first-stage executable into bootloader
phil-opp Dec 29, 2021
a28bbf1
Only load first sector of partition
phil-opp Dec 29, 2021
9583eaf
Create BIOS disk image from first stage with single FAT partition
phil-opp Dec 29, 2021
8fb5eff
Restructure into sub-crates
phil-opp Mar 1, 2022
ee9bf20
Replace artifact dependency with build script
phil-opp Apr 9, 2022
aefa4aa
Add function to create UEFI disk image to library
phil-opp Apr 9, 2022
31dc52c
Set subcrate version to 0.1.0-alpha.0
phil-opp Apr 9, 2022
a802032
Support both local builds and builds as dependency
phil-opp Apr 9, 2022
6047a89
Comment out main.rs for now
phil-opp Apr 9, 2022
138b198
Update versions in bios impl
phil-opp Apr 9, 2022
d30685e
Only build local version if it exists
phil-opp Apr 9, 2022
6e34ad1
Add description and license to crates
phil-opp Apr 9, 2022
8c00c9e
Fix x86_64 dependency of common crate
phil-opp Apr 9, 2022
768f2a7
Merge tag 'v0.10.11' into next
phil-opp Apr 9, 2022
4ecba49
Merge #206 into next
phil-opp Apr 9, 2022
3938b06
Merge PR #213 into next
phil-opp Apr 9, 2022
71accbb
Remove BOOTLOADER_LOCAL_BUILD env variable
phil-opp Apr 9, 2022
fd7b2cf
Adjust and merge PR #219 into next
phil-opp Apr 9, 2022
fdf9d4b
Integrate latest changes from `main`
phil-opp Apr 9, 2022
c7a5b33
Fix: include kernel size in FAT size calculation
phil-opp Apr 9, 2022
4d4b584
Update test framework to rewrite
phil-opp Apr 9, 2022
ca53780
Use ovmf-prebuilt crate for running UEFI tests
phil-opp Apr 9, 2022
f2a9dec
Remove outdated mods declarations
phil-opp Apr 9, 2022
74e1732
Fix: Don't pass cli arguments to QEMU
phil-opp Apr 9, 2022
302b8ae
CI: Run tests in parallel
phil-opp Apr 9, 2022
a4e67f3
Remove fragile framebuffer checks
phil-opp Apr 9, 2022
09fc7bd
Remove examples
phil-opp Apr 9, 2022
3aef58c
Merge PR #229 into next and adjust it to new config system
phil-opp Apr 10, 2022
c533bae
Also run tests of api crate on CI
phil-opp Apr 10, 2022
6d9fefe
Increase random config test iterations to 10k
phil-opp Apr 10, 2022
393c308
Fix copy&paste error in `verify_higher_half` test
phil-opp Apr 10, 2022
f1bf6de
Merge branch 'main' into next
phil-opp Apr 10, 2022
5dbc503
Remove `uefi` dependency of `common` crate
phil-opp Apr 10, 2022
6134fed
Replace `rand_chacha` with `rand_hc`
phil-opp Apr 10, 2022
0b8f95d
Remove uneeded dependencies
phil-opp Apr 10, 2022
eb6d71f
Start integrating BIOS bootloader into build system
phil-opp Apr 10, 2022
bf1895b
Fix partition table
phil-opp Apr 16, 2022
0d77948
Simplify MBR code and choose bootable partition
phil-opp Apr 16, 2022
01fdcbc
Move bios boot sector build to top level build script
phil-opp Apr 16, 2022
d8b50dc
Refactor FAT creation function to take arbitrary file list
phil-opp Apr 16, 2022
3812a86
Refactor GPT creation and move it to separate module
phil-opp Apr 16, 2022
5310e4b
Integrate BIOS bootsector into build system
phil-opp Apr 16, 2022
b14b4e3
Remove some env variables when building boot sector
phil-opp Apr 16, 2022
54adb4c
Rename boot sector linker script
phil-opp Apr 17, 2022
b3207db
Build and load a second stage
phil-opp Apr 17, 2022
4d41efe
Use pie relocation model for second stage
phil-opp Apr 17, 2022
5fd3115
Clean up boot sector code
phil-opp Apr 17, 2022
6a014df
update uefi
Freax13 Apr 24, 2022
92dd42d
implement UEFI PXE
Freax13 May 10, 2022
f975de9
add some comments
Freax13 May 26, 2022
bd2a59d
fix copy-paste error
Freax13 May 27, 2022
4f6f6bb
Minor docs improvements
phil-opp Jun 6, 2022
ca31f96
Remove dead code in PXE boot test runner
phil-opp Jun 6, 2022
47256d8
Merge pull request #237 from Freax13/uefi-pxe
phil-opp Jun 6, 2022
13c4d5e
Replace deprecated `handle_protocol` calls with `open_protocol`
phil-opp Jun 6, 2022
3b6aa00
WIP: try to start loading FAT partition in second stage
phil-opp Jun 11, 2022
abfdba5
Start custom FAT implementation bysed on `mini_fat` crate
phil-opp Jun 12, 2022
96d2bdb
Read root dir entries from FAT partition
phil-opp Jun 12, 2022
eef2109
Use segment-based addressing for DAP to support loading larger second…
phil-opp Jun 12, 2022
3de1a39
Reorder second stage sections
phil-opp Jun 12, 2022
a183966
Use pie relocation model for second stage
phil-opp Jun 12, 2022
1d7ff1f
Implement looking up `kernel-x86_64` file on FAT partition
phil-opp Jun 12, 2022
3e7f6cf
Add TODOs for next steps
phil-opp Jun 12, 2022
b12a3cf
Also remove `CARGO_ENCODED_RUSTFLAGS` env variable from build script …
phil-opp Jun 25, 2022
06d3b95
Read FAT clusters of kernel file
phil-opp Jun 25, 2022
a958a2b
Return cluster start address and size
phil-opp Jun 25, 2022
c8a0c04
Remove some printlns
phil-opp Jun 25, 2022
f1f5457
Remove alignment and assert maximum executable size
phil-opp Jun 27, 2022
6e8f9fa
Ensure proper alignment of DAP target buffer
phil-opp Jun 27, 2022
de014a9
Remove some printlns to keep binary size down
phil-opp Jun 27, 2022
80de514
Remove some old FAT modules
phil-opp Jun 27, 2022
cdfc0c3
Use static relocation model in an attempt to bring binary size down
phil-opp Jun 27, 2022
7a24837
Enter unreal mode
phil-opp Jun 27, 2022
3b83a08
Remove unused module
phil-opp Jun 27, 2022
0df7c07
Move root dir buffer into main.rs to reuse it later
phil-opp Jun 27, 2022
5b257be
Reset buffer limit after reading root dir
phil-opp Jun 27, 2022
785e82a
Update TODOs
phil-opp Jun 27, 2022
d16b84b
Fix reuse of bootloader memory areas
phil-opp Aug 12, 2022
73ae143
Allocate UEFI kernel memory using custom memory type
phil-opp Aug 12, 2022
e0a0836
Remove copy&pasted comments from second stage linker script
phil-opp Aug 14, 2022
84eea29
Load the kernel into buffer memory
phil-opp Aug 14, 2022
52ad3e2
Copy kernel to protected mode
phil-opp Aug 14, 2022
397a2d0
Enable overflow checks for second stage
phil-opp Aug 14, 2022
955643d
Pass read size directly in `read_exact_into`
phil-opp Aug 14, 2022
66b16a3
Create `load_file` function
phil-opp Aug 14, 2022
5b5c5e6
Fix some warnings
phil-opp Aug 14, 2022
6492eab
Load a third stage
phil-opp Aug 14, 2022
7cf073e
Jump to third stage
phil-opp Aug 14, 2022
6369fae
Verify bytes written to protected mode memory
phil-opp Aug 14, 2022
af6d192
Rename bios stages
phil-opp Aug 14, 2022
824786b
Set up paging and enter long mode (compatibility mode)
phil-opp Aug 14, 2022
7c0df39
Delete old real mode test code
phil-opp Aug 14, 2022
83ed2c8
Remove old linker script and target file
phil-opp Aug 14, 2022
39ba526
Create prototype for long mode stage 4 and load it
phil-opp Aug 14, 2022
478ea85
Enable debug symbols for stage 3
phil-opp Aug 15, 2022
18afbb1
Fix: Return correct offset from `read_exact`
phil-opp Aug 15, 2022
830b836
Fix: Seek to start before loading bpb
phil-opp Aug 15, 2022
bfffdd3
Add cluster index number to cluster struct
phil-opp Aug 15, 2022
694f81b
Print load addresses in stage 2
phil-opp Aug 15, 2022
29e3200
Read file size from file metadata instead of counting it
phil-opp Aug 15, 2022
0f0eb88
Fix: Keep track of total offset when copying to protected mode
phil-opp Aug 15, 2022
3ce77c5
Pass kernel and stage-4 addresses to stage-3
phil-opp Aug 15, 2022
b69f8a7
Add a vga buffer writer to stage 3
phil-opp Aug 15, 2022
5eb8264
Minor target tweaks
phil-opp Aug 15, 2022
9b80050
Minor error message fix
phil-opp Aug 15, 2022
cd4ec80
Add vga buffer implementation
phil-opp Aug 15, 2022
a167ef2
Reorder stage 2 sections to fix relocation out of range error
phil-opp Aug 27, 2022
6a57e01
Create `Addresses` struct to pass the various memory addresses betwee…
phil-opp Aug 27, 2022
900327d
Link stage-4 statically at predefined address
phil-opp Aug 27, 2022
899cec6
Fix: actually use passed `self` pointer in GDT load function
phil-opp Aug 27, 2022
05130d1
Load long mode GDT and jump to 4th stage
phil-opp Aug 27, 2022
e5dddcf
Update stage-4 with VGA printing and handling of Addresses struct
phil-opp Aug 27, 2022
d893197
Query vesa modes and filter by resolution
phil-opp Aug 28, 2022
d7f8990
Fill in VESA framebuffer info in boot information
phil-opp Aug 28, 2022
80b6bee
Remove old assembly file
phil-opp Aug 28, 2022
557c034
Enable VESA framebuffer and update screen writer in stages 3 and 4
phil-opp Aug 28, 2022
48cd6dc
Load E820 memory map and put everything together
phil-opp Aug 28, 2022
7a1e1a7
Also run UEFI tests again
phil-opp Aug 28, 2022
a5fe892
Remove vscode config
phil-opp Aug 28, 2022
d983247
Switch stage-4 to logger instead of using custom screen writer
phil-opp Aug 28, 2022
b007a6b
Don't use LLVM-reserved registers
phil-opp Aug 28, 2022
4f5b574
Rename struct
phil-opp Aug 28, 2022
b937096
Fix warnings
phil-opp Aug 28, 2022
7be9e68
Add TODO for VESA resolution config
phil-opp Aug 28, 2022
a4a1fb5
Use new resolver
phil-opp Aug 28, 2022
6c01f45
Fix some more warnings
phil-opp Aug 28, 2022
d633408
Fix: `repr(packed)` does not imply `repr(C)`
phil-opp Sep 10, 2022
d8943dd
Explain why we need to retain the contents of the `si` register
phil-opp Sep 10, 2022
718b471
Remove commented out code
phil-opp Sep 10, 2022
50e4563
Remove unnecessary reference
phil-opp Sep 10, 2022
fdc630f
Make `query_memory_map` unsafe
phil-opp Sep 10, 2022
2eed431
Remove smiley write after entering unreal mode
phil-opp Sep 10, 2022
2215d00
Remove nop instructions and explain why we need inline asm to access …
phil-opp Sep 10, 2022
39b5f16
Let compiler select registers when enabling protected mode
phil-opp Sep 10, 2022
b00bf34
Let compiler select register when loading GDT
phil-opp Sep 10, 2022
bee20ac
Apply suggestions from code review
phil-opp Sep 10, 2022
c1d01d6
Remove `noreturn` option again because it disallows clobbers
phil-opp Sep 10, 2022
48ced39
The second stage-4 argument is no longer needed
phil-opp Sep 10, 2022
2550267
Let the compiler select the register for reloading `ds` etc
phil-opp Sep 10, 2022
26a6aee
Use `ptr::write` for writing page table
phil-opp Sep 10, 2022
e62a933
Make `read_exact` function unsafe
phil-opp Sep 10, 2022
b0e805e
Revert "The second stage-4 argument is no longer needed"
phil-opp Sep 10, 2022
915c25b
Apply more code review suggestions
phil-opp Sep 10, 2022
960671c
Don't panic if kernel file name is shorter than 11 chars
phil-opp Sep 10, 2022
28bd6ca
Remove accidentally commited `main_bak.rs`
phil-opp Sep 11, 2022
47a4c85
Fix last line check for logger
phil-opp Sep 11, 2022
130d5f0
Fix: also consider bitmap width when decided whether a newline is needed
phil-opp Sep 11, 2022
08e4b58
Allocate kernel as normal UEFI loader data
phil-opp Sep 11, 2022
c274be7
Make `add_region` panic on error
phil-opp Sep 11, 2022
667e57f
Preserve `RUNTIME_SERVICES_*` memory regions
phil-opp Sep 11, 2022
454f707
Update usage instructions and architecture description in README
phil-opp Sep 11, 2022
7088b53
Fix: Avoid mutable aliasing in `Framebuffer::buffer`
phil-opp Sep 11, 2022
230da17
Fix typo
phil-opp Sep 11, 2022
74ead92
Rename `VeryUnsafeCell` to `RacyCell`
phil-opp Sep 11, 2022
9cf9c4c
Fix width/height bound checks in stage-3 logger
phil-opp Sep 11, 2022
f95e9a9
Hide items generate by `entry_point` macro from static/fn namespace
phil-opp Sep 11, 2022
9e567cc
Test booting a kernel compiled with `lto`
phil-opp Sep 25, 2022
076bea9
Fix `force_use` function by using original slice ptr instead of stack…
phil-opp Sep 25, 2022
9a6c884
Merge branch 'main' into next
phil-opp Sep 25, 2022
2ac7140
Improve error message when bootloader config section is not found
phil-opp Oct 2, 2022
305b7f2
Adjust max dimensions for VESA framebuffer
phil-opp Oct 2, 2022
5f51766
Change version back to v0.11-alpha
phil-opp Oct 2, 2022
e997c74
Refactor image creation API
phil-opp Oct 2, 2022
aebe0d3
Write location first in panic handler
phil-opp Oct 2, 2022
6eb0abb
Fix: Don't overwrite `es` register
phil-opp Oct 2, 2022
a6d69e9
Fix: Add support for segments in video mode ptr
phil-opp Oct 2, 2022
80731d7
Take pixel format into account when determining best VESA mode
phil-opp Oct 2, 2022
c78a2f5
Add a log message when loading kernel
phil-opp Oct 2, 2022
f0e8be2
remove unnecessary duplicate field
Freax13 Oct 4, 2022
c9444f5
make framebuffer optional in `common`
Freax13 Oct 4, 2022
d6e0d2b
don't fail when there's no uefi graphics output
Freax13 Oct 4, 2022
29b9912
Merge pull request #268 from Freax13/optional-framebuffer
phil-opp Oct 6, 2022
e02ead7
Merge branch 'main' into next
phil-opp Nov 13, 2022
7ea5ecf
Add basic error strings for deserialization errors
phil-opp Nov 13, 2022
46c7725
Create migration guides
phil-opp Nov 13, 2022
2ceec8a
Create migration guides and a disk image creation template
phil-opp Nov 13, 2022
9f590dc
Merge pull request #280 from rust-osdev/deserialize-errors
phil-opp Nov 13, 2022
bb9e7af
Remove unused imports
phil-opp Nov 13, 2022
2ca6ebd
Resolve all remaining warnings and fix build with `--all-targets`
phil-opp Nov 13, 2022
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
7 changes: 2 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[target.x86_64-unknown-uefi]
runner = "cargo run -p runner"

[alias]
builder = "run --bin builder --features builder --quiet --"
[unstable]
bindeps = true
36 changes: 7 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
- cron: '40 5 * * *' # every day at 5:40
- cron: "40 5 * * *" # every day at 5:40

jobs:
check:
Expand All @@ -15,10 +15,6 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
- name: "Run `cargo check`"
uses: actions-rs/cargo@v1
with:
Expand All @@ -36,11 +32,6 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rust-src, llvm-tools-preview

# install QEMU
- name: Install QEMU (Linux)
Expand All @@ -62,30 +53,22 @@ jobs:
- name: "Print QEMU Version"
run: qemu-system-x86_64 --version

- name: Run `cargo test`
- name: Run api tests
uses: actions-rs/cargo@v1
with:
command: test
args: "-- --test-threads 1"
args: -p bootloader_api

- name: "Example: `basic`"
working-directory: examples/basic
run: cargo kimage

- name: "Example: `test_framework` example"
working-directory: examples/test_framework
run: cargo ktest
- name: Run integration tests
uses: actions-rs/cargo@v1
with:
command: test

fmt:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rustfmt
- name: Run `cargo fmt --all -- --check`
uses: actions-rs/cargo@v1
with:
Expand All @@ -97,11 +80,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: clippy
- name: Run `cargo clippy`
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

Loading