diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56fa6316..53de4a22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,17 +36,16 @@ jobs: - name: "Install Rustup Components" run: rustup component add rust-src llvm-tools-preview - - name: "Install cargo-xbuild" - run: cargo install cargo-xbuild --debug + - name: "Install cargo-binutils" run: cargo install cargo-binutils --version 0.1.7 --debug - - run: cargo xbuild + - run: cargo build -Zbuild-std=core working-directory: test-kernel name: 'Build Test Kernel' - name: 'Build Bootloader' - run: cargo xbuild --bin bootloader --features binary --release + run: cargo build -Zbuild-std=core --bin bootloader --features binary --release env: KERNEL: "test-kernel/target/x86_64-test-kernel/debug/test-kernel" KERNEL_MANIFEST: "test-kernel/Cargo.toml" @@ -65,14 +64,10 @@ jobs: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 - - name: Install Scoop (Windows) - run: | - Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') - echo "$HOME\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - if: runner.os == 'Windows' - shell: pwsh - name: Install QEMU (Windows) - run: scoop install qemu + run: | + choco install qemu --version 2021.5.5 + echo "$Env:Programfiles\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append if: runner.os == 'Windows' shell: pwsh - name: "Print QEMU Version" @@ -100,10 +95,8 @@ jobs: - uses: actions/checkout@v1 - name: "Install Rustup Components" run: rustup component add rust-src llvm-tools-preview - - name: "Install cargo-xbuild" - run: cargo install cargo-xbuild --debug - name: 'Build Example Kernel' - run: cargo xbuild + run: cargo build -Zbuild-std=core -Zbuild-std-features=compiler-builtins-mem working-directory: example-kernel diff --git a/Cargo.lock b/Cargo.lock index 160b7020..99f51012 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,12 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "bit_field" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56" +version = 4 [[package]] name = "bit_field" @@ -22,9 +16,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bootloader" -version = "0.9.16" +version = "0.9.31" dependencies = [ - "bit_field 0.10.1", + "bit_field", "fixedvec", "font8x8", "llvm-tools", @@ -80,14 +74,21 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f70329e2cbe45d6c97a5112daad40c34cd9a4e18edb5a2a18fefeb584d8d25e5" +[[package]] +name = "volatile" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c2dbd44eb8b53973357e6e207e370f0c1059990df850aca1eca8947cf464f0" + [[package]] name = "x86_64" -version = "0.13.2" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b871116e3c83dad0795580b10b2b1dd05cb52ec719af36180371877b09681f7f" +checksum = "fb611915c917c6296d11e23f71ff1ecfe49c5766daba92cd3df52df6b58285b6" dependencies = [ - "bit_field 0.9.0", + "bit_field", "bitflags", + "volatile", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index df352085..a2172910 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bootloader" -version = "0.9.16" +version = "0.9.31" authors = ["Philipp Oppermann "] license = "MIT/Apache-2.0" description = "An experimental pure-Rust x86 bootloader." @@ -14,7 +14,7 @@ required-features = ["binary"] [dependencies] xmas-elf = { version = "0.6.2", optional = true } -x86_64 = { version = "0.13.2", optional = true } +x86_64 = { version = "0.14.7", optional = true, default-features = false, features = ["instructions", "inline_asm"] } usize_conversions = { version = "0.2.0", optional = true } fixedvec = { version = "0.2.4", optional = true } bit_field = { version = "0.10.0", optional = true } @@ -55,9 +55,8 @@ features = [ "recursive_page_table", "map_physical_memory" ] default-target = "x86_64-unknown-linux-gnu" [package.metadata.release] -no-dev-version = true pre-release-replacements = [ { file="Changelog.md", search="# Unreleased", replace="# Unreleased\n\n# {{version}} – {{date}}", exactly=1 }, ] pre-release-commit-message = "Release version {{version}}" -disable-publish = true +publish = false diff --git a/Changelog.md b/Changelog.md index b247b483..df54e95b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,72 @@ # Unreleased +# 0.9.31 – 2025-03-22 + +- [remove #[no_mangle] from panic handler](https://github.com/rust-osdev/bootloader/pull/500) + +# 0.9.30 – 2025-02-10 + +- [change rustc-abi in custom targets to x86-softfloat](https://github.com/rust-osdev/bootloader/pull/492) + +# 0.9.29 – 2024-04-30 + +- Fix warnings ([#436](https://github.com/rust-osdev/bootloader/pull/436) and [#437](https://github.com/rust-osdev/bootloader/pull/437)) + +# 0.9.28 – 2024-02-28 + +- Fix warnings: [Remove unused paging imports](https://github.com/rust-osdev/bootloader/pull/430) + +# 0.9.27 – 2024-02-16 + +- [Fix invalid mapping to zero page caused by off-by-one bug](https://github.com/rust-osdev/bootloader/pull/424) + +# 0.9.26 – 2024-02-16 + +- [Fix map errors during kernel loading](https://github.com/rust-osdev/bootloader/pull/422) + - Don't error if a kernel page is already mapped to the correct frame + - Fix: unmap temp page again to enable multiple bss-like sections + +# 0.9.25 – 2024-02-16 + +- [Fix data layout for custom targets for LLVM 18](https://github.com/rust-osdev/bootloader/pull/421) + - Fixes build on latest Rust nightly + +# 0.9.24 – 2024-01-28 + +- Fix data layout for `x86_64-bootloader` target ([#415](https://github.com/rust-osdev/bootloader/pull/415)) + - Fixes build on latest Rust nightly + +# 0.9.23 – 2022-09-25 + +- Fix boot for machines that report memory regions at high physical addresses (see #259) + - Allow allocating more than one level 4 entry ([#264](https://github.com/rust-osdev/bootloader/pull/264)) + +# 0.9.22 – 2022-03-01 + +- Remove the `asm` and `global_asm` features, which are now stable ([#227](https://github.com/rust-osdev/bootloader/pull/227)) + +# 0.9.21 – 2022-01-09 + +- Use new inline assembly syntax ([#204](https://github.com/rust-osdev/bootloader/pull/204)) + +# 0.9.20 – 2021-12-20 + +- Update x86_64 dependency to v0.14.7 to fix nightly breakage ([#208](https://github.com/rust-osdev/bootloader/pull/208)) + +# 0.9.19 – 2021-08-09 + +- Set `relocation-model: static` and `panic-strategy: abort` and `fix .intel_syntax` warnings [#185](https://github.com/rust-osdev/bootloader/pull/185) + - Fixes warnings on the latest Rust nightlies. + - This effectively changes the `relocation-model` and `panic-strategy`. Please report if you encounter any issues because of this. + +# 0.9.18 – 2021-05-20 + +- Fix nightly regression by manually passing --gc-sections ([#168](https://github.com/rust-osdev/bootloader/pull/168)) + +# 0.9.17 – 2021-04-30 + +- Reduce the number of used unstable features of x86_64 crate (backport [#155](https://github.com/rust-osdev/bootloader/pull/140)) + # 0.9.16 – 2021-03-07 Replace all remaining `lea`s with `mov` + `offset` ([#140](https://github.com/rust-osdev/bootloader/pull/140)) diff --git a/README.md b/README.md index 5a5db560..945efcc3 100644 --- a/README.md +++ b/README.md @@ -108,28 +108,28 @@ Note that the addresses **must** be given as strings (in either hex or decimal f ## Requirements -You need a nightly [Rust](https://www.rust-lang.org) compiler and [cargo xbuild](https://github.com/rust-osdev/cargo-xbuild). You also need the `llvm-tools-preview` component, which can be installed through `rustup component add llvm-tools-preview`. +You need a nightly [Rust](https://www.rust-lang.org) compiler. You also need the `llvm-tools-preview` component, which can be installed through `rustup component add llvm-tools-preview`. ## Build The simplest way to use the bootloader is in combination with the [bootimage](https://github.com/rust-osdev/bootimage) tool. This crate **requires at least bootimage 0.7.7**. With the tool installed, you can add a normal cargo dependency on the `bootloader` crate to your kernel and then run `bootimage build` to create a bootable disk image. You can also execute `bootimage run` to run your kernel in [QEMU](https://www.qemu.org/) (needs to be installed). -To compile the bootloader manually, you need to invoke `cargo xbuild` with two environment variables: +To compile the bootloader manually, you need to invoke `cargo build -Zbuild-std=core` with two environment variables: * `KERNEL`: points to your kernel executable (in the ELF format) * `KERNEL_MANIFEST`: points to the `Cargo.toml` describing your kernel For example: ``` -KERNEL=/path/to/your/kernel/target/debug/your_kernel KERNEL_MANIFEST=/path/to/your/kernel/Cargo.toml cargo xbuild +KERNEL=/path/to/your/kernel/target/debug/your_kernel KERNEL_MANIFEST=/path/to/your/kernel/Cargo.toml cargo build -Zbuild-std=core ``` As an example, you can build the bootloader with example kernel from the `example-kernel` directory with the following commands: ``` cd example-kernel -cargo xbuild +cargo build -Zbuild-std=core cd .. -KERNEL=example-kernel/target/x86_64-example-kernel/debug/example-kernel KERNEL_MANIFEST=example-kernel/Cargo.toml cargo xbuild --release --features binary +KERNEL=example-kernel/target/x86_64-example-kernel/debug/example-kernel KERNEL_MANIFEST=example-kernel/Cargo.toml cargo build -Zbuild-std=core --release --features binary ``` The `binary` feature is required to enable the dependencies required for compiling the bootloader executable. The command results in a bootloader executable at `target/x86_64-bootloader.json/release/bootloader`. This executable is still an ELF file, which can't be run directly. diff --git a/example-kernel/.cargo/config b/example-kernel/.cargo/config.toml similarity index 100% rename from example-kernel/.cargo/config rename to example-kernel/.cargo/config.toml diff --git a/example-kernel/Cargo.toml b/example-kernel/Cargo.toml index 37431378..557284b7 100644 --- a/example-kernel/Cargo.toml +++ b/example-kernel/Cargo.toml @@ -5,4 +5,4 @@ authors = ["Philipp Oppermann "] edition = "2018" [dependencies] -x86_64 = "0.13.2" +x86_64 = { version = "0.14.7", default-features = false, features = ["instructions", "inline_asm"] } diff --git a/example-kernel/x86_64-example-kernel.json b/example-kernel/x86_64-example-kernel.json index 9afe809f..6f5613c2 100644 --- a/example-kernel/x86_64-example-kernel.json +++ b/example-kernel/x86_64-example-kernel.json @@ -1,6 +1,6 @@ { "llvm-target": "x86_64-unknown-none", - "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", "arch": "x86_64", "target-endian": "little", "target-pointer-width": "64", @@ -11,5 +11,6 @@ "linker": "rust-lld", "panic-strategy": "abort", "disable-redzone": true, - "features": "-mmx,-sse,+soft-float" + "features": "-mmx,-sse,+soft-float", + "rustc-abi": "x86-softfloat" } diff --git a/src/e820.s b/src/e820.s index 114de231..cb07e8e1 100644 --- a/src/e820.s +++ b/src/e820.s @@ -1,5 +1,4 @@ .section .boot, "awx" -.intel_syntax noprefix .code16 # From http://wiki.osdev.org/Detecting_Memory_(x86)#Getting_an_E820_Memory_Map @@ -52,4 +51,5 @@ do_e820: stc # "function unsupported" error exit ret +.global mmap_ent mmap_ent: .word 0 diff --git a/src/level4_entries.rs b/src/level4_entries.rs index 60ace846..c4c11140 100644 --- a/src/level4_entries.rs +++ b/src/level4_entries.rs @@ -31,15 +31,19 @@ impl UsedLevel4Entries { used } - pub fn get_free_entry(&mut self) -> PageTableIndex { - let (idx, entry) = self + pub fn get_free_entries(&mut self, num: u64) -> PageTableIndex { + let idx = self .entry_state - .iter_mut() + .windows(num as usize) .enumerate() - .find(|(_, &mut entry)| entry == false) + .find(|(_, entries)| entries.iter().all(|&entry| entry == false)) + .map(|(idx, _)| idx) .expect("no usable level 4 entries found"); - *entry = true; + for i in 0..num as usize { + self.entry_state[idx + i] = true; + } + PageTableIndex::new(idx.try_into().unwrap()) } } diff --git a/src/main.rs b/src/main.rs index 3ccac477..2c72adfa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,3 @@ -#![feature(lang_items)] -#![feature(global_asm)] -#![feature(llvm_asm)] #![no_std] #![no_main] @@ -10,8 +7,8 @@ compile_error!("The bootloader crate must be compiled for the `x86_64-bootloader extern crate rlibc; use bootloader::bootinfo::{BootInfo, FrameRange}; -use core::convert::TryInto; -use core::panic::PanicInfo; +use core::arch::asm; +use core::{arch::global_asm, convert::TryInto, panic::PanicInfo}; use core::{mem, slice}; use fixedvec::alloc_stack; use usize_conversions::usize_from; @@ -42,8 +39,8 @@ global_asm!(include_str!("video_mode/vga_320x200.s")); global_asm!(include_str!("video_mode/vga_text_80x25.s")); unsafe fn context_switch(boot_info: VirtAddr, entry_point: VirtAddr, stack_pointer: VirtAddr) -> ! { - llvm_asm!("call $1; ${:private}.spin.${:uid}: jmp ${:private}.spin.${:uid}" :: - "{rsp}"(stack_pointer), "r"(entry_point), "{rdi}"(boot_info) :: "intel"); + asm!("mov rsp, {1}; call {0}; 2: jmp 2b", + in(reg) entry_point.as_u64(), in(reg) stack_pointer.as_u64(), in("rdi") boot_info.as_u64()); ::core::hint::unreachable_unchecked() } @@ -88,8 +85,12 @@ extern "C" { #[no_mangle] pub unsafe extern "C" fn stage_4() -> ! { // Set stack segment - llvm_asm!("mov bx, 0x0 - mov ss, bx" ::: "bx" : "intel"); + asm!( + "push rbx + mov bx, 0x0 + mov ss, bx + pop rbx" + ); let kernel_start = 0x400000; let kernel_size = &_kernel_size as *const _ as u64; @@ -168,7 +169,8 @@ fn bootloader_main( enable_nxe_bit(); // Create a recursive page table entry - let recursive_index = PageTableIndex::new(level4_entries.get_free_entry().try_into().unwrap()); + let recursive_index = + PageTableIndex::new(level4_entries.get_free_entries(1).try_into().unwrap()); let mut entry = PageTableEntry::new(); entry.set_addr( p4_physical, @@ -242,7 +244,7 @@ fn bootloader_main( let page: Page = match BOOT_INFO_ADDRESS { Some(addr) => Page::containing_address(VirtAddr::new(addr)), None => Page::from_page_table_indices( - level4_entries.get_free_entry(), + level4_entries.get_free_entries(1), PageTableIndex::new(0), PageTableIndex::new(0), PageTableIndex::new(0), @@ -285,11 +287,10 @@ fn bootloader_main( let physical_memory_offset = if cfg!(feature = "map_physical_memory") { let physical_memory_offset = PHYSICAL_MEMORY_OFFSET.unwrap_or_else(|| { - // If offset not manually provided, find a free p4 entry and map memory here. - // One level 4 entry spans 2^48/512 bytes (over 500gib) so this should suffice. - assert!(max_phys_addr < (1 << 48) / 512); + const LEVEL_4_SIZE: u64 = 4096 * 512 * 512 * 512; + let level_4_entries = (max_phys_addr + (LEVEL_4_SIZE - 1)) / LEVEL_4_SIZE; Page::from_page_table_indices_1gib( - level4_entries.get_free_entry(), + level4_entries.get_free_entries(level_4_entries), PageTableIndex::new(0), ) .start_address() @@ -369,19 +370,12 @@ fn enable_write_protect_bit() { } #[panic_handler] -#[no_mangle] pub fn panic(info: &PanicInfo) -> ! { use core::fmt::Write; write!(printer::Printer, "{}", info).unwrap(); loop {} } -#[lang = "eh_personality"] -#[no_mangle] -pub extern "C" fn eh_personality() { - loop {} -} - #[no_mangle] pub extern "C" fn _Unwind_Resume() { loop {} diff --git a/src/page_table.rs b/src/page_table.rs index ed2ac136..62a2be07 100644 --- a/src/page_table.rs +++ b/src/page_table.rs @@ -17,7 +17,11 @@ pub struct MemoryInfo { #[derive(Debug)] pub enum MapKernelError { - Mapping(MapToError), + Mapping( + /// This field is never read, but still printed as part of the Debug output on error. + #[allow(dead_code)] + MapToError, + ), MultipleTlsSegments, } @@ -96,7 +100,13 @@ pub(crate) fn map_segment( for frame in PhysFrame::range_inclusive(start_frame, end_frame) { let offset = frame - start_frame; let page = start_page + offset; - unsafe { map_page(page, frame, page_table_flags, page_table, frame_allocator)? } + unsafe { map_page(page, frame, page_table_flags, page_table, frame_allocator) } + .unwrap_or_else(|err| { + panic!( + "failed to map segment starting at {:?}: failed to map page {:?} to frame {:?}: {:?}", + start_page, page, frame, err + ) + }) .flush(); } @@ -117,7 +127,7 @@ pub(crate) fn map_segment( unsafe { map_page( temp_page.clone(), - new_frame.clone(), + new_frame, page_table_flags, page_table, frame_allocator, @@ -145,6 +155,11 @@ pub(crate) fn map_segment( }); } + // unmap temp page again + let (new_frame, flusher) = page_table.unmap(temp_page).unwrap(); + flusher.flush(); + + // map last page to new frame unsafe { map_page( last_page, @@ -162,7 +177,7 @@ pub(crate) fn map_segment( zero_start.as_u64(), Size4KiB::SIZE, ))); - let end_page = Page::containing_address(zero_end); + let end_page = Page::containing_address(zero_end - 1usize); for page in Page::range_inclusive(start_page, end_page) { let frame = frame_allocator .allocate_frame(MemoryRegionType::Kernel) diff --git a/src/stage_1.s b/src/stage_1.s index cbab048d..09ada795 100644 --- a/src/stage_1.s +++ b/src/stage_1.s @@ -1,6 +1,5 @@ .section .boot-first-stage, "awx" .global _start -.intel_syntax noprefix .code16 # This stage initializes the stack, enables the A20 line, loads the rest of diff --git a/src/stage_2.s b/src/stage_2.s index f5ad1141..8cf26ea0 100644 --- a/src/stage_2.s +++ b/src/stage_2.s @@ -1,5 +1,4 @@ .section .boot, "awx" -.intel_syntax noprefix .code16 # This stage sets the target operating mode, loads the kernel from disk, diff --git a/src/stage_3.s b/src/stage_3.s index 112c68df..2f081afa 100644 --- a/src/stage_3.s +++ b/src/stage_3.s @@ -1,5 +1,4 @@ .section .boot, "awx" -.intel_syntax noprefix .code32 # This stage performs some checks on the CPU (cpuid, long mode), sets up an diff --git a/src/video_mode/vga_320x200.s b/src/video_mode/vga_320x200.s index 17d4a743..6cd20128 100644 --- a/src/video_mode/vga_320x200.s +++ b/src/video_mode/vga_320x200.s @@ -1,5 +1,4 @@ .section .boot, "awx" -.intel_syntax noprefix .code16 config_video_mode: diff --git a/src/video_mode/vga_text_80x25.s b/src/video_mode/vga_text_80x25.s index 0ddb0d6f..4e65216a 100644 --- a/src/video_mode/vga_text_80x25.s +++ b/src/video_mode/vga_text_80x25.s @@ -1,5 +1,4 @@ .section .boot, "awx" -.intel_syntax noprefix .code16 config_video_mode: diff --git a/test-kernel/.cargo/config b/test-kernel/.cargo/config.toml similarity index 100% rename from test-kernel/.cargo/config rename to test-kernel/.cargo/config.toml diff --git a/test-kernel/Cargo.lock b/test-kernel/Cargo.lock index 5d0ef56f..a76396ee 100644 --- a/test-kernel/Cargo.lock +++ b/test-kernel/Cargo.lock @@ -1,10 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "bit_field" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56" +checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" [[package]] name = "bitflags" @@ -19,12 +21,19 @@ dependencies = [ "x86_64", ] +[[package]] +name = "volatile" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c2dbd44eb8b53973357e6e207e370f0c1059990df850aca1eca8947cf464f0" + [[package]] name = "x86_64" -version = "0.13.2" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b871116e3c83dad0795580b10b2b1dd05cb52ec719af36180371877b09681f7f" +checksum = "958ab3202b01bc43ba2eb832102c4a487ed93151667a2289062e5f2b00058be2" dependencies = [ "bit_field", "bitflags", + "volatile", ] diff --git a/test-kernel/Cargo.toml b/test-kernel/Cargo.toml index f39f7503..d21177df 100644 --- a/test-kernel/Cargo.toml +++ b/test-kernel/Cargo.toml @@ -5,4 +5,4 @@ authors = ["Philipp Oppermann "] edition = "2018" [dependencies] -x86_64 = "0.13.2" +x86_64 = { version = "0.14.7", default-features = false, features = ["instructions", "inline_asm"] } diff --git a/test-kernel/x86_64-test-kernel.json b/test-kernel/x86_64-test-kernel.json index 9afe809f..6f5613c2 100644 --- a/test-kernel/x86_64-test-kernel.json +++ b/test-kernel/x86_64-test-kernel.json @@ -1,6 +1,6 @@ { "llvm-target": "x86_64-unknown-none", - "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", "arch": "x86_64", "target-endian": "little", "target-pointer-width": "64", @@ -11,5 +11,6 @@ "linker": "rust-lld", "panic-strategy": "abort", "disable-redzone": true, - "features": "-mmx,-sse,+soft-float" + "features": "-mmx,-sse,+soft-float", + "rustc-abi": "x86-softfloat" } diff --git a/x86_64-bootloader.json b/x86_64-bootloader.json index ad13109d..9f4a2591 100644 --- a/x86_64-bootloader.json +++ b/x86_64-bootloader.json @@ -1,12 +1,13 @@ { "llvm-target": "x86_64-unknown-none-gnu", - "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", "linker-flavor": "ld.lld", "linker": "rust-lld", "pre-link-args": { "ld.lld": [ - "--script=linker.ld" - ] + "--script=linker.ld", + "--gc-sections" + ] }, "target-endian": "little", "target-pointer-width": "64", @@ -15,7 +16,8 @@ "os": "none", "features": "-mmx,-sse,+soft-float", "disable-redzone": true, - "panic": "abort", + "panic-strategy": "abort", "executables": true, - "relocation_model": "static" + "relocation-model": "static", + "rustc-abi": "x86-softfloat" }