From 55b836b9f6c7359a3a319eeaffd08c01770e09db Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 1 May 2024 12:41:06 +0200 Subject: [PATCH 1/6] cargo: updated all dependencies --- Cargo.lock | 12 +-- Cargo.toml | 6 +- integration-test/bins/Cargo.lock | 74 ++++++++++++------- integration-test/bins/Cargo.toml | 10 ++- .../bins/multiboot2_chainloader/Cargo.toml | 16 ++-- .../bins/multiboot2_payload/Cargo.toml | 12 +-- multiboot2-header/Cargo.toml | 6 -- multiboot2/Cargo.toml | 4 +- 8 files changed, 82 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b02ea0fc..9ae63624 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -75,9 +75,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "uefi-raw" -version = "0.3.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62642516099c6441a5f41b0da8486d5fc3515a0603b0fdaea67b31600e22082e" +checksum = "efa8716f52e8cab8bcedfd5052388a0f263b69fe5cc2561548dc6a530678333c" dependencies = [ "bitflags", "ptr_meta", diff --git a/Cargo.toml b/Cargo.toml index 3b6f2682..f4e5b0ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,9 @@ exclude = [ ] [workspace.dependencies] -bitflags = "2" -derive_more = { version = "0.99", default-features = false, features = ["display"] } -log = { version = "0.4", default-features = false } +bitflags = "2.0.2" +derive_more = { version = "~0.99", default-features = false, features = ["display"] } +log = { version = "~0.4", default-features = false } # This way, the "multiboot2" dependency in the multiboot2-header crate can be # referenced by version, while still the repository version is used diff --git a/integration-test/bins/Cargo.lock b/integration-test/bins/Cargo.lock index b0837598..e55bdca7 100644 --- a/integration-test/bins/Cargo.lock +++ b/integration-test/bins/Cargo.lock @@ -4,15 +4,15 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "bit_field" @@ -28,9 +28,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "derive_more" @@ -45,9 +45,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elf_rs" @@ -55,7 +55,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "894d710b6b07dae25ce69f9227ec2ffa3a3f71dc7f071acea3e1928ab4aeafdf" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "num-traits", ] @@ -71,9 +71,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "multiboot" @@ -98,11 +98,24 @@ dependencies = [ name = "multiboot2" version = "0.19.0" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "derive_more", "log", "ptr_meta", - "uefi-raw", + "uefi-raw 0.5.2", +] + +[[package]] +name = "multiboot2" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be7a13d71fc2f7747af3ce60e5eccb638acd687b3a580d0bd579c6d0f7b9d010" +dependencies = [ + "bitflags 2.5.0", + "derive_more", + "log", + "ptr_meta", + "uefi-raw 0.3.0", ] [[package]] @@ -110,7 +123,7 @@ name = "multiboot2-header" version = "0.3.2" dependencies = [ "derive_more", - "multiboot2", + "multiboot2 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -122,7 +135,7 @@ dependencies = [ "good_memory_allocator", "log", "multiboot", - "multiboot2", + "multiboot2 0.19.0", "multiboot2-header", "util", ] @@ -134,16 +147,16 @@ dependencies = [ "anyhow", "good_memory_allocator", "log", - "multiboot2", + "multiboot2 0.19.0", "util", "x86", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -156,9 +169,9 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -191,9 +204,9 @@ checksum = "8bb0fd6580eeed0103c054e3fba2c2618ff476943762f28a645b63b8692b21c9" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -239,7 +252,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62642516099c6441a5f41b0da8486d5fc3515a0603b0fdaea67b31600e22082e" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", + "ptr_meta", + "uguid", +] + +[[package]] +name = "uefi-raw" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efa8716f52e8cab8bcedfd5052388a0f263b69fe5cc2561548dc6a530678333c" +dependencies = [ + "bitflags 2.5.0", "ptr_meta", "uguid", ] diff --git a/integration-test/bins/Cargo.toml b/integration-test/bins/Cargo.toml index 9c58b106..ddd6e60e 100644 --- a/integration-test/bins/Cargo.toml +++ b/integration-test/bins/Cargo.toml @@ -10,5 +10,11 @@ members = [ codegen-units = 1 lto = true -[patch.crates-io] -multiboot2 = { path = "../../multiboot2" } + +[workspace.dependencies] +anyhow = { version = "1.0", default-features = false } +log = { version = "0.4", default-features = false } +multiboot2 = { path = "../../multiboot2", features = ["builder", "unstable"] } +multiboot2-header = { path = "../../multiboot2-header", features = ["builder", "unstable"] } +good_memory_allocator = "0.1" +util = { path = "./util" } diff --git a/integration-test/bins/multiboot2_chainloader/Cargo.toml b/integration-test/bins/multiboot2_chainloader/Cargo.toml index dd5f2205..e3089f53 100644 --- a/integration-test/bins/multiboot2_chainloader/Cargo.toml +++ b/integration-test/bins/multiboot2_chainloader/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "multiboot2_chainloader" -description = "Multiboot chainloader that loads a Multiboot2 payload" +description = "Integrationtest: Multiboot2 chainloader" version = "0.1.0" edition = "2021" publish = false [dependencies] -util = { path = "../util" } -multiboot2 = { path = "../../../multiboot2" } -multiboot2-header = { path = "../../../multiboot2-header" } -anyhow = { version = "1.0", default-features = false } -elf_rs = "0.3" -log = { version = "0.4", default-features = false } -good_memory_allocator = "0.1" +anyhow.workspace = true +log.workspace = true +good_memory_allocator.workspace = true multiboot = "0.8" +multiboot2.workspace = true +multiboot2-header.workspace = true +util.workspace = true +elf_rs = "0.3" diff --git a/integration-test/bins/multiboot2_payload/Cargo.toml b/integration-test/bins/multiboot2_payload/Cargo.toml index e350a6d0..46946abf 100644 --- a/integration-test/bins/multiboot2_payload/Cargo.toml +++ b/integration-test/bins/multiboot2_payload/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "multiboot2_payload" -description = "Multiboot2 integration test" +description = "Integrationtest: Multiboot2 payload" version = "0.1.0" edition = "2021" publish = false [dependencies] -multiboot2 = { path = "../../../multiboot2", features = ["builder", "unstable"] } -util = { path = "../util" } -anyhow = { version = "1.0", default-features = false } -good_memory_allocator = "0.1" -log = { version = "0.4", default-features = false } +anyhow.workspace = true +log.workspace = true +good_memory_allocator.workspace = true +multiboot2.workspace = true +util.workspace = true x86 = "0.52" diff --git a/multiboot2-header/Cargo.toml b/multiboot2-header/Cargo.toml index 30a4b77c..a3ef4da5 100644 --- a/multiboot2-header/Cargo.toml +++ b/multiboot2-header/Cargo.toml @@ -40,13 +40,7 @@ builder = ["alloc"] unstable = [] [dependencies] -# Not yet used. -# bitflags.workspace = true derive_more.workspace = true -# Not yet used. -# log.workspace = true - -# Used for MBI tags. multiboot2 = { version = "0.19.0", default-features = false } [package.metadata.docs.rs] diff --git a/multiboot2/Cargo.toml b/multiboot2/Cargo.toml index 5305cd61..bf190e9c 100644 --- a/multiboot2/Cargo.toml +++ b/multiboot2/Cargo.toml @@ -49,8 +49,8 @@ log.workspace = true # bumps from uefi-raw, I restrict this here. Upstream users are likely to have # two versions of this library in it, which is no problem, as we only use the # type definition. -uefi-raw = { version = "=0.3", default-features = false } -ptr_meta = { version = "0.2", default-features = false } +uefi-raw = { version = "~0.5", default-features = false } +ptr_meta = { version = "~0.2", default-features = false } [package.metadata.docs.rs] all-features = true From 90ec7578cc3d5ebd7043c912682cd8beaaa0aef3 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 1 May 2024 15:03:18 +0200 Subject: [PATCH 2/6] multiboot2-header: update changelog + integration test --- .../bins/multiboot2_chainloader/src/loader.rs | 10 ++++++++-- multiboot2-header/Changelog.md | 1 + multiboot2/src/builder/boxed_dst.rs | 12 ++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/integration-test/bins/multiboot2_chainloader/src/loader.rs b/integration-test/bins/multiboot2_chainloader/src/loader.rs index fa613b85..896cf2af 100644 --- a/integration-test/bins/multiboot2_chainloader/src/loader.rs +++ b/integration-test/bins/multiboot2_chainloader/src/loader.rs @@ -1,7 +1,8 @@ +use core::ops::Deref; use elf_rs::{ElfFile, ProgramHeaderEntry, ProgramType}; use multiboot2::{ - BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag, - ModuleTag, + BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag, ModuleTag, + SmbiosTag, }; /// Loads the first module into memory. Assumes that the module is a ELF file. @@ -56,6 +57,11 @@ pub fn load_module(mut modules: multiboot::information::ModuleIter) -> ! { elf_mod.end as u32, elf_mod.string.unwrap(), )) + // Test that we can add SmbiosTag multiple times. + .add_tag(SmbiosTag::new(1, 1, &[1, 2, 3]).deref()) + .unwrap() + .add_tag(SmbiosTag::new(1, 2, &[1, 2, 3]).deref()) + .expect("should allow tag multiple times") .build(); log::info!( diff --git a/multiboot2-header/Changelog.md b/multiboot2-header/Changelog.md index 91d5bc18..dfda0207 100644 --- a/multiboot2-header/Changelog.md +++ b/multiboot2-header/Changelog.md @@ -4,6 +4,7 @@ - added `EndHeaderTag::default()` - MSRV is 1.69 +- Can add multiple `TagType::Smbios` tags in the builder. ## 0.3.2 (2023-11-30) diff --git a/multiboot2/src/builder/boxed_dst.rs b/multiboot2/src/builder/boxed_dst.rs index 9106457f..71d061c1 100644 --- a/multiboot2/src/builder/boxed_dst.rs +++ b/multiboot2/src/builder/boxed_dst.rs @@ -141,4 +141,16 @@ mod tests { assert_eq!(tag.size as usize, METADATA_SIZE + content.len()); assert_eq!(tag.string(), Ok(content_rust_str)); } + + #[test] + fn can_hold_tag_trait() { + fn consume(_: &T) {} + let content = b"hallo\0"; + + let tag = BoxedDst::::new(content); + consume(tag.deref()); + consume(&*tag); + // Compiler not smart enough? + // consume(&tag); + } } From 60411207cb21491b987e55ebe325760391e8c9f5 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 1 May 2024 15:18:34 +0200 Subject: [PATCH 3/6] typos --- multiboot2/src/builder/boxed_dst.rs | 2 +- multiboot2/src/builder/mod.rs | 2 +- multiboot2/src/tag_trait.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/multiboot2/src/builder/boxed_dst.rs b/multiboot2/src/builder/boxed_dst.rs index 71d061c1..bafb8df3 100644 --- a/multiboot2/src/builder/boxed_dst.rs +++ b/multiboot2/src/builder/boxed_dst.rs @@ -12,7 +12,7 @@ use core::ptr::NonNull; /// builder. This is tricky in Rust. This type behaves similar to the regular /// `Box` type except that it ensure the same layout is used for the (explicit) /// allocation and the (implicit) deallocation of memory. Otherwise, I didn't -/// found any way to figure out the right layout for a DST. Miri always reported +/// find any way to figure out the right layout for a DST. Miri always reported /// issues that the deallocation used a wrong layout. /// /// Technically, I'm certain this code is memory safe. But with this type, I diff --git a/multiboot2/src/builder/mod.rs b/multiboot2/src/builder/mod.rs index 1a1d7425..93b68528 100644 --- a/multiboot2/src/builder/mod.rs +++ b/multiboot2/src/builder/mod.rs @@ -3,7 +3,7 @@ mod boxed_dst; mod information; -// This must by public to support external people to create boxed DSTs. +// This must be public to support external people to create boxed DSTs. pub use boxed_dst::BoxedDst; pub use information::InformationBuilder; diff --git a/multiboot2/src/tag_trait.rs b/multiboot2/src/tag_trait.rs index 5c42e8a8..7e3ce9ab 100644 --- a/multiboot2/src/tag_trait.rs +++ b/multiboot2/src/tag_trait.rs @@ -5,7 +5,7 @@ use ptr_meta::Pointee; /// A trait to abstract over all sized and unsized tags (DSTs). For sized tags, /// this trait does not much. For DSTs, a [`TagTrait::dst_size`] implementation -/// must me provided, which returns the right size hint for the dynamically +/// must be provided, which returns the right size hint for the dynamically /// sized portion of the struct. /// /// # Trivia From 5438b8d4a3018ebb283b9f75efef5b8ed7ff9107 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 1 May 2024 15:25:14 +0200 Subject: [PATCH 4/6] rust: bump msrv --- .github/workflows/integrationtest.yml | 4 +-- .github/workflows/rust.yml | 8 +++--- multiboot2-header/Cargo.toml | 2 +- multiboot2-header/Changelog.md | 2 +- multiboot2-header/README.md | 12 ++++++--- multiboot2-header/src/lib.rs | 2 +- multiboot2/Cargo.toml | 2 +- multiboot2/Changelog.md | 2 +- multiboot2/README.md | 38 ++++++++++++++++----------- multiboot2/src/lib.rs | 2 +- 10 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.github/workflows/integrationtest.yml b/.github/workflows/integrationtest.yml index c7ff5dbb..5f07017e 100644 --- a/.github/workflows/integrationtest.yml +++ b/.github/workflows/integrationtest.yml @@ -9,7 +9,7 @@ name: "Integration Test" # Run on every push (tag, branch) and pull_request -on: [pull_request, push, merge_group] +on: [ pull_request, push, merge_group ] env: CARGO_TERM_COLOR: always @@ -27,7 +27,7 @@ jobs: # This channel is only required to invoke "nix-shell". # Everything inside that nix-shell will use a pinned version of # nixpkgs. - nix_path: nixpkgs=channel:nixos-23.05 + nix_path: nixpkgs=channel:nixos-23.11 - uses: DeterminateSystems/magic-nix-cache-action@main - name: Set up cargo cache uses: actions/cache@v4 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 22afdc1f..6c9eb137 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,7 +9,7 @@ name: "Cargo workspace" # Run on every push (tag, branch) and pull_request -on: [pull_request, push, workflow_dispatch, merge_group] +on: [ pull_request, push, workflow_dispatch, merge_group ] env: CARGO_TERM_COLOR: always @@ -20,7 +20,7 @@ jobs: name: build (msrv) uses: ./.github/workflows/_build-rust.yml with: - rust-version: 1.69.0 # MSRV + rust-version: 1.70.0 # MSRV do-style-check: false features: builder @@ -46,7 +46,7 @@ jobs: needs: build_msrv uses: ./.github/workflows/_build-rust.yml with: - rust-version: 1.69.0 # MSRV + rust-version: 1.70.0 # MSRV do-style-check: false rust-target: thumbv7em-none-eabihf features: builder @@ -103,7 +103,7 @@ jobs: needs: build_msrv uses: ./.github/workflows/_build-rust.yml with: - rust-version: 1.69.0 # MSRV + rust-version: 1.70.0 # MSRV do-style-check: true do-test: false features: builder diff --git a/multiboot2-header/Cargo.toml b/multiboot2-header/Cargo.toml index a3ef4da5..6ed1c755 100644 --- a/multiboot2-header/Cargo.toml +++ b/multiboot2-header/Cargo.toml @@ -26,7 +26,7 @@ readme = "README.md" homepage = "https://github.com/rust-osdev/multiboot2-header" repository = "https://github.com/rust-osdev/multiboot2" documentation = "https://docs.rs/multiboot2-header" -rust-version = "1.69" +rust-version = "1.70" [[example]] name = "minimal" diff --git a/multiboot2-header/Changelog.md b/multiboot2-header/Changelog.md index dfda0207..aebf8dde 100644 --- a/multiboot2-header/Changelog.md +++ b/multiboot2-header/Changelog.md @@ -3,7 +3,7 @@ ## Unreleased - added `EndHeaderTag::default()` -- MSRV is 1.69 +- MSRV is 1.70 - Can add multiple `TagType::Smbios` tags in the builder. ## 0.3.2 (2023-11-30) diff --git a/multiboot2-header/README.md b/multiboot2-header/README.md index 5927bf85..eebac8d0 100644 --- a/multiboot2-header/README.md +++ b/multiboot2-header/README.md @@ -1,4 +1,5 @@ # multiboot2-header + ![Build](https://github.com/rust-osdev/multiboot2/actions/workflows/rust.yml/badge.svg) [![crates.io](https://img.shields.io/crates/v/multiboot2-header.svg)](https://crates.io/crates/multiboot2-header) [![docs](https://docs.rs/multiboot2-header/badge.svg)](https://docs.rs/multiboot2-header/) @@ -8,6 +9,7 @@ as well as a builder to build them at runtime. This library is `no_std` and can be used in bootloaders. What this library is good for: + - construct a Multiboot2 header at runtime (constructing one at build-time with macros is not done yet, contributions are welcome!) - write a Multiboot2-bootloader that parses a Multiboot2-header @@ -60,20 +62,24 @@ fn main() { ## Example 2: Multiboot2 header as static data in Rust file -You can use the builder, construct a Multiboot2 header, write it to a file and include it like this: +You can use the builder, construct a Multiboot2 header, write it to a file and +include it like this: + ``` #[used] #[no_mangle] #[link_section = ".text.multiboot2_header"] static MULTIBOOT2_HDR: [u8; 64] = *include_bytes!("mb2_hdr_dump.bin"); ``` + You may need a special linker script to place this symbol in the first 32768 bytes of the ELF. See Multiboot2 specification. ## MSRV -The MSRV is 1.69.0 stable. +The MSRV is 1.70.0 stable. ## License & Contribution -See main [README](https://github.com/rust-osdev/multiboot2/blob/main/README.md) file. +See main [README](https://github.com/rust-osdev/multiboot2/blob/main/README.md) +file. diff --git a/multiboot2-header/src/lib.rs b/multiboot2-header/src/lib.rs index 11503f9c..456f4682 100644 --- a/multiboot2-header/src/lib.rs +++ b/multiboot2-header/src/lib.rs @@ -34,7 +34,7 @@ //! //! ## MSRV //! -//! The MSRV is 1.69.0 stable. +//! The MSRV is 1.70.0 stable. #![no_std] #![cfg_attr(feature = "unstable", feature(error_in_core))] diff --git a/multiboot2/Cargo.toml b/multiboot2/Cargo.toml index bf190e9c..c3519cca 100644 --- a/multiboot2/Cargo.toml +++ b/multiboot2/Cargo.toml @@ -31,7 +31,7 @@ readme = "README.md" homepage = "https://github.com/rust-osdev/multiboot2" repository = "https://github.com/rust-osdev/multiboot2" documentation = "https://docs.rs/multiboot2" -rust-version = "1.69" +rust-version = "1.70" [features] default = ["builder"] diff --git a/multiboot2/Changelog.md b/multiboot2/Changelog.md index 4eb240ff..83f8cca2 100644 --- a/multiboot2/Changelog.md +++ b/multiboot2/Changelog.md @@ -3,7 +3,7 @@ ## Unreleased - added `InformationBuilder::default()` -- MSRV is 1.69 +- MSRV is 1.70 ## 0.19.0 (2023-09-21) diff --git a/multiboot2/README.md b/multiboot2/README.md index ea616127..4bdd1893 100644 --- a/multiboot2/README.md +++ b/multiboot2/README.md @@ -1,4 +1,5 @@ # multiboot2 + ![Build](https://github.com/rust-osdev/multiboot2/actions/workflows/rust.yml/badge.svg) [![crates.io](https://img.shields.io/crates/v/multiboot2.svg)](https://crates.io/crates/multiboot2) [![docs](https://docs.rs/multiboot2/badge.svg)](https://docs.rs/multiboot2/) @@ -8,9 +9,12 @@ Multiboot2-compliant bootloaders, such as GRUB. It supports all tags from the specification including full support for the sections of ELF files. This library is `no_std` and can be used in a Multiboot2-kernel. -It follows the Multiboot 2.0 specification at https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html and the ELF 64 specification at http://www.uclibc.org/docs/elf-64-gen.pdf. +It follows the Multiboot 2.0 specification +at https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html and the +ELF 64 specification at http://www.uclibc.org/docs/elf-64-gen.pdf. ## Features and `no_std` Compatibility + This library is always `no_std` without `alloc`. However, the default `builder`- feature requires the `alloc`-crate and an `#[global_allocator]` to be available. You need the `builder` only if you want to construct new boot information @@ -18,28 +22,32 @@ structures at runtime. For parsing, this is not relevant, and you can deactivate the default feature. ## Background: The Multiboot 2 Information Structure + The Multiboot information structure looks like this: -Field | Type ----------------- | ----------- -total size | u32 -reserved | u32 -tags | variable -end tag = (0, 8) | (u32, u32) + Field | Type +------------------|------------ + total size | u32 + reserved | u32 + tags | variable + end tag = (0, 8) | (u32, u32) There are many different types of tags, but they all have the same beginning: -Field | Type -------------- | ----------------- -type | u32 -size | u32 -other fields | variable + Field | Type +--------------|---------- + type | u32 + size | u32 + other fields | variable -All tags and the mbi itself are 8-byte aligned. The last tag must be the _end tag_, which is a tag of type `0` and size `8`. +All tags and the mbi itself are 8-byte aligned. The last tag must be the _end +tag_, which is a tag of type `0` and size `8`. ## MSRV -The MSRV is 1.69.0 stable. + +The MSRV is 1.70.0 stable. ## License & Contribution -See main [README](https://github.com/rust-osdev/multiboot2/blob/main/README.md) file. +See main [README](https://github.com/rust-osdev/multiboot2/blob/main/README.md) +file. diff --git a/multiboot2/src/lib.rs b/multiboot2/src/lib.rs index 4f8b05cf..ee6e4767 100644 --- a/multiboot2/src/lib.rs +++ b/multiboot2/src/lib.rs @@ -33,7 +33,7 @@ //! ``` //! //! ## MSRV -//! The MSRV is 1.69.0 stable. +//! The MSRV is 1.70.0 stable. #[cfg(feature = "builder")] extern crate alloc; From 1dd9bfff14a24491b8306b558e51334c27ad472e Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 1 May 2024 18:25:36 +0200 Subject: [PATCH 5/6] nix: move to repository root --- integration-test/.envrc => .envrc | 0 {integration-test/nix => nix}/sources.json | 6 +++--- {integration-test/nix => nix}/sources.nix | 0 integration-test/shell.nix => shell.nix | 9 +++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) rename integration-test/.envrc => .envrc (100%) rename {integration-test/nix => nix}/sources.json (55%) rename {integration-test/nix => nix}/sources.nix (100%) rename integration-test/shell.nix => shell.nix (81%) diff --git a/integration-test/.envrc b/.envrc similarity index 100% rename from integration-test/.envrc rename to .envrc diff --git a/integration-test/nix/sources.json b/nix/sources.json similarity index 55% rename from integration-test/nix/sources.json rename to nix/sources.json index 51da70ed..5da91e3a 100644 --- a/integration-test/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659", - "sha256": "065jy7qivlbdqmbvd7r9h97b23f21axmc4r7sqmq2h0j82rmymxv", + "rev": "576ecd43d3b864966b4423a853412d6177775e8b", + "sha256": "05gr8w09w7fqfi6zflx7df1n0hhsf8f4p9siikk3wb7k7by2d9sr", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/219951b495fc2eac67b1456824cc1ec1fd2ee659.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/576ecd43d3b864966b4423a853412d6177775e8b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/integration-test/nix/sources.nix b/nix/sources.nix similarity index 100% rename from integration-test/nix/sources.nix rename to nix/sources.nix diff --git a/integration-test/shell.nix b/shell.nix similarity index 81% rename from integration-test/shell.nix rename to shell.nix index 1871b0df..1e3e1a43 100644 --- a/integration-test/shell.nix +++ b/shell.nix @@ -3,10 +3,15 @@ let pkgs = import sources.nixpkgs {}; in pkgs.mkShell rec { - nativeBuildInputs = with pkgs; [ + packages = with pkgs; [ + # general + rustup + nixpkgs-fmt + niv + + # integration test grub2 qemu - rustup xorriso ]; From 8149f3f22e120c507628cd337d529c812bce2b1a Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 1 May 2024 18:29:24 +0200 Subject: [PATCH 6/6] integration test runs again --- .github/workflows/integrationtest.yml | 4 ++-- integration-test/bins/rust-toolchain.toml | 2 +- integration-test/run.sh | 3 ++- shell.nix | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integrationtest.yml b/.github/workflows/integrationtest.yml index 5f07017e..13de84fd 100644 --- a/.github/workflows/integrationtest.yml +++ b/.github/workflows/integrationtest.yml @@ -44,6 +44,6 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }} # Have all the "copying into Nix store" messages in a dedicated step for # better log visibility. - - run: cd integration-test && nix-shell --run "echo OK" && cd .. + - run: nix-shell --run "echo OK" # Now, run the actual test. - - run: cd integration-test && nix-shell --run ./run.sh && cd .. + - run: nix-shell --run run-integrationtest diff --git a/integration-test/bins/rust-toolchain.toml b/integration-test/bins/rust-toolchain.toml index 6cd890fc..4349337f 100644 --- a/integration-test/bins/rust-toolchain.toml +++ b/integration-test/bins/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-03-31" # rustc 1.79-nightly +channel = "nightly-2024-04-30" # rustc 1.80-nightly profile = "default" components = [ "rust-src", diff --git a/integration-test/run.sh b/integration-test/run.sh index 318557b5..9f4fd36c 100755 --- a/integration-test/run.sh +++ b/integration-test/run.sh @@ -15,7 +15,8 @@ function fn_main() { function fn_build_rust_bins() { cd "bins" - cargo build --release + cargo --version + cargo build --release --verbose cd "$DIR" } diff --git a/shell.nix b/shell.nix index 1e3e1a43..178c58af 100644 --- a/shell.nix +++ b/shell.nix @@ -13,6 +13,10 @@ pkgs.mkShell rec { grub2 qemu xorriso + + (pkgs.writeShellScriptBin "run-integrationtest" '' + ./integration-test/run.sh + '') ]; # To invoke "nix-shell" in the CI-runner, we need a global Nix channel.