Added x86_64 paging and ELF loader

This commit is contained in:
Jozef Nagy 2025-01-31 21:12:29 +01:00
parent 36ae3ec0b7
commit a39e30d17e
Signed by untrusted user who does not match committer: crz
GPG key ID: 459A4811CEAC7068
6 changed files with 309 additions and 4 deletions

29
boot/include/lib/align.h Normal file
View file

@ -0,0 +1,29 @@
/*********************************************************************************/
/* Module Name: align.h */
/* Project: AurixOS */
/* */
/* Copyright (c) 2024-2025 Jozef Nagy */
/* */
/* This source is subject to the MIT License. */
/* See License.txt in the root of this repository. */
/* All other rights reserved. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
/* SOFTWARE. */
/*********************************************************************************/
#ifndef _LIB_ALIGN_H
#define _LIB_ALIGN_H
#include <stdint.h>
#define DIV_ROUND_UP(x,y) (((uint64_t)(x) + ((uint64_t)(y) - 1)) / (uint64_t)(y))
#define ALIGN_UP(x,y) (DIV_ROUND_UP(x, y) * (uint64_t)(y))
#define ALIGN_DOWN(x,y) (((uint64_t)(x) / (uint64_t)(y)) * (uint64_t)(y))
#endif /* _LIB_ALIGN_H */