Skip to content

Commit 4ad0f17

Browse files
committed
Improved README, added basic CI CD
1 parent 55e1f23 commit 4ad0f17

File tree

8 files changed

+93
-23
lines changed

8 files changed

+93
-23
lines changed

.github/workflows/ci.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 0 * * *' # Run nightly to catch regressions
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
RUST_BACKTRACE: 1
14+
15+
# TODO: Add Clippy and mock Funderberker testing
16+
17+
jobs:
18+
check:
19+
name: Check
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
crate: [macros, utils, kernel]
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
27+
- uses: Swatinem/rust-cache@v2
28+
with:
29+
key: crate-${{ matrix.crate }}
30+
- name: Check ${{ matrix.crate }}
31+
run: cargo +nightly check --manifest-path="${{ matrix.crate }}/Cargo.toml" --verbose
32+
33+
unit_tests:
34+
name: Unit Test Individual Crates
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
crate: [macros, utils]
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: dtolnay/rust-toolchain@stable
42+
- uses: Swatinem/rust-cache@v2
43+
with:
44+
key: crate-${{ matrix.crate }}
45+
- name: Test ${{ matrix.crate }}
46+
run: cargo +nightly test --manifest-path="${{ matrix.crate }}/Cargo.toml" --verbose
47+
48+
docs:
49+
name: Documentation
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: dtolnay/rust-toolchain@stable
54+
- uses: Swatinem/rust-cache@v2
55+
- name: Build docs
56+
run: cargo +nightly doc --manifest-path=kernel/Cargo.toml --no-deps --all-features
57+
- name: Deploy to GitHub Pages
58+
if: github.ref == 'refs/heads/main'
59+
uses: peaceiris/actions-gh-pages@v3
60+
with:
61+
github_token: ${{ secrets.GITHUB_TOKEN }}
62+
publish_dir: ./target/doc

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2+
<p align="center">
3+
<img src="./logo-no-bg.png" alt="jason" />
4+
</p>
5+
6+
[![GitHub stars](https://img.shields.io/github/stars/roeegg2/funderberker.svg)](https://github.com/roeegg2/funderberker/stargazers)
7+
[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
8+
[![CI Status](https://img.shields.io/github/actions/workflow/status/roeegg2/funderberker/ci.yml?cacheSeconds=0)](https://github.com/roeegg2/funderberker/actions/workflows/ci.yml)
9+
10+
111
# Funderberker
212

313
Funderberker is a WIP type 1 VMM written in Rust, with a focus on customizability and performance.
@@ -25,3 +35,4 @@ just help
2535
Contributions are more than welcome!
2636

2737
Funderberker is still in its infancy, so there are many things to do.
38+

kernel/src/dev/timer/hpet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub enum InterruptRoutingMode {
3535

3636
/// The delivery mode a specific timer will use
3737
#[allow(dead_code)]
38-
#[derive(Debug, Clone, Copy, PartialEq)]
38+
#[derive(Debug, Clone, Copy)]
3939
pub enum DeliveryMode {
4040
/// The timer will issue interrupts as specified by `InterruptRoutingMode`.
4141
///

kernel/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
#![no_std]
22
#![no_main]
33
#![feature(let_chains)]
4-
#![feature(nonnull_provenance)]
54
#![feature(allocator_api)]
65
#![feature(pointer_is_aligned_to)]
76
#![feature(box_vec_non_null)]
8-
#![feature(non_null_from_ref)]
97
#![feature(custom_test_frameworks)]
108
#![feature(ptr_as_ref_unchecked)]
119
#![test_runner(crate::test::test_runner)]
1210
#![reexport_test_harness_main = "test_main"]
1311
#![feature(stmt_expr_attributes)]
1412
#![feature(sync_unsafe_cell)]
15-
#![feature(naked_functions)]
1613
#![feature(concat_idents)]
1714
// TODO: Remove these after code is stable!!!
1815
#![allow(clippy::cast_possible_truncation)]

kernel/src/sync/spinlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ where
5353

5454
/// Spin until you can lock the spinlock, then lock it
5555
#[inline]
56-
pub fn lock(&self) -> SpinLockGuard<T> {
56+
pub fn lock(&self) -> SpinLockGuard<'_, T> {
5757
spin_until!(!self.lock.swap(true, Ordering::Acquire));
5858

5959
SpinLockGuard {

logo-no-bg.png

192 KB
Loading

macros/src/lib.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(naked_functions)]
2-
31
use proc_macro::TokenStream;
42
use quote::quote;
53
use syn::{parse_macro_input, ItemFn};
@@ -62,31 +60,33 @@ pub fn isr(_attr: TokenStream, item: TokenStream) -> TokenStream {
6260
let fn_vis = &input_fn.vis;
6361
let fn_args = &input_fn.sig.inputs;
6462
let fn_body = &input_fn.block;
65-
63+
6664
// Generate the wrapper function name
6765
let wrapper_name = syn::Ident::new(&format!("__isr_stub_{}", fn_name), fn_name.span());
68-
66+
6967
// Generate the macro output
7068
let expanded = quote! {
7169
// The original ISR function (renamed internally)
7270
#fn_vis fn #fn_name(#fn_args) {
7371
#fn_body
7472
}
75-
73+
7674
// The naked wrapper function with ISR assembly
77-
#[naked]
75+
#[unsafe(naked)]
7876
#[unsafe(no_mangle)]
7977
#fn_vis unsafe extern "C" fn #wrapper_name() {
80-
core::arch::naked_asm!(
81-
// Call the actual ISR
82-
"call {}",
83-
// Return from interrupt
84-
"iretq",
85-
sym #fn_name,
86-
);
78+
unsafe {
79+
core::arch::naked_asm!(
80+
// Call the actual ISR
81+
"call {}",
82+
// Return from interrupt
83+
"iretq",
84+
sym #fn_name,
85+
);
86+
}
8787
}
8888
};
89-
89+
9090
TokenStream::from(expanded)
9191
}
9292

utils/src/collections/stacklist.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl<T> StackList<T> {
171171
}
172172

173173
#[inline]
174-
pub fn iter_node(&self) -> IterNode<T> {
174+
pub fn iter_node(&self) -> IterNode<'_, T> {
175175
IterNode {
176176
head: self.head,
177177
len: self.len,
@@ -180,7 +180,7 @@ impl<T> StackList<T> {
180180
}
181181

182182
#[inline]
183-
pub fn iter_node_mut(&mut self) -> IterNodeMut<T> {
183+
pub fn iter_node_mut(&mut self) -> IterNodeMut<'_, T> {
184184
IterNodeMut {
185185
head: self.head,
186186
len: self.len,
@@ -189,7 +189,7 @@ impl<T> StackList<T> {
189189
}
190190

191191
#[inline]
192-
pub fn iter(&self) -> Iter<T> {
192+
pub fn iter(&self) -> Iter<'_, T> {
193193
Iter {
194194
head: self.head,
195195
len: self.len,
@@ -198,7 +198,7 @@ impl<T> StackList<T> {
198198
}
199199

200200
#[inline]
201-
pub fn iter_mut(&mut self) -> IterMut<T> {
201+
pub fn iter_mut(&mut self) -> IterMut<'_, T> {
202202
IterMut {
203203
head: self.head,
204204
len: self.len,

0 commit comments

Comments
 (0)