Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
max_line_length = 80
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.{json,md,nix,toml,yml}]
indent_size = 2
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: phip1611
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: [ "version-update:semver-patch" ]
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
73 changes: 0 additions & 73 deletions .github/workflows/build.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# We auto-merge all dependabot updates as soon as the CI are met.
#
# More info: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions

name: Dependabot PR auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'rust-osdev/uart_16550'
steps:
- name: Approve
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
12 changes: 12 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: QA

on: [ push, pull_request, merge_group ]

jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Executes "typos ."
- uses: crate-ci/typos@v1.41.0
110 changes: 110 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Build

on: [ push, pull_request, merge_group ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: "${{ matrix.runs-on }}"
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-latest
- windows-latest
rust:
- stable
- nightly
- 1.85.1 # MSVR
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
targets: x86_64-unknown-linux-gnu,x86_64-unknown-uefi,i686-unknown-uefi,thumbv7em-none-eabihf
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- name: Build
run: cargo build --all-targets --verbose
- name: Build (no_std)
run: |
cargo build --verbose --target x86_64-unknown-uefi
cargo build --verbose --target i686-unknown-uefi
- name: Build (no_std, aarch64)
run: cargo build --verbose --target thumbv7em-none-eabihf
- name: Run tests
run: cargo test --verbose

integration_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
cache-directories:
./test/target
- name: Install QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-i386

- name: Verify QEMU installation
run: qemu-system-i386 --version
- name: Build
run: cd test && make
- name: Run
run: cd test && make run

miri:
runs-on: "${{ matrix.runs-on }}"
needs:
# Logical dependency and wait for cache to be present
- build
strategy:
matrix:
runs-on:
- ubuntu-latest
rust:
- nightly
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- run: rustup component add miri
- run: cargo miri test --tests

style_checks:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets
- name: Rustdoc
run: cargo doc --no-deps --document-private-items
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/target
/Cargo.lock
17 changes: 17 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configuration for the typos spell checker utility (<https://github.com/crate-ci/typos>).

[files]
extend-exclude = [
"test/link.ld"
]

[default]
extend-ignore-identifiers-re = [

]

[default.extend-words]
THR = "THR"

[default.extend-identifiers]

16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 20 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
[package]
name = "uart_16550"
version = "0.4.0"
authors = ["Lachlan Sneff <lachlan.sneff@gmail.com>", "Philipp Oppermann <dev@phil-opp.com>"]
description = "Minimal support for uart_16550 serial output."
license = "MIT"
description = """
Simple yet highly configurable low-level driver for 16550 UART devices,
typically known and used as serial ports or COM ports. Easy integration into
Rust while providing fine-grained control where needed (e.g., for kernel
drivers).
"""
version = "0.1.0"
edition = "2024"
rust-version = "1.85.1"
keywords = ["uart-16550", "serial", "com", "driver", "tty"]
categories = ["embedded", "hardware-support", "no-std", "no-std::no-alloc"]
readme = "README.md"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/rust-osdev/uart_16550"
repository = "https://github.com/rust-osdev/uart_16550"
edition = "2018"

[dependencies]
bitflags = "2"
rustversion = "1.0.5"

[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
x86 = "0.52"

[features]
default = []
# TOOD: Remove these deprecated features on next breaking release
stable = []
nightly = []

[package.metadata.release]
pre-release-replacements = [
{ file="Changelog.md", search="# Unreleased", replace="# Unreleased\n\n# {{version}} – {{date}}", exactly=1 },
documentation = "https://docs.rs/uart_16550"
authors = [
"Philipp Schuster <phip1611@gmail.com>",
]
pre-release-commit-message = "Release version {{version}}"
resolver = "3"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
bitflags = { version = "2.10", default-features = false, features = [] }
Loading