From 7df7ed6d026c5e1f3b8111e3536af3771301c177 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 28 Dec 2025 09:30:38 +0100 Subject: feat! firmware breaking changes on the API. Signed-off-by: Amlal El Mahrouss --- src/arm64/arm64-30pin.c | 13 ++++++------- src/arm64/arm64-err.c | 11 +++++------ src/arm64/arm64-uart.c | 13 ++++++------- src/hal/neboot-ahci-driver.c | 13 ++++++------- src/hal/neboot-flash-driver.c | 8 ++++---- src/neboot-bootnet.c | 11 +++++------ src/neboot-cpu-api.c | 14 ++++++-------- src/neboot-cxx-abi.cc | 12 +++++------- src/neboot-partition-map-parse.c | 11 +++++------ src/neboot-partition-map.c | 16 +++++++--------- src/neboot-pci-tree.c | 13 ++++++------- src/neboot-print-name.c | 11 +++++------ src/neboot-start.c | 19 +++++++++---------- src/neboot-string.c | 11 +++++------ src/ppc64/ppc64-boot.S | 5 +++++ src/ppc64/ppc64-err.c | 11 +++++------ src/ppc64/ppc64-hal.c | 17 ++++++++--------- src/ppc64/ppc64-uart.c | 16 +++++++--------- src/rv64/rv64-api.s | 12 ++++-------- src/rv64/rv64-boot.s | 14 ++++---------- src/rv64/rv64-err.c | 11 +++++------ src/rv64/rv64-uart.c | 16 +++++++--------- 22 files changed, 125 insertions(+), 153 deletions(-) (limited to 'src') 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 -#include +#include +#include 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 +#include /// 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 -#include +#include +#include /// 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 -#include +#include +#include #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 -#include -#include -#include +#include +#include +#include +#include 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 +#include 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 +#include /// @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 +#include /// 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 +#include 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 -#include +#include +#include // 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 -#include +#include +#include /// 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 +#include /// @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 -#include -#include -#include +// 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 +#include +#include /// 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 +#include /// 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 +#include /// 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 -------------------------------------------- */ - -#include -#include - -#include -#include +#include +#include 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 -#include +#include +#include /// 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 +#include /// 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 -#include +#include +#include /// 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; } -- cgit v1.2.3