Fix aarch64

This commit is contained in:
Alex 2023-05-11 18:45:49 +03:00
parent 28ec505b78
commit c7046fe06f
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
5 changed files with 53 additions and 6 deletions

View File

@ -0,0 +1,40 @@
/*
This file is part of Fennix Kernel.
Fennix Kernel is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Fennix Kernel is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
*/
#include <memory.hpp>
#include <convert.h>
#include <debug.h>
namespace Memory
{
bool Virtual::Check(void *VirtualAddress, PTFlag Flag, MapType Type)
{
}
void *Virtual::GetPhysical(void *VirtualAddress)
{
}
void Virtual::Map(void *VirtualAddress, void *PhysicalAddress, uint64_t Flags, MapType Type)
{
}
void Virtual::Unmap(void *VirtualAddress, MapType Type)
{
}
}

View File

@ -19,6 +19,7 @@ ENTRY(_start)
SECTIONS
{
_bootstrap_start = .;
.text.boot :
{
*(.text.boot)
@ -27,8 +28,10 @@ SECTIONS
*(.text.bss)
_bss_end = .;
}
_bootstrap_end = .;
_kernel_start = .;
_kernel_text_start = .;
.text :
{
KEEP(*(.text.boot))
@ -37,6 +40,7 @@ SECTIONS
. = ALIGN(4096);
_kernel_text_end = .;
_kernel_data_start = .;
.data :
{
*(.data .data.*)
@ -44,12 +48,12 @@ SECTIONS
. = ALIGN(4096);
_kernel_data_end = .;
_kernel_rodata_start = .;
.rodata :
{
*(.rodata .rodata.*)
}
. = ALIGN(4096);
_kernel_rodata_end = .;
.init_array :
{
@ -66,12 +70,15 @@ SECTIONS
KEEP(*(.fini_array .dtors))
PROVIDE_HIDDEN (__fini_array_end = .);
}
_kernel_rodata_end = .;
_kernel_bss_start = .;
.bss :
{
*(.bss .bss.*)
}
. = ALIGN(4096);
_kernel_bss_end = .;
_kernel_end = .;
_bss_size = _kernel_end - _kernel_rodata_end;

View File

@ -525,11 +525,7 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info)
: "memory");
asmv("mov $0, %ebp");
#elif defined(aa64)
asmv("mov %0, %%sp"
:
: "r"(KernelStack)
: "memory");
asmv("mov $0, %fp");
#warning "Kernel stack is not set!"
#endif
#ifdef DEBUG

View File

@ -390,9 +390,11 @@ static int sys_fork(SyscallsFrame *Frame)
strncpy(NewThread->Name, Thread->Name, sizeof(Thread->Name));
NewThread->Info = Thread->Info;
#ifdef a86
NewThread->ShadowGSBase = Thread->ShadowGSBase;
NewThread->GSBase = Thread->GSBase;
NewThread->FSBase = Thread->FSBase;
#endif
CPU::Interrupts(CPU::Disable);
static int RetChild = 0;

View File

@ -59,6 +59,8 @@ typedef struct SyscallsFrame
uint32_t StackPointer;
uint32_t StackSegment;
#elif defined(aa64)
uint32_t ReturnAddress;
uint32_t StackPointer;
#endif
} SyscallsFrame;