Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ramdisk marked as Usable region in MemoryRegions #445

Closed
Wasabi375 opened this issue Jun 9, 2024 · 1 comment · Fixed by #446
Closed

Ramdisk marked as Usable region in MemoryRegions #445

Wasabi375 opened this issue Jun 9, 2024 · 1 comment · Fixed by #446

Comments

@Wasabi375
Copy link
Contributor

// check if region overlaps with kernel or ramdisk
let kernel_slice_end = kernel_slice_start + kernel_slice_len;
let ramdisk_slice_end = ramdisk_slice_start.map(|s| s + ramdisk_slice_len);
if region.kind == MemoryRegionKind::Usable
&& kernel_slice_start < region.end
&& kernel_slice_end > region.start
{
// region overlaps with kernel -> we might need to split it

} else if region.kind == MemoryRegionKind::Usable
&& ramdisk_slice_start.map(|s| s < region.end).unwrap_or(false)
&& ramdisk_slice_end.map(|e| e > region.start).unwrap_or(false)
{

This assumes that the memory region containing the kernel and the region containing the ramdisk are distinct. However if both fall within the same region only the kernel is marked as a bootloader region and the ramdisk is marked as usable.

Wasabi375 added a commit to Wasabi375/bootloader that referenced this issue Jun 9, 2024
regions

This is a sample test to show the bug described in rust-osdev#445
@Wasabi375
Copy link
Contributor Author

Here is a sample test for this bug that is failing: 6aa66a7

Wasabi375 added a commit to Wasabi375/bootloader that referenced this issue Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant