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

Grub complains "error: overlap detected" #1

Closed
foxostro opened this Issue Sep 12, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@foxostro

foxostro commented Sep 12, 2018

I love the blog post! When trying to run the example code, I ran into a problem where the bootloader would report "error: overlap detected" and refuse to load the image. It seems that removing the .eh_frame section fixes this problem.

Patch:

diff --git a/kernel/kernel.ld b/kernel/kernel.ld
index 7e80e44..bd78f2e 100644
--- a/kernel/kernel.ld
+++ b/kernel/kernel.ld
@@ -57,10 +57,7 @@ SECTIONS
     *(.bss)
   }

-  . = ALIGN(0x1000);
-  .eh_frame (NOLOAD) : { *(.eh_frame) } : NONE
-
   _kernel_virtual_end = .;

-  _kernel_physical_end = (LOADADDR (.eh_frame) + SIZEOF (.eh_frame) + 0xFFF) & 0xFFFFFFFFFFFFF000;
+  _kernel_physical_end = (LOADADDR (.bss) + SIZEOF (.bss) + 0xFFF) & 0xFFFFFFFFFFFFF000;
 }

Unfortunately, I don't really understand why .eh_frame is needed here, or why it's specified as NOLOAD. So, I can't really say for sure this patch won't cause problems of its own...

@missimer

This comment has been minimized.

Show comment
Hide comment
@missimer

missimer Sep 14, 2018

Owner

Hi @foxostro, glad you like the post. Thanks for the improvement, I've tested your change with the latest Fedora and it works, while my original code is actually experiencing the same issue. I've updated the code.

Owner

missimer commented Sep 14, 2018

Hi @foxostro, glad you like the post. Thanks for the improvement, I've tested your change with the latest Fedora and it works, while my original code is actually experiencing the same issue. I've updated the code.

@missimer

This comment has been minimized.

Show comment
Hide comment
@missimer

missimer Sep 14, 2018

Owner

@foxostro I'm updating the blog post and would like to credit you with the fix if you have no objection.

Owner

missimer commented Sep 14, 2018

@foxostro I'm updating the blog post and would like to credit you with the fix if you have no objection.

@foxostro

This comment has been minimized.

Show comment
Hide comment
@foxostro

foxostro Sep 14, 2018

foxostro commented Sep 14, 2018

@missimer missimer closed this Sep 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment