]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
docs: update features/todo and build guide
authorTulio A M Mendes <[email protected]>
Fri, 6 Feb 2026 14:41:57 +0000 (11:41 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 6 Feb 2026 14:41:57 +0000 (11:41 -0300)
BUILD_GUIDE.md
README.md
src/arch/x86/boot.S

index 0208288cbaa64672b377790be96b50e3ea473555..dd2f7f44612b09be0810bd08c98738d903becf50 100644 (file)
@@ -31,43 +31,27 @@ make ARCH=x86
 Isso gera o arquivo `adros-x86.bin`.
 
 ### Criar ISO Bootável (GRUB)
-Para x86, precisamos empacotar o kernel numa ISO com GRUB.
+Para x86, o repositório já inclui uma árvore `iso/` com o GRUB configurado.
 
-1. Compile o gerador de InitRD:
 ```bash
-gcc tools/mkinitrd.c -o mkinitrd
+make ARCH=x86 iso
 ```
 
-2. Crie arquivos de teste:
-```bash
-echo "Hello from File System!" > test.txt
-echo "AdrOS v0.3" > version.txt
-./mkinitrd initrd.img test.txt version.txt
-```
+Isso gera `adros-x86.iso`.
 
-3. Empacote a ISO:
+### Rodar no QEMU
 ```bash
-mkdir -p iso_root/boot/grub
-cp adros-x86.bin iso_root/boot/
-cp initrd.img iso_root/boot/
-
-cat > iso_root/boot/grub/grub.cfg << EOF
-menuentry "AdrOS" {
-    multiboot2 /boot/adros-x86.bin
-    module2 /boot/initrd.img
-    boot
-}
-EOF
-
-grub-mkrescue -o adros.iso iso_root
+make ARCH=x86 run
 ```
 
-### Rodar no QEMU
+Saídas/artefatos gerados:
+- `serial.log`: log do UART (saída principal do kernel)
+- `qemu.log`: só é gerado quando o debug do QEMU está habilitado (veja abaixo)
+
+Para habilitar debug do QEMU (mais leve por padrão, para evitar travamentos por I/O excessivo):
 ```bash
-qemu-system-i386 -cdrom adros.iso -serial stdio
+make ARCH=x86 run QEMU_DEBUG=1
 ```
-- A saída de texto aparecerá no terminal (`-serial stdio`).
-- Se tivermos VGA ativado, uma janela gráfica abrirá.
 
 ## 3. Compilando e Rodando (ARM64)
 
@@ -104,5 +88,5 @@ qemu-system-riscv64 -machine virt -m 128M -nographic \
 ## 5. Troubleshooting Comum
 
 - **"Multiboot header not found"**: Verifique se o `grub-file --is-x86-multiboot2 adros-x86.bin` retorna sucesso (0). Se falhar, a ordem das seções no `linker.ld` pode estar errada.
-- **Triple Fault (Reset infinito)**: Geralmente erro na tabela de paginação (VMM) ou IDT mal configurada. Use `-d int,cpu_reset -D log.txt` no QEMU para debugar.
+- **"Triple Fault (Reset infinito)"**: Geralmente erro na tabela de paginação (VMM) ou IDT mal configurada. Rode `make ARCH=x86 run QEMU_DEBUG=1` e inspecione `qemu.log`.
 - **Tela preta (VGA)**: Se estiver rodando com `-nographic`, você não verá o VGA. Remova essa flag para ver a janela.
index b5490f0973f33ad1fa3d8be332dea34aa946fdf5..d1f7593f71d3f8941f96834cf7b5af37959c87e4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -14,6 +14,55 @@ AdrOS is a multi-architecture operating system developed for research and academ
 - **Bootloader:** GRUB2 (Multiboot2 compliant)
 - **Build System:** Make + Cross-Compilers
 
+## Features
+- **Multi-arch build system**
+  - `make ARCH=x86|arm|riscv|mips`
+  - x86 is the primary, working target
+- **x86 (i386) boot & memory layout**
+  - Multiboot2 (via GRUB)
+  - Higher-half kernel mapping (3GB+)
+  - Early paging + VMM initialization
+  - W^X-oriented linker layout (separate RX/R/RW segments)
+  - Non-executable stack markers in assembly (`.note.GNU-stack`)
+- **Memory management**
+  - Physical Memory Manager (PMM)
+  - Virtual Memory Manager (x86)
+  - Kernel heap allocator (`kmalloc`/`kfree`)
+- **Basic drivers & console**
+  - UART serial console logging
+  - VGA text console (x86)
+  - Keyboard driver + input callback
+  - PIT timer + periodic tick
+- **Kernel services**
+  - Simple scheduler / multitasking (kernel threads)
+  - Basic shell with built-in commands
+- **InitRD + VFS glue**
+  - InitRD-backed filesystem node tree
+  - Minimal VFS helpers (`vfs_read`/`vfs_write`/open/close)
+- **Syscalls & ring3 bring-up (x86)**
+  - `int 0x80` syscall gate
+  - `SYSCALL_WRITE`, `SYSCALL_EXIT`, `SYSCALL_GETPID`
+  - Centralized user-pointer access API (`user_range_ok`, `copy_from_user`, `copy_to_user`)
+  - Ring3 stub test program with fault-injection for invalid pointers
+
+## TODO
+- **Multi-architecture kernel bring-up**
+  - Implement VMM/interrupts/scheduler for ARM/RISC-V/MIPS
+  - Standardize arch entrypoint behavior (`arch_start`) across architectures
+- **Userspace**
+  - Real userspace loader (e.g., ELF)
+  - Process address spaces + page fault handling
+  - Safer syscall ABI expansion
+- **Virtual memory hardening**
+  - Reduce early identity mapping further (keep only what is required)
+  - Guard pages, user/kernel separation checks beyond current page-walk
+- **Filesystem**
+  - Persisted storage (ATA/AHCI/virtio-blk or similar)
+  - Path resolution, directories, permissions
+- **Observability & tooling**
+  - Better memory stats (`mem` shell command)
+  - Debug facilities (panic backtraces, symbolization, structured logs)
+
 ## Directory Structure
 - `src/kernel/` - Architecture-independent kernel code
 - `src/arch/` - Architecture-specific code (boot, context switch, interrupts)
index 958003896962cc607f11c43f6076b32e1dc88619..7f06759c3a664185c585d9e76816234623daaf8b 100644 (file)
@@ -192,4 +192,4 @@ stack_top:
 .section .note.GNU-stack,"",@progbits
 
 /* Helper symbol for map loop limit */
-_kernel_physical_end:
\ No newline at end of file
+_kernel_physical_end: