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

panic when make run #76

Closed
UZER0 opened this issue Nov 11, 2021 · 4 comments
Closed

panic when make run #76

UZER0 opened this issue Nov 11, 2021 · 4 comments

Comments

@UZER0
Copy link

UZER0 commented Nov 11, 2021

hello,everyone:
panic when make run. stack is:
[ 0.000] running init script: "/bin/sh"
[ 0.000] WARN: invalid ELF e_machine[ 0.000] panicked at 'failed to execute the init script: : ENOEXEC: This error originates from:
#1: ffff800000150d79 kerla::printk::capture_backtrace()+0x79
#2: ffff800000137633 kerla::result::Error::new()+0x23
#3: ffff800000137c07 <kerla::result::Error as c...la::result::Errno>>::from()+0x17
#4: ffff800000104247 <T as core::convert::Into>::into()+0x17
#5: ffff8000001a7b32 kerla::process::elf::Elf::parse()+0x782
#6: ffff8000001bca7c kerla::process::process::do_setup_userspace()+0x49c
#7: ffff8000001bc5c9 kerla::process::process::setup_userspace()+0x39
#8: ffff8000001b9bed kerla::process::process::Process::new_init_process()+0x4ed
', kernel/boot.rs:154:14
[ 0.000] 0: ffff800000150cfa kerla::printk::backtrace()+0x1a
[ 0.000] 1: ffff8000001185fa rust_begin_unwind()+0xea
[ 0.000] 2: ffff8000002966fa core::panicking::panic_fmt()+0x3a
[ 0.000] 3: ffff8000002a2366 core::result::unwrap_failed()+0xe6
[ 0.000] 4: ffff80000013da98 core::result::Result<T,E>::expect()+0x78
[ 0.000] 5: ffff80000018e05f kerla::boot::boot_kernel()+0x91f
[ 0.000] 6: ffff80000010a8a4 bsp_early_init()+0x94
[ 0.000] 7: ffff8000001001f4 halt()+0x0

branch: master 8f2fce6
os: big sur 11.6
cpu: apple m1
Has anyone have same problem?

@nuta
Copy link
Owner

nuta commented Nov 11, 2021

cpu: apple m1

This is why it fails to execute the init (WARN: invalid ELF e_machine ). Could you add --platform linux/amd64 in this docker build command?

kerla/Makefile

Line 173 in 8f2fce6

cd initramfs && docker buildx build -t kerla-initramfs .

@UZER0
Copy link
Author

UZER0 commented Nov 12, 2021

cpu: apple m1

This is why it fails to execute the init (WARN: invalid ELF e_machine ). Could you add --platform linux/amd64 in this docker build command?

kerla/Makefile

Line 173 in 8f2fce6

cd initramfs && docker buildx build -t kerla-initramfs .

no,i just clone code and run ‘make run’, don't edit anything

@UZER0
Copy link
Author

UZER0 commented Nov 12, 2021

problem resolved when add --platform linux/amd64 to Makefile. thanks @nuta

@nuta
Copy link
Owner

nuta commented Nov 12, 2021

Glad to hear that! I've fixed it in ff4b63a. Thanks for the report, @UZER0 😃

@nuta nuta closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants