Skip to content

Commit

Permalink
Merge pull request #75 from Neotron-Compute/release/v0.6.0
Browse files Browse the repository at this point in the history
Release/v0.6.0
  • Loading branch information
thejpster committed Oct 8, 2023
2 parents aa55271 + 95288ec commit 1ed1f70
Show file tree
Hide file tree
Showing 17 changed files with 586 additions and 356 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/rust.yml
Expand Up @@ -11,22 +11,40 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true

- name: Check Syntax
run: |
cargo check
- name: Test
run: |
cargo test --lib
- name: Install Targets and Tools
run: |
rustup target add thumbv7em-none-eabi
rustup target add thumbv7m-none-eabi
rustup target add thumbv6m-none-eabi
rustup component add llvm-tools-preview
cargo install cargo-binutils
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-binutils@0.3.6

- name: Build
run: |
./build.sh --verbose
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{success()}}
with:
name: Artifacts
if-no-files-found: error
path: |
./release/
- name: Upload files to Release
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
Expand Down
34 changes: 23 additions & 11 deletions CHANGELOG.md
Expand Up @@ -4,53 +4,65 @@

* None

## v0.5.0
## v0.6.0 (2023-10-08, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.6.0))

* Switch to neotron-common-bios 0.11
* Can set/set video mode
* Stores video mode as part of config
* Removed demo commands (they should be applications)
* Added raw PCM sound playback
* Added mixer command
* Switch to [`neotron-common-bios`] 0.11.1

## v0.5.0 (2023-07-21, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.5.0))

* Switch to [`neotron-common-bios`] 0.11
* Added "Shutdown" command
* Added ANSI decoder for colour changes (SGI) and cursor position support
* Added 'standard input' support for applications
* Use new compare-and-swap BIOS API to implement mutexes, instead of `static mut`
* OS now requires 256K Flash space

## v0.4.0
## v0.4.0 (2023-06-25, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.4.0))

* The `load` command now takes ELF binaries, not raw binaries.
* Neotron OS can now be used as a dependency within an application, if desired.

## v0.3.3
## v0.3.3 (2023-05-22, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.3.3))

* Add `dir` command
* Change `load` command to load from disk
* Repository includes `Cargo.lock` file
* Update to `postcard` 1.0
* Fix `readblk` help text, and print 32 bytes per line

## v0.3.2
## v0.3.2 (2023-05-05, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.3.2))

* Add `date` command.
* Add `lsblk` and `blkread` commands.
* Renamed `bioshw` to `lshw`

## v0.3.1
## v0.3.1 (2023-03-09, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.3.1))

* Add `hexdump`, `load` and `run` commands.
* Set colour attributes correctly (White on Black only currently)

## v0.3.0
## v0.3.0 (2023-02-12, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.3.0))

* Updated to Neotron Common BIOS v0.8.0
* Use pc-keyboard for decoding HID events
* Updated to [`neotron-common-bios`] v0.8.0
* Use [`pc-keyboard`] for decoding HID events
* Fix Windows library build
* Added 'kbtest' command
* Added 'lshw' command
* Added 'config' command
* Uses BIOS to store/load OS configuration

## v0.2.0
[`neotron-common-bios`]: https://crates.io/crates/neotron-common-bios
[`pc-keyboard`]: https://crates.io/crates/pc-keyboard

## v0.2.0 (2023-01-07, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.2.0))

Adds HID support and basic shell, with 'mem' and 'fill' commands.

## v0.1.0
## v0.1.0 (2022-03-18, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.1.0))

