Skip to content

Commit c58c519

Browse files
committed
Merge branch 'release/v0.5.0'
2 parents 34cd155 + 03527d6 commit c58c519

File tree

8 files changed

+850
-78
lines changed

8 files changed

+850
-78
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neotron-common-bios"
3-
version = "0.1.0"
3+
version = "0.5.0"
44
authors = ["Jonathan 'theJPster' Pallant <[email protected]>"]
55
edition = "2018"
66
description = "Common BIOS code and API for all Neotron systems."

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,31 @@ This BIOS API crate is a work in progress.
3636
Unless you explicitly state otherwise, any contribution intentionally submitted
3737
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
3838
dual licensed as above, without any additional terms or conditions.
39+
40+
## Changelog
41+
42+
### Unreleased Changes
43+
44+
* None
45+
46+
### v0.5.0
47+
48+
* Added `serial_read` API
49+
* Added `video_mode_needs_vram` API
50+
* Added `hid_get_event` API
51+
* Added `hid_set_leds` API
52+
* Added `video_wait_for_line` API
53+
* Added `block_dev_get_info` API
54+
* Added `block_write` API
55+
* Added `block_read` API
56+
* Added `block_verify` API
57+
58+
### v0.4.0
59+
60+
* Changed `memory_get_region` to return a `MemoryRegion`
61+
* Changed `video_set_framebuffer` to take a `*const u8` not `*mut u8` - as the
62+
BIOS doesn't change video RAM.
63+
64+
### v0.3.0
65+
66+
* First published version. `Cargo.toml` reports at `0.1.0`.

src/block_dev.rs

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//! # Block Devices
2+
//!
3+
//! Block Device related types.
4+
//!
5+
//! Note that all types in this file *must* be `#[repr(C)]` and ABI stable.
6+
7+
// Copyright (C) The Neotron Developers, 2019-2022
8+
//
9+
// This program is free software: you can redistribute it and/or modify
10+
// it under the terms of the GNU General Public License as published by
11+
// the Free Software Foundation, either version 3 of the License, or
12+
// at your option) any later version.
13+
//
14+
// This program is distributed in the hope that it will be useful,
15+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
// GNU General Public License for more details.
18+
//
19+
// You should have received a copy of the GNU General Public License
20+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
22+
// ============================================================================
23+
// Imports
24+
// ============================================================================
25+
26+
// None
27+
28+
// ============================================================================
29+
// Constants
30+
// ============================================================================
31+
32+
// None
33+
34+
// ============================================================================
35+
// Types
36+
// ============================================================================
37+
38+
/// The types of block device we support.
39+
#[repr(C)]
40+
#[derive(Clone, PartialEq, Eq, Debug)]
41+
pub enum DeviceType {
42+
/// An *SD* Card
43+
SecureDigitalCard,
44+
/// A Hard Drive
45+
HardDiskDrive,
46+
/// A floppy disk in a floppy disk drive
47+
FloppyDiskDrive,
48+
/// A compact flash card
49+
CompactFlashCard,
50+
}
51+
52+
/// Information about a block device.
53+
#[repr(C)]
54+
#[derive(Clone, PartialEq, Eq, Debug)]
55+
pub struct DeviceInfo {
56+
/// Some human-readable name for this serial device (e.g. `SdCard0` or
57+
/// `CF1`)
58+
pub name: crate::ApiString<'static>,
59+
/// The kind of block device this is.
60+
pub device_type: DeviceType,
61+
/// The size of an addressable block, in bytes.
62+
pub block_size: u32,
63+
/// The total number of addressable blocks.
64+
pub num_blocks: u64,
65+
/// Can this device be ejected?
66+
pub ejectable: bool,
67+
/// Can this device be removed?
68+
pub removable: bool,
69+
/// Does this have media in it right now?
70+
pub media_present: bool,
71+
/// Is this media read-only?
72+
pub read_only: bool,
73+
}
74+
75+
// ============================================================================
76+
// Impls
77+
// ============================================================================
78+
79+
// None
80+
81+
// ============================================================================
82+
// End of File
83+
// ============================================================================

0 commit comments

Comments
 (0)