universalisos/microkernel/test/esp32_min.c
Fábio Coutada 62e8454f91 build: add UEFI ISO builder, test boot scripts, EIM config
- make-uefi-iso.sh: UEFI ISO image builder
- test_boot.S, test_boot.ld: test boot assembly and linker script
- eim_config.toml: EIM (External Interface Module) configuration
- edk2-ovmf RPM for UEFI firmware
- GAP_ANALYSIS_PIKEOS_PARITY.md: PikeOS parity gap analysis
2026-07-15 15:33:07 +01:00

26 lines
717 B
C

/* Minimal ESP32 UART test — no kernel, just UART output */
#include <stdint.h>
/* ESP32 UART0 (QEMU uses 0x3FF40000) */
#define UART0_DR (*(volatile uint32_t*)0x3FF40000)
#define UART0_CLKDIV (*(volatile uint32_t*)0x3FF4001C)
#define UART0_CONF0 (*(volatile uint32_t*)0x3FF40020)
static void uart_putc(char c) {
UART0_DR = c;
}
static void uart_puts(const char* s) {
while (*s) uart_putc(*s++);
}
void _start(void) {
/* Init UART */
UART0_CLKDIV = 43; /* 80MHz / 16 / 115200 ≈ 43 */
UART0_CONF0 = (1u << 16) | (1u << 18) | (0x3 << 1); /* FIFO+TX+8N1 */
uart_puts("Xtensa UART OK\n");
for (volatile int i = 0; i < 1000000; i++);
uart_puts("Done\n");
for (;;);
}