First version.
17 changes: 10 additions & 7 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "neotron-os"
version = "0.5.0"
version = "0.6.0"
authors = [
"Jonathan 'theJPster' Pallant <github@thejpster.org.uk>",
"The Neotron Developers"
Expand Down Expand Up @@ -41,7 +41,7 @@ panic = "abort"
panic = "abort"

[dependencies]
neotron-common-bios = "0.11"
neotron-common-bios = "0.11.1"
pc-keyboard = "0.7"
r0 = "1.0"
heapless = "0.7"
Expand All @@ -52,7 +52,7 @@ chrono = { version = "0.4", default-features = false }
embedded-sdmmc = { version = "0.5", default-features = false }
neotron-api = "0.1"
neotron-loader = "0.1"
vte = { git = "https://github.com/alacritty/vte", commit="94e74f3a64f42d5dad4e3d42dbe8c23291038214" }
vte = "0.12"

[features]
lib-mode = []
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -13,7 +13,7 @@ This OS is a work in progress. We intend to support:
* [x] Running built-in commands from a shell
* [x] Executing applications from RAM
* [x] Applications can print to stdout
* [ ] Applications can read from stdin
* [x] Applications can read from stdin
* [ ] Applications can open/close/read/write files
* [x] MBR/FAT32 formatted block devices
* [x] Read blocks
Expand All @@ -22,9 +22,9 @@ This OS is a work in progress. We intend to support:
* [ ] Delete files
* [ ] Change directory
* [x] Load ELF binaries from disk
* [ ] Changing text modes
* [x] Changing text modes
* [ ] Basic networking
* [ ] Music playback
* [x] Music playback
* [ ] Various keyboard layouts
* [ ] Ethernet / WiFi networking
* [ ] Built-in scripting language
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -13,7 +13,7 @@ for TARGET_ARCH in thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi; do
echo "BINARY is ${BINARY}"
cargo build $* --release --target=${TARGET_ARCH} --bin ${BINARY}
# objcopy would do the build for us first, but it doesn't have good build output
cargo objcopy $* --release --target=${TARGET_ARCH} --bin ${BINARY} -- -O binary ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.bin
rust-objcopy -O binary ./target/${TARGET_ARCH}/release/${BINARY} ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.bin
# Keep the ELF file too (for debugging)
cp ./target/${TARGET_ARCH}/release/${BINARY} ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.elf
done
Expand Down
34 changes: 25 additions & 9 deletions src/commands/config.rs
@@ -1,6 +1,6 @@
//! Configuration related commands for Neotron OS

use crate::{config, osprintln, Ctx};
use crate::{bios, config, osprintln, Ctx};

pub static COMMAND_ITEM: menu::Item<Ctx> = menu::Item {
item_type: menu::ItemType::Callback {
Expand Down Expand Up @@ -42,16 +42,25 @@ fn command(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, args: &[&str], ctx:
}
},
"vga" => match args.get(1).cloned() {
Some("on") => {
ctx.config.set_vga_console(true);
osprintln!("VGA now on");
}
Some("off") => {
ctx.config.set_vga_console(false);
ctx.config.set_vga_console(None);
osprintln!("VGA now off");
}
Some(mode_str) => {
let Some(mode) = mode_str
.parse::<u8>()
.ok()
.and_then(bios::video::Mode::try_from_u8)
.filter(|m| m.is_text_mode())
else {
osprintln!("Not a valid text mode");
return;
};
ctx.config.set_vga_console(Some(mode));
osprintln!("VGA set to mode {}", mode.as_u8());
}
_ => {
osprintln!("Give on or off as argument");
osprintln!("Give integer or off as argument");
}
},
"serial" => match (args.get(1).cloned(), args.get(1).map(|s| s.parse::<u32>())) {
Expand All @@ -68,7 +77,14 @@ fn command(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, args: &[&str], ctx:
}
},
"print" => {
osprintln!("VGA : {}", ctx.config.get_vga_console());
match ctx.config.get_vga_console() {
Some(m) => {
osprintln!("VGA : Mode {}", m.as_u8());
}
None => {
osprintln!("VGA : off");
}
};
match ctx.config.get_serial_console() {
None => {
osprintln!("Serial: off");
Expand All @@ -83,7 +99,7 @@ fn command(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, args: &[&str], ctx:
osprintln!("config help - print this help text");
osprintln!("config reset - load config from BIOS store");
osprintln!("config save - save config to BIOS store");
osprintln!("config vga on - turn VGA on");
osprintln!("config vga <n> - enable VGA in Mode <n>");
osprintln!("config vga off - turn VGA off");
osprintln!("config serial off - turn serial console off");
osprintln!("config serial <baud> - turn serial console on with given baud rate");
Expand Down
14 changes: 13 additions & 1 deletion src/commands/hardware.rs
Expand Up @@ -114,7 +114,19 @@ fn lshw(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, _args: &[&str], _ctx:
osprintln!("Audio Mixers:");
for dev_idx in 0..=255u8 {
if let bios::FfiOption::Some(device_info) = (api.audio_mixer_channel_get_info)(dev_idx) {
osprintln!(" {}: {:?}", dev_idx, device_info);
let dir = match device_info.direction {
bios::audio::Direction::Input => "In",
bios::audio::Direction::Output => "Out",
bios::audio::Direction::Loopback => "Loop",
};
osprintln!(
" {}: {:08} ({}) {}/{}",
dev_idx,
device_info.name,
dir,
device_info.current_level,
device_info.max_level
);
found = true;
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/commands/mod.rs
Expand Up @@ -11,6 +11,7 @@ mod hardware;
mod input;
mod ram;
mod screen;
mod sound;
mod timedate;

pub static OS_MENU: menu::Menu<Ctx> = menu::Menu {
Expand All @@ -26,12 +27,12 @@ pub static OS_MENU: menu::Menu<Ctx> = menu::Menu {
&ram::RUN_ITEM,
&ram::LOAD_ITEM,
&fs::LOAD_ITEM,
&screen::CLEAR_ITEM,
&screen::BENCH_ITEM,
&screen::FILL_ITEM,
&screen::MANDEL_ITEM,
&screen::CLS_ITEM,
&screen::MODE_ITEM,
&input::KBTEST_ITEM,
&hardware::SHUTDOWN_ITEM,
&sound::MIXER_ITEM,
&sound::PLAY_ITEM,
],
entry: None,
exit: None,
Expand Down

0 comments on commit 1ed1f70

Please sign in to comment.