Skip to content

Commit

Permalink
Splits panic handler and console into krt (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Jan 11, 2025
1 parent e4852da commit 1d2a3ee
Show file tree
Hide file tree
Showing 159 changed files with 142 additions and 925 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build
run: ./build.py -r
- name: Run tests
run: cargo test --workspace --exclude gui --exclude kernel
run: cargo test
- name: Create distribution tarball
run: |
ln -sr dist/bin/obliteration dist/obliteration
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Build
run: ./build.py -r
- name: Run tests
run: cargo test --workspace --exclude gui --exclude kernel
run: cargo test
- name: Create Apple Disk Image
run: hdiutil create -volname Obliteration -srcfolder dist Obliteration.dmg
- name: Upload artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Build
run: python3 build.py -r
- name: Run tests
run: cargo test --workspace --exclude gui --exclude kernel
run: cargo test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
7 changes: 0 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
"[toml]": {
"editor.formatOnSave": true
},
"clangd.arguments": [
"--header-insertion=never"
],
"cmake.configureOnOpen": true,
"cmake.debugConfig": {
"cwd": "${workspaceFolder}"
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
Expand Down
88 changes: 23 additions & 65 deletions Cargo.lock

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

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ resolver = "2"
members = [
"arch/aarch64",
"arch/x86-64",
"config",
"gui",
"kernel",
"lib/krt",
"macros",
"src/fs",
"src/llt",
"src/obconf",
"src/tls",
]

[profile.dev]
Expand Down
2 changes: 1 addition & 1 deletion src/obconf/Cargo.toml → config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "obconf"
name = "config"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ bitfield-struct = "0.9.2"
bytes = "1.9.0"
ciborium = "0.2.2"
clap = { version = "4.5.21", features = ["derive"] }
config = { path = "../config", features = ["serde", "virt"] }
erdp = "0.1.1"
futures = "0.3.31"
gdbstub = "0.7.3"
Expand All @@ -22,7 +23,6 @@ humansize = "2.1.3"
i-slint-core = "=1.9.0"
libc = "0.2.164"
num_enum = "0.7.3"
obconf = { path = "../src/obconf", features = ["serde", "virt"] }
obfw = { git = "https://github.com/obhq/firmware-dumper.git", rev = "64787fdc0489724f0914356d925be014a2f1bf3e", features = [
"read",
] }
Expand Down
2 changes: 1 addition & 1 deletion gui/src/log/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use self::file::LogFile;
use anstyle_parse::Parser;
use obconf::ConsoleType;
use config::ConsoleType;
use std::fs::File;
use std::io::{stderr, stdout, Write};
use std::path::{Path, PathBuf};
Expand Down
2 changes: 1 addition & 1 deletion gui/src/profile/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use obconf::Config;
use config::Config;
use serde::{Deserialize, Serialize};
use std::fmt::{Display, Formatter};
use std::fs::File;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/vmm/hw/console/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use super::Console;
use crate::hv::{Cpu, CpuExit, CpuIo, Hypervisor};
use crate::vmm::channel::VmmStream;
use crate::vmm::hw::{read_ptr, read_u8, read_usize, DeviceContext, MmioError};
use obconf::{ConsoleMemory, ConsoleType};
use config::{ConsoleMemory, ConsoleType};
use std::error::Error;
use std::mem::offset_of;
use std::num::NonZero;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/vmm/hw/console/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use self::context::Context;
use super::{Device, DeviceContext};
use crate::hv::Hypervisor;
use crate::vmm::channel::VmmStream;
use obconf::{ConsoleMemory, ConsoleType};
use config::{ConsoleMemory, ConsoleType};
use std::num::NonZero;

mod context;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/vmm/hw/vmm/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use super::Vmm;
use crate::hv::{Cpu, CpuExit, CpuIo};
use crate::vmm::hw::{read_u8, DeviceContext, MmioError};
use obconf::{KernelExit, VmmMemory};
use config::{KernelExit, VmmMemory};
use std::error::Error;
use std::mem::offset_of;
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/vmm/hw/vmm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use self::context::Context;
use super::{Device, DeviceContext};
use crate::hv::Cpu;
use obconf::VmmMemory;
use config::VmmMemory;
use std::num::NonZero;

mod context;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/vmm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use self::ram::{RamBuilder, RamMap};
use crate::gdb::DebugClient;
use crate::hv::{CpuDebug, CpuExit, CpuIo, CpuRun, CpuStates, Hypervisor, Ram};
use crate::profile::Profile;
use config::{BootEnv, ConsoleType, Vm};
use futures::{select_biased, FutureExt};
use gdbstub::common::{Signal, Tid};
use gdbstub::stub::MultiThreadStopReason;
Expand All @@ -19,7 +20,6 @@ use gdbstub::target::ext::base::multithread::{
use gdbstub::target::ext::thread_extra_info::{ThreadExtraInfo, ThreadExtraInfoOps};
use gdbstub::target::{TargetError, TargetResult};
use kernel::{KernelError, ProgramHeaderError};
use obconf::{BootEnv, ConsoleType, Vm};
use rustc_hash::FxHashMap;
use std::cmp::max;
use std::collections::{BTreeMap, HashMap};
Expand Down
2 changes: 1 addition & 1 deletion gui/src/vmm/ram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use super::Ram;
use crate::hv::{CpuFeats, RamError, RamMapper};
use crate::vmm::hw::DeviceTree;
use crate::vmm::kernel::ProgramHeader;
use obconf::{BootEnv, Config};
use config::{BootEnv, Config};
use std::num::NonZero;
use std::ops::Range;
use thiserror::Error;
Expand Down
4 changes: 2 additions & 2 deletions kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version = "0.1.0"
edition = "2021"

[dependencies]
anstyle = { version = "1.0.8", default-features = false }
bitfield-struct = "0.9.2"
config = { path = "../config" }
hashbrown = "0.14.5"
krt = { path = "../lib/krt" }
macros = { path = "../macros" }
obconf = { path = "../src/obconf", features = ["virt"] }
talc = { version = "4.4.1", default-features = false }

[target.'cfg(target_arch = "x86_64")'.dependencies]
Expand Down
Loading

0 comments on commit 1d2a3ee

Please sign in to comment.