Skip to content

Commit 1ed1f70

Browse files
authored
Merge pull request #75 from Neotron-Compute/release/v0.6.0
Release/v0.6.0
2 parents aa55271 + 95288ec commit 1ed1f70

File tree

17 files changed

+586
-356
lines changed

17 files changed

+586
-356
lines changed

.github/workflows/rust.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,40 @@ jobs:
1111
uses: actions/checkout@v3
1212
with:
1313
submodules: true
14+
1415
- name: Check Syntax
1516
run: |
1617
cargo check
18+
1719
- name: Test
1820
run: |
1921
cargo test --lib
22+
2023
- name: Install Targets and Tools
2124
run: |
2225
rustup target add thumbv7em-none-eabi
2326
rustup target add thumbv7m-none-eabi
2427
rustup target add thumbv6m-none-eabi
2528
rustup component add llvm-tools-preview
26-
cargo install cargo-binutils
29+
30+
- name: Install tools
31+
uses: taiki-e/install-action@v2
32+
with:
33+
tool: cargo-binutils@0.3.6
34+
2735
- name: Build
2836
run: |
2937
./build.sh --verbose
38+
39+
- name: Upload Artifacts
40+
uses: actions/upload-artifact@v3
41+
if: ${{success()}}
42+
with:
43+
name: Artifacts
44+
if-no-files-found: error
45+
path: |
46+
./release/
47+
3048
- name: Upload files to Release
3149
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
3250
uses: softprops/action-gh-release@v1

CHANGELOG.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,65 @@
44

55
* None
66

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

9-
* Switch to neotron-common-bios 0.11
9+
* Can set/set video mode
10+
* Stores video mode as part of config
11+
* Removed demo commands (they should be applications)
12+
* Added raw PCM sound playback
13+
* Added mixer command
14+
* Switch to [`neotron-common-bios`] 0.11.1
15+
16+
## v0.5.0 (2023-07-21, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.5.0))
17+
18+
* Switch to [`neotron-common-bios`] 0.11
1019
* Added "Shutdown" command
1120
* Added ANSI decoder for colour changes (SGI) and cursor position support
1221
* Added 'standard input' support for applications
1322
* Use new compare-and-swap BIOS API to implement mutexes, instead of `static mut`
1423
* OS now requires 256K Flash space
1524

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

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

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

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

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

3140
* Add `date` command.
3241
* Add `lsblk` and `blkread` commands.
3342
* Renamed `bioshw` to `lshw`
3443

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

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

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

42-
* Updated to Neotron Common BIOS v0.8.0
43-
* Use pc-keyboard for decoding HID events
51+
* Updated to [`neotron-common-bios`] v0.8.0
52+
* Use [`pc-keyboard`] for decoding HID events
4453
* Fix Windows library build
4554
* Added 'kbtest' command
4655
* Added 'lshw' command
4756
* Added 'config' command
4857
* Uses BIOS to store/load OS configuration
4958

50-
## v0.2.0
59+
[`neotron-common-bios`]: https://crates.io/crates/neotron-common-bios
60+
[`pc-keyboard`]: https://crates.io/crates/pc-keyboard
61+
62+
## v0.2.0 (2023-01-07, [Github Release](https://github.com/neotron-compute/neotron-os/releases/tag/v0.2.0))
5163

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

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

5668
First version.

Cargo.lock

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neotron-os"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = [
55
"Jonathan 'theJPster' Pallant <github@thejpster.org.uk>",
66
"The Neotron Developers"
@@ -41,7 +41,7 @@ panic = "abort"
4141
panic = "abort"
4242

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

5757
[features]
5858
lib-mode = []

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This OS is a work in progress. We intend to support:
1313
* [x] Running built-in commands from a shell
1414
* [x] Executing applications from RAM
1515
* [x] Applications can print to stdout
16-
* [ ] Applications can read from stdin
16+
* [x] Applications can read from stdin
1717
* [ ] Applications can open/close/read/write files
1818
* [x] MBR/FAT32 formatted block devices
1919
* [x] Read blocks
@@ -22,9 +22,9 @@ This OS is a work in progress. We intend to support:
2222
* [ ] Delete files
2323
* [ ] Change directory
2424
* [x] Load ELF binaries from disk
25-
* [ ] Changing text modes
25+
* [x] Changing text modes
2626
* [ ] Basic networking
27-
* [ ] Music playback
27+
* [x] Music playback
2828
* [ ] Various keyboard layouts
2929
* [ ] Ethernet / WiFi networking
3030
* [ ] Built-in scripting language

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ for TARGET_ARCH in thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi; do
1313
echo "BINARY is ${BINARY}"
1414
cargo build $* --release --target=${TARGET_ARCH} --bin ${BINARY}
1515
# objcopy would do the build for us first, but it doesn't have good build output
16-
cargo objcopy $* --release --target=${TARGET_ARCH} --bin ${BINARY} -- -O binary ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.bin
16+
rust-objcopy -O binary ./target/${TARGET_ARCH}/release/${BINARY} ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.bin
1717
# Keep the ELF file too (for debugging)
1818
cp ./target/${TARGET_ARCH}/release/${BINARY} ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.elf
1919
done

