rust-osdev / rust-osdev/bootloader

`No space left on device` for UEFI image with large kernel image, fixed by increasing FAT padding

Open
#438 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.7k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

When I try to create a UEFI image with a 600MiB+ kernel image, I sometimes get a No space left on device error.

This can be fixed by altering fat.rs:29:

---    let fat_size_padded_and_rounded = ((needed_size + 1024 * 64 - 1) / MB + 1) * MB + MB;
+++    let fat_size_padded_and_rounded = ((needed_size + 1024 * 64 - 1) / MB + 2) * MB + MB;

to increase the size by 1MiB. I believe this is an issue with clusters and/or fragmentation, but I don't want to just increase a constant and potentially waste that megabyte if I don't need to.

Is there an improved heuristic for the necessary padding and rounding?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at fat.rs:29 and reproduce UEFI image creation with a 600MiB+ kernel image. Investigate how FAT clusters or fragmentation affect the required padding and rounding, then verify that the heuristic avoids the No space left on device failure without always wasting an extra MiB.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.