Initial commit

This commit is contained in:
bdbrd 2025-10-22 15:51:24 +02:00
commit cbc51f523e
125 changed files with 34817 additions and 0 deletions

24
src/elf/elf.c Normal file
View file

@ -0,0 +1,24 @@
#include <error.h>
#include <stdint.h>
#include "elf.h"
kstatus check_elf(elf64_ehdr *ehdr){
if(!ehdr){
return KERNEL_STATUS_ERROR;
}
if( ehdr->e_ident[0] == ELFMAG0 && ehdr->e_ident[1] == ELFMAG1 &&
ehdr->e_ident[2] == ELFMAG2 && ehdr->e_ident[3] == ELFMAG3){
return KERNEL_STATUS_SUCCESS;
}
return KERNEL_STATUS_ERROR;
}
kstatus kernel_load_elf64(elf64_ehdr *ehdr){
if(!check_elf(ehdr)){
return KERNEL_STATUS_ERROR;
}
}