s-matyukevich / raspberry-pi-os

Learning operating system development using Linux kernel and Raspberry Pi
MIT License
13.16k stars 1.29k forks source link

[Lesson05] RPi 4 system call not working #239

Closed maxstreitberger closed 3 years ago

maxstreitberger commented 3 years ago

I have some trouble getting system calls to work on my raspberry pi 4. When I run the OS I get the following error: \ Kernel process started. EL 1 Type: 4, ESR: 2000000, Address: 1d14 ("Type: 4" means that it is "SYNC_INVALID_EL_1h") \ I looked at the AArch64 Expection Model to learn more about exceptions, but it didn't really helped me. I also tried the solution in the other issue (#228), which also didn't work for me. Can anyone explain me what this error exactly means?

rhythm16 commented 3 years ago

Do the function pointers in your sys_call_table point to the correct place at runtime? I mean since sys_call_table is initialized statically, if you didn't change the linker script or modify sys_call_table at runtime, it would not be pointing to the sys_* functions because rpi4 loads the kernel image at 0x80000

maxstreitberger commented 3 years ago

Thanks for you quick response, I haven't changed the addresses of the sys_* functions. It is working now, after I changed it. Thank you!

anarchuser commented 3 years ago

This issue can also be resolved by loading the kernel code at address 0x80000 explicitly, by specifying

. = 0x80000;

as first line in SECTIONS in the linker.ld