Skip to content

4ipset111/OpenL

Repository files navigation

OpenL OS

32-bit hobby OS in C with custom kernel, RAMFS, shell, and freestanding libc.

Requirements

  • gcc with -m32
  • ld (GNU binutils)
  • grub-mkrescue
  • xorriso
  • qemu-system-i386
  • make
  • timeout + grep + awk (for smoke/CI targets)

Build and Run

make
make iso
make dataimg
qemu-system-i386 -boot d -drive file=openl-data.img,format=raw,if=ide,index=0,media=disk -cdrom openl-os.iso

Short path:

make run

Checks and CI

  • Syntax + basic compile checks:
make check
  • Full build:
make
  • Fast libc smoke in QEMU via serial log:
make smoke-libc

This target:

  • builds kernel with OPENL_CI_AUTOTEST_LIBC=1

  • boots QEMU headless

  • captures serial log to build/smoke-libc.log

  • validates libc tests: X/Y passed

  • fails if X != Y

  • Aggregate CI target:

make ci
  • API documentation:
make docs

Generated site:

  • docs/build/html/index.html

  • Fast local CI loop:

make ci-fast
  • GitHub Actions:
    • workflow: .github/workflows/ci.yml
    • runs make ci for push and pull_request
    • uploads build/smoke-libc.log artifact on failure

Shell UX (current)

  • Prompt: user@openl:/current/path$
  • History navigation:
    • Up/Down for history
    • prefix history search (type prefix, then Up/Down)
    • !! repeats last command
  • Autocomplete:
    • command completion
    • path completion for command arguments
    • segment-aware completion for pipelines (cmd1 | cmd2 ...)

Libc API Status

Implemented headers and APIs:

  • stdio.h:
    • putchar, puts
    • printf, vprintf, snprintf, vsnprintf, sprintf, vsprintf
    • sscanf, vsscanf, perror
    • print_hex, print_hex_bytes
  • string.h:
    • memcpy, memmove, memset, memcmp, memchr, memrchr, memmem
    • strlen, strnlen, strcmp, strncmp, strcoll
    • strcpy, stpcpy, strncpy, strcat, strncat
    • strchr, strchrnul, strrchr, strstr, strnstr
    • strtok, strtok_r, strdup, strndup
    • strspn, strcspn, strpbrk
    • strerror, strerror_r
    • strlcpy, strlcat, explicit_bzero
  • strings.h:
    • strcasecmp, strncasecmp
    • bzero, bcopy, bcmp
    • index, rindex
    • ffs, ffsl, ffsll
  • stdlib.h:
    • abs, labs, llabs
    • atoi, atol, atoll
    • strtol, strtoul, strtoll, strtoull, strtod, strtof, strtold
    • srand, rand
    • qsort, bsearch
    • div, ldiv, lldiv
    • malloc, calloc, realloc, free
    • getenv, setenv, unsetenv, system
    • atexit, exit, abort
  • stdlib_extra.h:
    • itoa, ltoa, utoa
    • atoi_safe, atol_safe
    • utostr, itostr
  • ctype.h:
    • isalpha, isdigit, isalnum, isspace, isblank, isprint, isgraph, iscntrl
    • isupper, islower, ispunct, isxdigit
    • toupper, tolower, isascii, toascii
  • math.h:
    • sin, cos, tan
    • asin, acos, atan, atan2
    • sinh, cosh, tanh
    • exp, log, log10
    • pow, sqrt, cbrt
    • ceil, floor, trunc, round, fabs, fmod
    • fmin, fmax, copysign, hypot, modf, frexp, ldexp
  • time.h:
    • time, clock, difftime
    • ctime, asctime, ctime_r, asctime_r
    • gmtime, localtime, gmtime_r, localtime_r
    • mktime, strftime, strptime (minimal subset)
  • libgen.h:
    • basename, dirname
  • locale.h:
    • setlocale, localeconv
  • signal.h:
    • signal, raise
  • setjmp.h:
    • setjmp, longjmp
  • errno.h:
    • errno + core POSIX-like error codes used by libc

libc Compatibility Notes / Limits

  • printf/snprintf supports core specifiers and common flags:
    • specifiers: %c %s %d %i %u %o %x %X %p %n %f %F %e %E %g %G %a %A %%
    • flags: - + space # 0
    • width + precision (including * width/precision)
    • length modifiers: hh h l ll z t j for integer conversions
  • sscanf/vsscanf supports:
    • integer scans %d %i %u %o %x %p with hh h l ll z t j
    • %s %c %n
    • scanset %[...] and inverted %[^...]
    • floating scans %f %e %g %a with l/L
    • returns -1 on pure input failure (EOF-like behavior)
  • strptime is minimal by design:
    • supported: %Y %y %m %d %H %I %M %S %p %a %A %b %B %j %w %z %Z %F %T %%
  • time subsystem is UTC-only (no timezone database / DST rules)
  • libc is freestanding and intentionally partial versus full glibc/musl

Running libc Tests in Shell

After boot:

test libc

You should see summary:

libc tests: X/Y passed

Roadmap

  1. Improve float-format precision/rounding parity with hosted libc behavior.
  2. Expand scanf compatibility (%[ edge cases, locale-sensitive parsing).
  3. Add file/stream stdio layer (FILE, buffered IO) over kernel FS APIs.
  4. Add per-module test groups and more negative/fuzz-like parser tests.
  5. Add stricter CI stages (separate fast/slow jobs, artifact retention of serial logs).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages