]>
| description | AdrOS - A Unix-like Operating System for hobby/academic study. |
| last change | Sat, 14 Mar 2026 17:07:48 +0000 (14:07 -0300) |
| homepage URL | https://adros-project.tadryanom.me/ |
| repository URL | https://projects.tadryanom.me/AdrOS |
| mirror URL | https://github.com/tadryanom/AdrOS |
| content tags |
| 3 weeks ago | master | shortlog | log | tree |
AdrOS is a Unix-like, POSIX-compatible, multi-architecture operating system developed for research and academic purposes. The goal is to build a secure, monolithic kernel from scratch, eventually serving as a platform for security testing and exploit development.
make ARCH=x86|arm|riscv|mips; ARM64 and RISC-V boot on QEMU
virt with UART consoleslab_cache_t with
free-list-in-place and spinlockshmget/shmat/shmdt/shmctl)mmap/munmap â anonymous
mappings, shared memory backing, and file-backed (fd) mappings.text segments marked
read-only after ELF load; NX on data segments0xC8000000execve0x007FE000posix_spawn â efficient fork+exec in
single syscall with file actions and attributessetitimer/getitimer (ITIMER_REAL,
ITIMER_VIRTUAL, ITIMER_PROF)fork (CoW),
execve, exit, waitpid
(WNOHANG), getpid, getppidclone syscall with
CLONE_VM/CLONE_FILES/CLONE_THREAD/CLONE_SETTLSset_thread_area via GDT entry 22
(user GS segment, ring 3)FUTEX_WAIT/FUTEX_WAKE with global waiter table
for efficient thread synchronizationsetsid,
setpgid, getpgrpuid/gid/euid/egid;
chmod, chown, setuid,
setgid, seteuid, setegid,
access, umask; VFS permission enforcement on
open()brk/sbrk
syscallnanosleep,
clock_gettime (CLOCK_REALTIME via RTC,
CLOCK_MONOTONIC with TSC nanosecond precision),
alarm/SIGALRM, times (CPU
accounting)int 0x80 + SYSENTER)open, openat,
read, write, close,
lseek, stat, fstat,
fstatat, dup, dup2,
dup3, pipe, pipe2,
select, poll, ioctl,
fcntl, getdents, pread,
pwrite, readv, writev,
truncate, ftruncate, fsync,
fdatasync, flockmkdir,
rmdir, unlink, unlinkat,
rename, chdir, getcwd,
link, symlink, readlink,
chmod, chown, access,
umasksigaction
(SA_SIGINFO), sigprocmask, kill,
sigreturn (full trampoline), sigpending,
sigsuspend, sigaltstack,
sigqueuesetuid, setgid,
seteuid, setegid, getuid,
getgid, geteuid, getegid,
alarm, times, futex,
waitid, posix_spawn, setitimer,
getitimer, pivot_root,
gettimeofday, mprotect,
getrlimit, setrlimit, uname,
getrusage, mountmq_open, mq_close,
mq_unlink, mq_send, mq_receive,
mq_getattr, mq_setattr, sem_open,
sem_close, sem_unlink, sem_wait,
sem_post, sem_getvalueepoll_create, epoll_ctl,
epoll_wait, inotify_init,
inotify_add_watch, inotify_rm_watchaio_read,
aio_write, aio_error, aio_return,
aio_suspendO_NONBLOCK,
O_CLOEXEC, O_APPEND, FD_CLOEXEC
via fcntl
(F_GETFD/F_SETFD/F_GETFL/F_SETFL)flock (advisory locking
with per-inode lock table)shmget,
shmat, shmdt, shmctlclone, gettid,
set_thread_area, futexsocket, bind,
listen, accept, connect,
send, recv, sendto,
recvfrom, sendmsg, recvmsg,
setsockopt, getsockopt, shutdown,
getpeername, getsocknameuser_range_ok,
copy_from_user, copy_to_user)ICANON
clearable via TCSETSSIGTTIN/SIGTTOU enforcement for background
process groupsONLCR
(\n â \r\n) on TTY and PTY slave output;
c_oflag exposed via
TCGETS/TCSETSwrite(fd 1/2) goes through VFS â /dev/console
â TTY line discipline â UART + VGA (industry-standard path matching
Linux)/dev/console as fd 0, 1, 2 before exec init (mirrors Linux
kernel_init)/dev/ptmx +
/dev/pts/N (up to 8 dynamic pairs) with non-blocking I/O,
per-PTY c_oflag and OPOST/ONLCR line disciplineTIOCGWINSZ/TIOCSWINSZTCGETS, TCSETS,
TIOCGPGRP, TIOCSPGRP,
VMIN/VTIME, c_oflagwaitqueue_t
abstraction for blocking I/O/dev/null,
/dev/zero, /dev/random,
/dev/urandom, /dev/console,
/dev/tty, /dev/ptmx, /dev/pts/N,
/dev/fb0 (framebuffer), /dev/kbd (raw
scancodes)/disk with symlinks and hard links/persist/proc/meminfo + per-process
/proc/[pid]/status, /proc/[pid]/mapsreaddir/getdents across all VFS
types; symlink following in path resolutionsocket/bind/listen/accept/connect/send/recv/sendto/recvfromSOCK_STREAM) + UDP
(SOCK_DGRAM) + ICMPdns_resolve() wrappergetaddrinfo / /etc/hosts
â kernel-level hostname resolution with hosts file lookup/dev/fb0 device with
ioctl/mmap for userspace accessCLOCK_REALTIME)init=, root=, console=,
ring3, quiet, noapic,
nosmp); unknown tokens forwarded to init as argv/envp/proc/cmdline â exposes raw kernel
command line to userspaceroot= parameter â auto-detect and
mount filesystem from specified ATA device at /diskksem_t), mutexes (kmutex_t), condition
variables (kcond_t), mailboxes (kmbox_t) with
IRQ-safe signalingclock_gettime_ns() calibrated during LAPIC/PIT window;
CLOCK_MONOTONIC uses sub-microsecond TSC precisionregister_interrupt_handler auto-chains,
unregister_interrupt_handler removesrumpuser
hypercall layer (init, malloc/free, console, clock, random); Phase 1+3
completeprintf,
malloc/free/calloc/realloc,
string.h, unistd.h, errno.h,
pthread.h, signal.h, stdio.h
(buffered I/O with line-buffered stdout, unbuffered stderr,
setvbuf/setbuf, isatty),
stdlib.h (atof, strtol),
ctype.h, sys/mman.h
(mmap/munmap), sys/ioctl.h,
sys/times.h, sys/uio.h,
sys/types.h, sys/stat.h, time.h
(nanosleep/clock_gettime),
math.h, assert.h, fcntl.h,
strings.h, inttypes.h,
linux/futex.h, realpath()ET_EXEC + ET_DYN + PT_INTERP
(dynamic linking)/bin/sh (POSIX sh-compatible
with builtins, pipes, redirects, $PATH search)/bin/cat,
/bin/ls, /bin/mkdir, /bin/rm,
/bin/echo, /bin/cp, /bin/mv,
/bin/touch, /bin/ln, /bin/head,
/bin/tail, /bin/wc, /bin/sort,
/bin/uniq, /bin/cut, /bin/grep,
/bin/sed, /bin/awk, /bin/find,
/bin/which, /bin/chmod,
/bin/chown, /bin/chgrp,
/bin/mount, /bin/umount, /bin/ps,
/bin/top, /bin/kill, /bin/df,
/bin/du, /bin/free, /bin/date,
/bin/hostname, /bin/uptime,
/bin/uname, /bin/env,
/bin/printenv, /bin/id, /bin/tee,
/bin/dd, /bin/tr, /bin/basename,
/bin/dirname, /bin/pwd,
/bin/stat, /bin/sleep,
/bin/clear, /bin/rmdir,
/bin/dmesg, /bin/who,
/bin/pie_test/sbin/init â SysV-like init process (inittab,
runlevels, respawn)/sbin/fulltest â comprehensive smoke test suite (102
checks)/bin/doom.elf â DOOM (doomgeneric port) â runs on
/dev/fb0 + /dev/kbd/lib/ld.so â dynamic linker with auxv parsing, PLT/GOT
lazy relocationld.so â kernel-side relocation
processing for R_386_RELATIVE, R_386_32,
R_386_GLOB_DAT, R_386_JMP_SLOT,
R_386_COPY, R_386_PC32dlopen/dlsym/dlclose syscalls for
runtime shared library loadingElf32_Dyn,
Elf32_Rel, Elf32_Sym, auxiliary vector
(AT_PHDR, AT_ENTRY, AT_BASE)PT_INTERP â interpreter loading at
0x40000000, ET_DYN supportclone syscall â CLONE_VM,
CLONE_FILES, CLONE_SIGHAND,
CLONE_THREAD, CLONE_SETTLSset_thread_area sets
GS-based TLS segment (GDT entry 22, ring 3)gettid â per-thread unique IDpthread.h â
pthread_create, pthread_join,
pthread_exit, pthread_selfFUTEX_WAIT/FUTEX_WAKE with 32-entry global
waiter tablegetpid()
semantics__sync_*
builtins)test_utils.c
(28) + test_security.c (19) +
test_host_utils.sh (68 cross-compiled utility tests)make test-battery)make test-all runs everythingmake ARCH=x86 iso
make ARCH=x86 run
make ARCH=arm
make run-arm
make ARCH=riscv
make run-riscv
make ARCH=mips
make run-mips
QEMU debug helpers: - make ARCH=x86 run QEMU_DEBUG=1 -
make ARCH=x86 run QEMU_DEBUG=1 QEMU_INT=1
See POSIX_ROADMAP.md for a detailed checklist.
All 31 planned POSIX tasks are complete, plus 60 additional features (91 total). The kernel covers ~98% of the core POSIX interfaces needed for a practical Unix-like system. All 102 smoke tests, 16 battery checks, and 115 host tests pass clean. ARM64, RISC-V 64, and MIPS32 boot on QEMU.
Rump Kernel integration is in progress â prerequisites (condition
variables, TSC nanosecond clock, IRQ chaining) are implemented and the
rumpuser hypercall scaffold is in place.
src/kernel/ â Architecture-independent kernel (VFS,
syscalls, scheduler, tmpfs, diskfs, devfs, overlayfs, procfs,
FAT12/16/32, ext2, PTY, TTY, shm, signals, networking, threads, vDSO,
KASLR, permissions)src/arch/x86/ â x86-specific (boot, VMM, IDT, LAPIC,
IOAPIC, SMP, ACPI, CPUID, SYSENTER, ELF loader, MTRR)src/arch/arm/ â ARM64-specific (boot, EL2âEL1, PL011
UART, stubs)src/arch/riscv/ â RISC-V 64-specific (boot, NS16550
UART, stubs)src/arch/mips/ â MIPS32-specific (boot, 16550 UART,
stubs)src/hal/x86/ â HAL x86 (CPU, keyboard, timer, UART,
PCI, ATA PIO/DMA, E1000 NIC, RTC)src/drivers/ â Device drivers (VBE, initrd, VGA,
timer)src/mm/ â Memory management (PMM, heap, slab,
arch-independent VMM wrappers)src/net/ â Networking (lwIP port, E1000 netif, DNS
resolver, ICMP ping test)src/rump/ â Rump Kernel hypercall scaffold
(rumpuser_adros.c)include/ â Header filesuser/ â Userland programs (52 commands:
init.c, sh.c, cat.c,
ls.c, echo.c, cp.c,
mv.c, grep.c, sed.c,
awk.c, find.c, which.c,
ps.c, top.c, kill.c,
mount.c, etc. + ldso.c,
fulltest.c, pie_main.c)user/doom/ â DOOM port (doomgeneric engine + AdrOS
platform adapter)user/ulibc/ â Minimal C library (printf,
malloc, string.h, errno.h,
pthread.h, signal.h, stdio.h,
stdlib.h, ctype.h, math.h,
sys/mman.h, sys/ioctl.h,
sys/uio.h, time.h,
linux/futex.h)tests/ â Host unit tests, smoke tests, GDB scripted
checkstools/ â Build tools (mkinitrd â produces
USTAR archives with LZ4 Frame compression)docs/ â Documentation (POSIX roadmap, audit report,
supplementary analysis, testing plan)third_party/lwip/ â lwIP TCP/IP stack (vendored)