feat(ci): early serial mirroring & headless QEMU boot verification with live screenshot
This commit is contained in:
1 parent
107fb45103
commit
73aba4f6f2
4 files changed
+64
-4
No files matched your search
@@ -35,6 +35,54 @@ jobs:
|
|||||||
./scripts/build_iso.sh
|
./scripts/build_iso.sh
|
||||||
ls -lh bin/
|
ls -lh bin/
|
||||||
|
|
||||||
|
- name: Verify Live Boot in QEMU (Headless Test & Live Screen Capture)
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y qemu-system-x86 ovmf imagemagick
|
||||||
|
echo "=== Testing Live Boot in QEMU ==="
|
||||||
|
|
||||||
|
qemu-system-x86_64 -cdrom bin/airlys.iso -m 2048 \
|
||||||
|
-serial file:serial.log \
|
||||||
|
-qmp unix:/tmp/qmp.sock,server,nowait \
|
||||||
|
-display none &
|
||||||
|
QEMU_PID=$!
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
python3 - << 'EOF'
|
||||||
|
import socket, time
|
||||||
|
try:
|
||||||
|
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||||
|
s.connect('/tmp/qmp.sock')
|
||||||
|
s.recv(1024)
|
||||||
|
s.sendall(b'{"execute":"qmp_capabilities"}\n')
|
||||||
|
s.recv(1024)
|
||||||
|
s.sendall(b'{"execute":"screendump","arguments":{"filename":"/tmp/screenshot.ppm"}}\n')
|
||||||
|
s.recv(1024)
|
||||||
|
s.close()
|
||||||
|
print(" [QMP] Screenshot dumped successfully!")
|
||||||
|
except Exception as e:
|
||||||
|
print(f" [QMP] Screenshot notice: {e}")
|
||||||
|
EOF
|
||||||
|
|
||||||
|
kill -9 $QEMU_PID || true
|
||||||
|
|
||||||
|
echo "=================================================="
|
||||||
|
echo "=== KERNEL BOOT SERIAL OUTPUT FROM QEMU RUN ==="
|
||||||
|
echo "=================================================="
|
||||||
|
cat serial.log || true
|
||||||
|
echo "=================================================="
|
||||||
|
|
||||||
|
if [ -f /tmp/screenshot.ppm ]; then
|
||||||
|
convert /tmp/screenshot.ppm boot_screenshot.png
|
||||||
|
ls -lh boot_screenshot.png
|
||||||
|
fi
|
||||||
|
|
||||||
|
grep -q "Kernel Main entered in 64-bit Long Mode" serial.log || {
|
||||||
|
echo "ERROR: Kernel did not reach 64-bit Long Mode!"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
echo " [SUCCESS] Kernel booted and executed in 64-bit Long Mode verified!"
|
||||||
|
|
||||||
- name: Upload Bootable Airlys ISO & Kernel Artifacts
|
- name: Upload Bootable Airlys ISO & Kernel Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -42,4 +90,6 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
bin/airlys.iso
|
bin/airlys.iso
|
||||||
bin/airlys.elf
|
bin/airlys.elf
|
||||||
|
serial.log
|
||||||
|
boot_screenshot.png
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
+6
-3
@@ -33,6 +33,12 @@ static inline bool is_transmit_empty(void) {
|
|||||||
void serial_putchar(char c) {
|
void serial_putchar(char c) {
|
||||||
if (!s_com1_present) return;
|
if (!s_com1_present) return;
|
||||||
|
|
||||||
|
if (c == '\n') {
|
||||||
|
uint32_t to = 50000;
|
||||||
|
while (!is_transmit_empty() && --to > 0) {}
|
||||||
|
if (to > 0) outb(COM1_PORT, '\r');
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t timeout = 50000;
|
uint32_t timeout = 50000;
|
||||||
while (!is_transmit_empty() && --timeout > 0) {}
|
while (!is_transmit_empty() && --timeout > 0) {}
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
@@ -43,9 +49,6 @@ void serial_putchar(char c) {
|
|||||||
void serial_puts(const char* str) {
|
void serial_puts(const char* str) {
|
||||||
if (!s_com1_present || !str) return;
|
if (!s_com1_present || !str) return;
|
||||||
while (*str) {
|
while (*str) {
|
||||||
if (*str == '\n') {
|
|
||||||
serial_putchar('\r');
|
|
||||||
}
|
|
||||||
serial_putchar(*str++);
|
serial_putchar(*str++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <airlys/vga.h>
|
#include <airlys/vga.h>
|
||||||
#include <airlys/vbe.h>
|
#include <airlys/vbe.h>
|
||||||
|
#include <airlys/serial.h>
|
||||||
|
|
||||||
static size_t vga_row;
|
static size_t vga_row;
|
||||||
static size_t vga_column;
|
static size_t vga_column;
|
||||||
@@ -78,6 +79,8 @@ void vga_clear(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void vga_putchar(char c) {
|
void vga_putchar(char c) {
|
||||||
|
serial_putchar(c);
|
||||||
|
|
||||||
if (vbe_is_hardware_framebuffer()) {
|
if (vbe_is_hardware_framebuffer()) {
|
||||||
vbe_console_putchar(c, vga_to_rgb(vga_current_color));
|
vbe_console_putchar(c, vga_to_rgb(vga_current_color));
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -45,7 +45,11 @@ static void aira_sentinel_task(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void kernel_main(uint64_t magic, uint64_t addr) {
|
void kernel_main(uint64_t magic, uint64_t addr) {
|
||||||
/* Step 0: Extract Hardware Framebuffer immediately (UEFI GOP / VBE Tag 16 / MB1) */
|
/* Step 0: Initialize COM1 serial port for real-time diagnostic output */
|
||||||
|
serial_init();
|
||||||
|
serial_puts("\n[AIRLYS SOVEREIGN OS] Kernel Main entered in 64-bit Long Mode!\n");
|
||||||
|
|
||||||
|
/* Step 0b: Extract Hardware Framebuffer immediately (UEFI GOP / VBE Tag 16 / MB1) */
|
||||||
if (magic == 0x36D76289 && addr != 0) {
|
if (magic == 0x36D76289 && addr != 0) {
|
||||||
uint32_t total_size = *(volatile uint32_t*)addr;
|
uint32_t total_size = *(volatile uint32_t*)addr;
|
||||||
uint8_t* tag_ptr = (uint8_t*)(addr + 8);
|
uint8_t* tag_ptr = (uint8_t*)(addr + 8);
|
||||||
|
|||||||
Reference in new issue
Block a user