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

Implement bulk of UEFI protocol needed by linux kernel #423

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

zhangxp1998
Copy link
Contributor

No description provided.

@zhangxp1998
Copy link
Contributor Author

  • Added boot service support, implemented common memory functions(allocate/free/get_memory_map), added stub for other functions so that kernel does not crash on call
  • Added Runtime service support, only implemented GetVariable/SetVariable, which are called by kernel to get secure boot status.
  • Some kernel images might requires relocation, so added relocation support: Load kernel into memory and patch relevant sections according to the relo data.
  • Linux Kernel assumes everything is identity mapped, hence anything reachable from the kernel must be identity mapped. This includes the kernel image, kernel stack, memories returned from boot service allocation, etc.

kernel/include/kernel/vm.h Outdated Show resolved Hide resolved
lib/uefi/boot_service_provider.cpp Outdated Show resolved Hide resolved
lib/uefi/boot_service_provider.cpp Outdated Show resolved Hide resolved
lib/uefi/boot_service_provider.cpp Outdated Show resolved Hide resolved
external/lib/heap/dlmalloc/rules.mk Show resolved Hide resolved
lib/uefi/boot_service_provider.cpp Outdated Show resolved Hide resolved
lib/uefi/boot_service_provider.cpp Outdated Show resolved Hide resolved
lib/uefi/switch_stack.S Outdated Show resolved Hide resolved
lib/uefi/switch_stack.S Outdated Show resolved Hide resolved

sub x0,x0,16
mov x6,sp
str x6,[x0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be able to 'str sp,[x0]' directly i believe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assembler would not let me. Looks like sp is a special operand which can't be used directly in an str instruction.

@travisg
Copy link
Member

travisg commented Nov 4, 2024

Looks generally pretty good, just a few changes (such as licenses, etc) and it's at least good enough to not bother other code upstream.

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 this pull request may close these issues.

2 participants