summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-28 09:30:38 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-28 09:30:38 +0100
commit7df7ed6d026c5e1f3b8111e3536af3771301c177 (patch)
treef87916ee645aec06971a84dc1e9e5f1267fbe755 /src
parent176cf8f237745d658185a2fba8fff1401c1c2b5f (diff)
feat! firmware breaking changes on the API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/arm64/arm64-30pin.c13
-rw-r--r--src/arm64/arm64-err.c11
-rw-r--r--src/arm64/arm64-uart.c13
-rw-r--r--src/hal/neboot-ahci-driver.c13
-rw-r--r--src/hal/neboot-flash-driver.c8
-rw-r--r--src/neboot-bootnet.c11
-rw-r--r--src/neboot-cpu-api.c14
-rw-r--r--src/neboot-cxx-abi.cc12
-rw-r--r--src/neboot-partition-map-parse.c11
-rw-r--r--src/neboot-partition-map.c16
-rw-r--r--src/neboot-pci-tree.c13
-rw-r--r--src/neboot-print-name.c11
-rw-r--r--src/neboot-start.c19
-rw-r--r--src/neboot-string.c11
-rw-r--r--src/ppc64/ppc64-boot.S5
-rw-r--r--src/ppc64/ppc64-err.c11
-rw-r--r--src/ppc64/ppc64-hal.c17
-rw-r--r--src/ppc64/ppc64-uart.c16
-rw-r--r--src/rv64/rv64-api.s12
-rw-r--r--src/rv64/rv64-boot.s14
-rw-r--r--src/rv64/rv64-err.c11
-rw-r--r--src/rv64/rv64-uart.c16
22 files changed, 125 insertions, 153 deletions
diff --git a/src/arm64/arm64-30pin.c b/src/arm64/arm64-30pin.c
index 1681eaf..1ab6bc4 100644
--- a/src/arm64/arm64-30pin.c
+++ b/src/arm64/arm64-30pin.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/30pin.h>
-#include <lib/partition-map.h>
+#include <include/30pin.h>
+#include <include/partition-map.h>
extern size_t cb_read_30pin(voidptr_t blob, size_t* size, size_t* start_lba);
diff --git a/src/arm64/arm64-err.c b/src/arm64/arm64-err.c
index 192df34..dd28eb5 100644
--- a/src/arm64/arm64-err.c
+++ b/src/arm64/arm64-err.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
+#include <include/boot.h>
/// BUGS: 0
diff --git a/src/arm64/arm64-uart.c b/src/arm64/arm64-uart.c
index 3e996b6..d0fe333 100644
--- a/src/arm64/arm64-uart.c
+++ b/src/arm64/arm64-uart.c
@@ -1,11 +1,10 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
-#include <lib/string.h>
+#include <include/boot.h>
+#include <include/string.h>
/// BUGS: 0
diff --git a/src/hal/neboot-ahci-driver.c b/src/hal/neboot-ahci-driver.c
index 0b240a0..ff5f630 100644
--- a/src/hal/neboot-ahci-driver.c
+++ b/src/hal/neboot-ahci-driver.c
@@ -1,8 +1,7 @@
-/* -------------------------------------------
-
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
/**
* @file neboot-ahci-driver.cc
@@ -15,8 +14,8 @@
*
*/
-#include <lib/boot.h>
-#include <lib/pci-tree.h>
+#include <include/boot.h>
+#include <include/pci-tree.h>
#define NB_AHCI_DRIVER_NAME ("@sata")
diff --git a/src/hal/neboot-flash-driver.c b/src/hal/neboot-flash-driver.c
index 8e1f02d..61d205c 100644
--- a/src/hal/neboot-flash-driver.c
+++ b/src/hal/neboot-flash-driver.c
@@ -4,7 +4,7 @@ Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
------------------------------------------- */
-#include <lib/boot.h>
-#include <lib/mp-bit.h>
-#include <lib/partition-map.h>
-#include <lib/pci-tree.h>
+#include <include/boot.h>
+#include <include/mp-bit.h>
+#include <include/partition-map.h>
+#include <include/pci-tree.h>
diff --git a/src/neboot-bootnet.c b/src/neboot-bootnet.c
index 591d0be..af120b1 100644
--- a/src/neboot-bootnet.c
+++ b/src/neboot-bootnet.c
@@ -1,7 +1,6 @@
-/* -------------------------------------------
+// Copyright 2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2025, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/bootnet.h>
+#include <include/bootnet.h>
diff --git a/src/neboot-cpu-api.c b/src/neboot-cpu-api.c
index 662e6e9..3746163 100644
--- a/src/neboot-cpu-api.c
+++ b/src/neboot-cpu-api.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
+#include <include/boot.h>
/// @brief Restarts the computer.
/// @param none.
@@ -18,7 +17,6 @@ void cb_restart_machine(void) {
}
#else
/// @todo add your reset vector here.
- while (1)
- ;
+ while (1);
#endif
}
diff --git a/src/neboot-cxx-abi.cc b/src/neboot-cxx-abi.cc
index 024f067..b4d74e3 100644
--- a/src/neboot-cxx-abi.cc
+++ b/src/neboot-cxx-abi.cc
@@ -1,11 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
- Copyright (C) 2025, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/cxx-abi.hpp>
+#include <include/cxx-abi.hpp>
/// BUGS: 0
diff --git a/src/neboot-partition-map-parse.c b/src/neboot-partition-map-parse.c
index 23c5acd..4ec9a30 100644
--- a/src/neboot-partition-map-parse.c
+++ b/src/neboot-partition-map-parse.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/partition-map.h>
+#include <include/partition-map.h>
bool cb_parse_partition_block_data_at(voidptr_t blob, size_t blob_sz, size_t index, size_t* end_lba,
size_t* start_lba, size_t* sector_sz) {
diff --git a/src/neboot-partition-map.c b/src/neboot-partition-map.c
index 24ea3eb..5f5a59e 100644
--- a/src/neboot-partition-map.c
+++ b/src/neboot-partition-map.c
@@ -1,17 +1,15 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/partition-map.h>
-#include <lib/string.h>
+#include <include/partition-map.h>
+#include <include/string.h>
// include this for documentation.
#define NB_FILESYSTEM_COUNT (5U)
-#define NB_FILESYSTEM_LIST \
- { "NeFS", "HeFS", "FAT32", "ext4", "XeFS" }
+#define NB_FILESYSTEM_LIST {"NeFS", "HeFS", "FAT32", "ext4", "XeFS"}
/// @brief check if filesystem is supported by NeBoot.
/// @param fs the filesystem magic, as provided by EPM.
diff --git a/src/neboot-pci-tree.c b/src/neboot-pci-tree.c
index 8207837..6c2d0cc 100644
--- a/src/neboot-pci-tree.c
+++ b/src/neboot-pci-tree.c
@@ -1,8 +1,7 @@
-/* -------------------------------------------
-
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
/**
* @file neboot-pci-tree.c
@@ -15,8 +14,8 @@
*
*/
-#include <lib/pci-tree.h>
-#include <lib/string.h>
+#include <include/pci-tree.h>
+#include <include/string.h>
/// BUGS: 0
diff --git a/src/neboot-print-name.c b/src/neboot-print-name.c
index d351947..bf27ead 100644
--- a/src/neboot-print-name.c
+++ b/src/neboot-print-name.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
+#include <include/boot.h>
/// @brief Print firmware name.
/// @param
diff --git a/src/neboot-start.c b/src/neboot-start.c
index c282f55..8199723 100644
--- a/src/neboot-start.c
+++ b/src/neboot-start.c
@@ -1,13 +1,12 @@
-/* -------------------------------------------
-
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
-#include <lib/mp-bit.h>
-#include <lib/partition-map.h>
-#include <lib/pci-tree.h>
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
+
+#include <include/boot.h>
+#include <include/mp-bit.h>
+#include <include/partition-map.h>
+#include <include/pci-tree.h>
/// BUGS: 0
diff --git a/src/neboot-string.c b/src/neboot-string.c
index f2bc99d..3c62d64 100644
--- a/src/neboot-string.c
+++ b/src/neboot-string.c
@@ -1,8 +1,7 @@
-/* -------------------------------------------
-
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
/**
* @file neboot-string.c
@@ -15,7 +14,7 @@
*
*/
-#include <lib/string.h>
+#include <include/string.h>
/// BUGS: 0
diff --git a/src/ppc64/ppc64-boot.S b/src/ppc64/ppc64-boot.S
index de366fc..6fb2a79 100644
--- a/src/ppc64/ppc64-boot.S
+++ b/src/ppc64/ppc64-boot.S
@@ -1,3 +1,8 @@
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
+
.balign 4
.section .text
diff --git a/src/ppc64/ppc64-err.c b/src/ppc64/ppc64-err.c
index ae692bc..91588a7 100644
--- a/src/ppc64/ppc64-err.c
+++ b/src/ppc64/ppc64-err.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
+#include <include/boot.h>
/// BUGS: 0
diff --git a/src/ppc64/ppc64-hal.c b/src/ppc64/ppc64-hal.c
index 0c43cb3..b476ddb 100644
--- a/src/ppc64/ppc64-hal.c
+++ b/src/ppc64/ppc64-hal.c
@@ -1,14 +1,13 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
+#include <include/ppc64/mmu.h>
+#include <include/ppc64/processor.h>
-------------------------------------------- */
-
-#include <lib/ppc64/mmu.h>
-#include <lib/ppc64/processor.h>
-
-#include <lib/boot.h>
-#include <lib/pci-tree.h>
+#include <include/boot.h>
+#include <include/pci-tree.h>
void cb_write_tlb(uint32_t mas0, uint32_t mas1, uint32_t mas2, uint32_t mas3, uint32_t mas7) {
mtspr(MAS0, mas0);
diff --git a/src/ppc64/ppc64-uart.c b/src/ppc64/ppc64-uart.c
index 9e6e67c..af9c5b3 100644
--- a/src/ppc64/ppc64-uart.c
+++ b/src/ppc64/ppc64-uart.c
@@ -1,11 +1,10 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
-#include <lib/string.h>
+#include <include/boot.h>
+#include <include/string.h>
/// BUGS: 0
@@ -20,8 +19,7 @@ volatile ascii_char_t* const UART0DR = (ascii_char_t*) NB_NS16550_COM1;
/// @param
/// @return
utf_char_t cb_get_char(void) {
- while (!(*(((volatile uint8_t*) UART0DR) + 0x05) & 0x01))
- ;
+ while (!(*(((volatile uint8_t*) UART0DR) + 0x05) & 0x01));
return (utf_char_t) *UART0DR;
}
diff --git a/src/rv64/rv64-api.s b/src/rv64/rv64-api.s
index ee8b03c..36ea838 100644
--- a/src/rv64/rv64-api.s
+++ b/src/rv64/rv64-api.s
@@ -1,11 +1,7 @@
-# ====================================
-#
-# Amlal El Mahrouss NeBoot
-# (c) Amlal El Mahrouss licensed under Apache 2.0.
-#
-# Purpose: Assembler API for RISC-V
-#
-# ====================================
+# // Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+# // Distributed under the Apache Software License, Version 2.0. (See accompanying
+# // file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+# // Official repository: https://github.com/nekernel-org/neboot
.balign 4
.global cb_flush_tlb
diff --git a/src/rv64/rv64-boot.s b/src/rv64/rv64-boot.s
index 7bd2add..1c48033 100644
--- a/src/rv64/rv64-boot.s
+++ b/src/rv64/rv64-boot.s
@@ -1,13 +1,7 @@
-/*
- * ========================================================
- *
- * NeBoot
- * Copyright 2024, Amlal El Mahrouss, licensed under Apache 2.0.
- *
- * Purpose: Startup code for RISC-V.
- *
- * ========================================================
- */
+# // Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+# // Distributed under the Apache Software License, Version 2.0. (See accompanying
+# // file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+# // Official repository: https://github.com/nekernel-org/neboot
/* Code starts at 8M, everything below is memory mapped hardware. */
diff --git a/src/rv64/rv64-err.c b/src/rv64/rv64-err.c
index a16b703..e1b1ff0 100644
--- a/src/rv64/rv64-err.c
+++ b/src/rv64/rv64-err.c
@@ -1,10 +1,9 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
+#include <include/boot.h>
/// BUGS: 0
diff --git a/src/rv64/rv64-uart.c b/src/rv64/rv64-uart.c
index f92041c..18e7d89 100644
--- a/src/rv64/rv64-uart.c
+++ b/src/rv64/rv64-uart.c
@@ -1,11 +1,10 @@
-/* -------------------------------------------
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
- Copyright (C) 2024, Amlal El Mahrouss, licensed under Apache 2.0.
-
-------------------------------------------- */
-
-#include <lib/boot.h>
-#include <lib/string.h>
+#include <include/boot.h>
+#include <include/string.h>
/// BUGS: 0
@@ -16,8 +15,7 @@ static uint8_t* cb_uart_ptr = (uint8_t*) NB_UART_BASE;
utf_char_t cb_get_char(void) {
uintptr_t ptr = NB_UART_BASE;
- while (!(*(((volatile uint8_t*) ptr) + 0x05) & 0x01))
- ;
+ while (!(*(((volatile uint8_t*) ptr) + 0x05) & 0x01));
return (utf_char_t) *cb_uart_ptr;
}