diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-12 14:51:30 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-12 14:51:30 +0100 |
| commit | 04abfb60bc52b7b4235202e0c409821cc63c585a (patch) | |
| tree | 90a2fe910d10e4f550e423c6002935fefeab538f /src/arm64 | |
| parent | 4243516705e4a18cbab62a94975a0d992b21a51e (diff) | |
feat: Update 30-PIN specs and implementation. Breaking API changes in
NeBoot as well.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/arm64')
| -rw-r--r-- | src/arm64/arm64-30pin.c | 18 | ||||
| -rw-r--r-- | src/arm64/arm64-boot.S | 6 | ||||
| -rw-r--r-- | src/arm64/arm64-err.c | 8 | ||||
| -rw-r--r-- | src/arm64/arm64-start-context.S | 12 | ||||
| -rw-r--r-- | src/arm64/arm64-uart.c | 14 | ||||
| -rw-r--r-- | src/arm64/script.lds | 2 |
6 files changed, 38 insertions, 22 deletions
diff --git a/src/arm64/arm64-30pin.c b/src/arm64/arm64-30pin.c index 1ab6bc4..c9cbef8 100644 --- a/src/arm64/arm64-30pin.c +++ b/src/arm64/arm64-30pin.c @@ -6,4 +6,20 @@ #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); +size_t nb_parse_30pin(voidptr_t blob, size_t* size, size_t* start_lba) +{ + struct _nb_tpin_recovery_packet* pckt = (struct _nb_tpin_recovery_packet*)blob; + + if (pckt == nil) { + return 0; + } + + if (pckt->mag[0] != NB_30PIN_MAG[0] || pckt->mag[1] != NB_30PIN_MAG[1]) { + return 0; + } + + *size = NB_30PIN_BUFFER_LEN; + *start_lba = 0; + + return *size; +}
\ No newline at end of file diff --git a/src/arm64/arm64-boot.S b/src/arm64/arm64-boot.S index 087aeb8..8327b52 100644 --- a/src/arm64/arm64-boot.S +++ b/src/arm64/arm64-boot.S @@ -5,10 +5,10 @@ ------------------------------------------- */ .section .text -.global cb_reset_vector -cb_reset_vector: +.global nb_reset_vector +nb_reset_vector: ldr x0, =0x40080000 mov sp, x0 - b cb_start_exec + b nb_start_exec diff --git a/src/arm64/arm64-err.c b/src/arm64/arm64-err.c index dd28eb5..5a7c801 100644 --- a/src/arm64/arm64-err.c +++ b/src/arm64/arm64-err.c @@ -9,10 +9,10 @@ /// @brief Goes into a panic state. /// @param reason why? -void cb_panic(const char* reason) { - cb_put_string("panic: "); - cb_put_string(reason); - cb_put_char('\n'); +void nb_panic(const char* reason) { + nb_put_string("panic: "); + nb_put_string(reason); + nb_put_char('\n'); while (yes) { asm volatile("hlt #0"); diff --git a/src/arm64/arm64-start-context.S b/src/arm64/arm64-start-context.S index 8ffae5f..1e2c3e1 100644 --- a/src/arm64/arm64-start-context.S +++ b/src/arm64/arm64-start-context.S @@ -6,11 +6,11 @@ .text .balign 4 -.global cb_start_context -.global cb_boot_processor_ready +.global nb_start_context +.global nb_boot_processor_ready -cb_start_context: - bl cb_start_context +nb_start_context: + bl nb_start_context -cb_boot_processor_ready: - bl cb_boot_processor_ready +nb_boot_processor_ready: + bl nb_boot_processor_ready diff --git a/src/arm64/arm64-uart.c b/src/arm64/arm64-uart.c index d0fe333..461a9ce 100644 --- a/src/arm64/arm64-uart.c +++ b/src/arm64/arm64-uart.c @@ -8,21 +8,21 @@ /// BUGS: 0 -#define ARM64_MMIO_REG(addr) (*(volatile uint32_t*) (cb_uart_ptr + addr)) +#define ARM64_MMIO_REG(addr) (*(volatile uint32_t*) (nb_uart_ptr + addr)) /* this file handles the UART */ -static uint32_t* cb_uart_ptr = (uint32_t*) NB_UART_BASE; +static uint32_t* nb_uart_ptr = (uint32_t*) NB_UART_BASE; -/// @brief Retrieve character from cb_uart_ptr -utf_char_t cb_get_char(void) { +/// @brief Retrieve character from nb_uart_ptr +utf_char_t nb_get_char(void) { while ((ARM64_MMIO_REG(0x018) & (1 << 4))) { } return (utf_char_t) ARM64_MMIO_REG(0x0) & 0xFF; } -void cb_put_char(utf_char_t ch) { +void nb_put_char(utf_char_t ch) { while ((ARM64_MMIO_REG(0x018) & (1 << 5))) { } @@ -31,13 +31,13 @@ void cb_put_char(utf_char_t ch) { /// @brief UART put string /// @param text the input text. -size_t cb_put_string(const char* text) { +size_t nb_put_string(const char* text) { if (text == nil) return 0; size_t i = 0; for (; i < strlen(text); i++) { - cb_put_char(text[i]); + nb_put_char(text[i]); } return i; diff --git a/src/arm64/script.lds b/src/arm64/script.lds index 6daad64..1200f6d 100644 --- a/src/arm64/script.lds +++ b/src/arm64/script.lds @@ -1,4 +1,4 @@ -ENTRY(cb_reset_vector) +ENTRY(nb_reset_vector) SECTIONS { |