src/commands/config.rs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Configuration related commands for Neotron OS
22
3-
use crate::{config, osprintln, Ctx};
3+
use crate::{bios, config, osprintln, Ctx};
44

55
pub static COMMAND_ITEM: menu::Item<Ctx> = menu::Item {
66
item_type: menu::ItemType::Callback {
@@ -42,16 +42,25 @@ fn command(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, args: &[&str], ctx:
4242
}
4343
},
4444
"vga" => match args.get(1).cloned() {
45-
Some("on") => {
46-
ctx.config.set_vga_console(true);
47-
osprintln!("VGA now on");
48-
}
4945
Some("off") => {
50-
ctx.config.set_vga_console(false);
46+
ctx.config.set_vga_console(None);
5147
osprintln!("VGA now off");
5248
}
49+
Some(mode_str) => {
50+
let Some(mode) = mode_str
51+
.parse::<u8>()
52+
.ok()
53+
.and_then(bios::video::Mode::try_from_u8)
54+
.filter(|m| m.is_text_mode())
55+
else {
56+
osprintln!("Not a valid text mode");
57+
return;
58+
};
59+
ctx.config.set_vga_console(Some(mode));
60+
osprintln!("VGA set to mode {}", mode.as_u8());
61+
}
5362
_ => {
54-
osprintln!("Give on or off as argument");
63+
osprintln!("Give integer or off as argument");
5564
}
5665
},
5766
"serial" => match (args.get(1).cloned(), args.get(1).map(|s| s.parse::<u32>())) {
@@ -68,7 +77,14 @@ fn command(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, args: &[&str], ctx:
6877
}
6978
},
7079
"print" => {
71-
osprintln!("VGA : {}", ctx.config.get_vga_console());
80+
match ctx.config.get_vga_console() {
81+
Some(m) => {
82+
osprintln!("VGA : Mode {}", m.as_u8());
83+
}
84+
None => {
85+
osprintln!("VGA : off");
86+
}
87+
};
7288
match ctx.config.get_serial_console() {
7389
None => {
7490
osprintln!("Serial: off");
@@ -83,7 +99,7 @@ fn command(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, args: &[&str], ctx:
8399
osprintln!("config help - print this help text");
84100
osprintln!("config reset - load config from BIOS store");
85101
osprintln!("config save - save config to BIOS store");
86-
osprintln!("config vga on - turn VGA on");
102+
osprintln!("config vga <n> - enable VGA in Mode <n>");
87103
osprintln!("config vga off - turn VGA off");
88104
osprintln!("config serial off - turn serial console off");
89105
osprintln!("config serial <baud> - turn serial console on with given baud rate");

src/commands/hardware.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,19 @@ fn lshw(_menu: &menu::Menu<Ctx>, _item: &menu::Item<Ctx>, _args: &[&str], _ctx:
114114
osprintln!("Audio Mixers:");
115115
for dev_idx in 0..=255u8 {
116116
if let bios::FfiOption::Some(device_info) = (api.audio_mixer_channel_get_info)(dev_idx) {
117-
osprintln!(" {}: {:?}", dev_idx, device_info);
117+
let dir = match device_info.direction {
118+
bios::audio::Direction::Input => "In",
119+
bios::audio::Direction::Output => "Out",
120+
bios::audio::Direction::Loopback => "Loop",
121+
};
122+
osprintln!(
123+
" {}: {:08} ({}) {}/{}",
124+
dev_idx,
125+
device_info.name,
126+
dir,
127+
device_info.current_level,
128+
device_info.max_level
129+
);
118130
found = true;
119131
}
120132
}

src/commands/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mod hardware;
1111
mod input;
1212
mod ram;
1313
mod screen;
14+
mod sound;
1415
mod timedate;
1516

1617
pub static OS_MENU: menu::Menu<Ctx> = menu::Menu {
@@ -26,12 +27,12 @@ pub static OS_MENU: menu::Menu<Ctx> = menu::Menu {
2627
&ram::RUN_ITEM,
2728
&ram::LOAD_ITEM,
2829
&fs::LOAD_ITEM,
29-
&screen::CLEAR_ITEM,
30-
&screen::BENCH_ITEM,
31-
&screen::FILL_ITEM,
32-
&screen::MANDEL_ITEM,
30+
&screen::CLS_ITEM,
31+
&screen::MODE_ITEM,
3332
&input::KBTEST_ITEM,
3433
&hardware::SHUTDOWN_ITEM,
34+
&sound::MIXER_ITEM,
35+
&sound::PLAY_ITEM,
3536
],
3637
entry: None,
3738
exit: None,

0 commit comments

Comments
 (0)