mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Compare commits
12 Commits
post-12-wi
...
post-01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b44d8ab7fc | ||
|
|
c551fec1ce | ||
|
|
430e2143f8 | ||
|
|
86ffa24e8e | ||
|
|
8708b54756 | ||
|
|
bdb6a424a8 | ||
|
|
1501669819 | ||
|
|
deb0f63dff | ||
|
|
6ad573bb11 | ||
|
|
3fb4695f6c | ||
|
|
635677d07c | ||
|
|
b276ec4765 |
76
.github/workflows/build-code.yml
vendored
76
.github/workflows/build-code.yml
vendored
@@ -1,76 +0,0 @@
|
|||||||
name: Build Code
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
- '!staging.tmp'
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
schedule:
|
|
||||||
- cron: '40 3 * * *' # every day at 3:40
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: "Test"
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
platform: [
|
|
||||||
ubuntu-latest,
|
|
||||||
macos-latest,
|
|
||||||
windows-latest
|
|
||||||
]
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
|
||||||
timeout-minutes: 15
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Checkout Repository"
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
|
|
||||||
- name: Install Rustup
|
|
||||||
run: |
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
|
|
||||||
echo ::add-path::$HOME/.cargo/bin
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
|
|
||||||
- name: "Print Rust Version"
|
|
||||||
run: |
|
|
||||||
rustc -Vv
|
|
||||||
cargo -Vv
|
|
||||||
|
|
||||||
- name: "Add thumbv7em-none-eabihf Target"
|
|
||||||
run: rustup target add thumbv7em-none-eabihf
|
|
||||||
|
|
||||||
- name: "Build for thumbv7em-none-eabihf"
|
|
||||||
run: cargo build --target thumbv7em-none-eabihf
|
|
||||||
|
|
||||||
- name: "Build for Linux"
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: cargo rustc -- -C link-arg=-nostartfiles
|
|
||||||
|
|
||||||
- name: "Build for macOS"
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: cargo rustc -- -C link-args="-e __start -static -nostartfiles"
|
|
||||||
|
|
||||||
- name: "Build for Windows"
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: cargo rustc -- -C link-args="/ENTRY:_start /SUBSYSTEM:console"
|
|
||||||
|
|
||||||
|
|
||||||
check_formatting:
|
|
||||||
name: "Check Formatting"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 2
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: "Use the latest Rust nightly with rustfmt"
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: nightly
|
|
||||||
profile: minimal
|
|
||||||
components: rustfmt
|
|
||||||
override: true
|
|
||||||
- run: cargo fmt -- --check
|
|
||||||
110
.github/workflows/code.yml
vendored
Normal file
110
.github/workflows/code.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
name: Code
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
- '!staging.tmp'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
schedule:
|
||||||
|
- cron: '40 3 * * *' # every day at 3:40
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
name: Check
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform: [
|
||||||
|
ubuntu-latest,
|
||||||
|
macos-latest,
|
||||||
|
windows-latest
|
||||||
|
]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
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
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
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: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Add thumbv7em-none-eabihf Target
|
||||||
|
run: rustup target add thumbv7em-none-eabihf
|
||||||
|
- name: Build for thumbv7em-none-eabihf
|
||||||
|
run: cargo build --target thumbv7em-none-eabihf
|
||||||
|
- name: Build for Linux
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
run: cargo rustc -- -C link-arg=-nostartfiles
|
||||||
|
- name: Build for macOS
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: cargo rustc -- -C link-args="-e __start -static -nostartfiles"
|
||||||
|
- name: Build for Windows
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
run: cargo rustc -- -C link-args="/ENTRY:_start /SUBSYSTEM:console"
|
||||||
|
|
||||||
|
check_formatting:
|
||||||
|
name: Check Formatting
|
||||||
|
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: rustfmt
|
||||||
|
override: true
|
||||||
|
- 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
|
||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1,5 +1,7 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "blog_os"
|
name = "blog_os"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "blog_os"
|
name = "blog_os"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
|
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
|
||||||
edition = "2018"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
@@ -11,3 +11,8 @@ panic = "abort"
|
|||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "blog_os"
|
||||||
|
test = false
|
||||||
|
bench = false
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Blog OS (A Freestanding Rust Binary)
|
# Blog OS (A Freestanding Rust Binary)
|
||||||
|
|
||||||
[](https://github.com/phil-opp/blog_os/actions?query=workflow%3A%22Build+Code%22+branch%3Apost-01)
|
[](https://github.com/phil-opp/blog_os/actions?query=workflow%3A%22Code%22+branch%3Apost-01)
|
||||||
|
|
||||||
This repository contains the source code for the [A Freestanding Rust Binary][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
|
This repository contains the source code for the [A Freestanding Rust Binary][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
#[no_mangle]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user