mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Merge branch 'post-08' into post-09
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
[unstable]
|
||||||
|
build-std = ["core", "compiler_builtins"]
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
target = "x86_64-blog_os.json"
|
target = "x86_64-blog_os.json"
|
||||||
|
|
||||||
162
.github/workflows/build-code.yml
vendored
162
.github/workflows/build-code.yml
vendored
@@ -12,9 +12,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
check:
|
||||||
name: "Test"
|
name: Check
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [
|
platform: [
|
||||||
@@ -22,75 +21,112 @@ jobs:
|
|||||||
macos-latest,
|
macos-latest,
|
||||||
windows-latest
|
windows-latest
|
||||||
]
|
]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
timeout-minutes: 15
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout Repository"
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Rust Toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
- name: Install `rust-src` Rustup Component
|
||||||
|
run: rustup component add rust-src
|
||||||
|
- name: Run `cargo check`
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: check
|
||||||
|
|
||||||
- name: Install Rustup
|
test:
|
||||||
run: |
|
name: Test
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
|
strategy:
|
||||||
echo ::add-path::$HOME/.cargo/bin
|
matrix:
|
||||||
if: runner.os == 'macOS'
|
platform: [
|
||||||
|
ubuntu-latest,
|
||||||
|
macos-latest,
|
||||||
|
windows-latest
|
||||||
|
]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- name: Install Rust Toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
- name: Install bootimage
|
||||||
|
run: cargo install bootimage --debug
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Rustup Components
|
||||||
|
run: rustup component add rust-src llvm-tools-preview
|
||||||
|
- name: Run `cargo bootimage`
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: bootimage
|
||||||
|
|
||||||
- name: "Print Rust Version"
|
# install QEMU
|
||||||
run: |
|
- name: Install QEMU (Linux)
|
||||||
rustc -Vv
|
run: sudo apt update && sudo apt install qemu-system-x86
|
||||||
cargo -Vv
|
if: runner.os == 'Linux'
|
||||||
|
- name: Install QEMU (macOS)
|
||||||
|
run: brew install qemu
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
env:
|
||||||
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||||
|
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
|
||||||
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
||||||
|
- name: Install Scoop (Windows)
|
||||||
|
run: |
|
||||||
|
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
|
||||||
|
echo ::add-path::$HOME\scoop\shims
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
- name: Install QEMU (Windows)
|
||||||
|
run: scoop install qemu
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
- name: "Print QEMU Version"
|
||||||
|
run: qemu-system-x86_64 --version
|
||||||
|
|
||||||
- name: "Install Rustup Components"
|
- name: Run `cargo test`
|
||||||
run: rustup component add rust-src llvm-tools-preview
|
uses: actions-rs/cargo@v1
|
||||||
- name: "Install cargo-xbuild"
|
with:
|
||||||
run: cargo install cargo-xbuild --debug
|
command: test
|
||||||
- name: "Install bootimage"
|
|
||||||
run: cargo install bootimage --debug
|
|
||||||
|
|
||||||
- name: "Run cargo xbuild"
|
|
||||||
run: cargo xbuild
|
|
||||||
- name: "Create Bootimage"
|
|
||||||
run: cargo bootimage
|
|
||||||
|
|
||||||
# install QEMU
|
|
||||||
- name: Install QEMU (Linux)
|
|
||||||
run: sudo apt update && sudo apt install qemu-system-x86
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
- name: Install QEMU (macOS)
|
|
||||||
run: brew install qemu
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
env:
|
|
||||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
||||||
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
|
|
||||||
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
|
||||||
- name: Install Scoop (Windows)
|
|
||||||
run: |
|
|
||||||
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
|
|
||||||
echo ::add-path::$HOME\scoop\shims
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
shell: pwsh
|
|
||||||
- name: Install QEMU (Windows)
|
|
||||||
run: scoop install qemu
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
shell: pwsh
|
|
||||||
- name: "Print QEMU Version"
|
|
||||||
run: qemu-system-x86_64 --version
|
|
||||||
|
|
||||||
- name: "Run cargo xtest"
|
|
||||||
run: cargo xtest
|
|
||||||
|
|
||||||
check_formatting:
|
check_formatting:
|
||||||
name: "Check Formatting"
|
name: Check Formatting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 2
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- name: Checkout Repository
|
||||||
- name: "Use the latest Rust nightly with rustfmt"
|
uses: actions/checkout@v2
|
||||||
uses: actions-rs/toolchain@v1
|
- name: Install Rust Toolchain
|
||||||
with:
|
uses: actions-rs/toolchain@v1
|
||||||
toolchain: nightly
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
override: true
|
override: true
|
||||||
- run: cargo fmt -- --check
|
- name: Run `cargo fmt`
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
|
||||||
|
clippy:
|
||||||
|
name: Clippy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Rust Toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
components: clippy, rust-src
|
||||||
|
override: true
|
||||||
|
- name: Run `cargo clippy`
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: -- -D warnings
|
||||||
|
|||||||
11
Cargo.lock
generated
11
Cargo.lock
generated
@@ -20,6 +20,7 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
"pc-keyboard",
|
"pc-keyboard",
|
||||||
"pic8259_simple",
|
"pic8259_simple",
|
||||||
|
"rlibc",
|
||||||
"spin",
|
"spin",
|
||||||
"uart_16550",
|
"uart_16550",
|
||||||
"volatile",
|
"volatile",
|
||||||
@@ -28,9 +29,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bootloader"
|
name = "bootloader"
|
||||||
version = "0.9.3"
|
version = "0.9.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "44ac0bdf4930c3c4d7f0d04eb6f15d7dcb9d5972b1ff9cd2bee0128112260fc7"
|
checksum = "0ad686b9b47363de7d36c05fb6885f17d08d0f2d15b1bc782a101fe3c94a2c7c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpuio"
|
name = "cpuio"
|
||||||
@@ -62,6 +63,12 @@ dependencies = [
|
|||||||
"cpuio",
|
"cpuio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rlibc"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spin"
|
name = "spin"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ name = "stack_overflow"
|
|||||||
harness = false
|
harness = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bootloader = { version = "0.9.3", features = ["map_physical_memory"]}
|
bootloader = { version = "0.9.8", features = ["map_physical_memory"]}
|
||||||
|
rlibc = "1.0.0"
|
||||||
volatile = "0.2.6"
|
volatile = "0.2.6"
|
||||||
spin = "0.5.2"
|
spin = "0.5.2"
|
||||||
x86_64 = "0.11.0"
|
x86_64 = "0.11.0"
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#![test_runner(crate::test_runner)]
|
#![test_runner(crate::test_runner)]
|
||||||
#![reexport_test_harness_main = "test_main"]
|
#![reexport_test_harness_main = "test_main"]
|
||||||
|
|
||||||
|
extern crate rlibc;
|
||||||
|
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
pub mod gdt;
|
pub mod gdt;
|
||||||
|
|||||||
Reference in New Issue
Block a user