Skip to content

Releases: Alessandro-Salerno/SalernOS-Kernel

SalernOS Kernel 0.2.4

22 Oct 21:12

Choose a tag to compare

New Features

  • Callout (Timer multiplexer)
  • PTYs
  • VFS Symlinks
  • UNIX Domain Sockets
  • Userspace framebuffer device
  • Framebuffer TTYs
  • Vectored I/O (iovec)
  • PS/2 mouse
  • Keyboard & mouse abstraction layers and pseudodevices
  • ACPI support (thanks to uACPI)
  • IOAPIC
  • PCI/PCIe enumeration and kernel driver model
  • SCE (System Call Extension)
  • TSC (Timestamp Counter)
  • New VMM (Virtual Memory Manager): Memory-mapped files, Copy on Write, map on page fault, unmap support
  • New PMM (Physical Memory Manager): caches, faster allocation, page metadata array, improved fragmentation
  • Improved kernel printf (removed old SalernOS 0.0.x code)
  • Basic read/write NVMe 1.0e driver
  • Mutex and Searchtree structures in kernel library (unused for now)
  • More deferred process destruction
  • Bug fixes
  • New bugs
  • More than I'm just forgetting now

New system calls

  • readv / writev (replacing read and write)
  • clock_get
  • faccessat
  • ppoll
  • readlinkat
  • symlinkat
  • unlinkat
  • socket
  • bind
  • listen
  • accept
  • connect
  • sendmsg
  • recvmsg
  • setitimer
  • mkdirat
  • getpeername
  • munmap

Other changes

  • 60 FPS TTYs thanks to new timer multiplexer
  • Limited recursions in VFS lookup
  • Kernel log to vnode to /proc/kernel/log
  • Placed all configuration macros in config/config.h
  • Improved platform abstraction with IPI macros and more
  • Kernel panic IPI & user log
  • SalernOS Boot splash
  • Removed process-global signal masks (removed sigthreadmask system call)
  • New logging subsysetm
  • Removed vlink
  • Maximum number of processes raised from 1,024 to 250,000
  • File descriptor number recycling
  • Maximum number of file descriptors raised to 96
  • Improved lock debugging

Known issues

This release represents the single largest update to the kernel since its inception. As such, partly due to me overworking myself, it is also one of the most buggy and unstable yet. I'm releasing this now to take a break from kernel development for a few weeks. Here's a non-exaustive list of known issues and bugs:

  • CTRL + Z (SIGTSTP) still has some issues: launching a new program while one is stopped will hang the TTY/PTY
  • Some architecture-specific code is still present in common directories. This is not an issue for now as it is mostly testing code, and the kernel is only available for x86-64 anyway
  • Controlling terminals in session structs may have to be held (unconfirmed)
  • The symlinkat system call should be rewritten: mishandling of paths with subdirectories
  • Deadlock between signal delivery and TTY flush (probably a deeper issue with com_sys_sched_notify_*)
  • Signal tests show funky behavior
  • X.org lags without -dumbsched and hangs after awhile (likelly a signal issue)
  • Unaligned NVMe reads (and probably writes as well) return wrong MD5 sums
  • Pressing the power button on real hardware causes a page fault in kernel mode and a subsequent kernel panic
  • Kernel panic IPI causes corrupt log and user output (possible solution: NMI)
  • The icewm window manager does not work properly (seems to exit properly after a button press, probably some POSIX violations and/or missing system calls)
  • People say my PCI BAR calculations are wrong (solution: check the wiki or spec)
  • The new reaper thread seems to avoid freeing zombie processes at times
  • The new PMM's defragmentation system is not fully implemented
  • An interrupt-based system call interface is still present, but broken (allows only up to 4 parameterss, but mmap requires 6)
  • mmap does tricks with PROT_EXEC because we don't have mprotect yet
  • Neofetch does not start (hangs, but the system remains stable)
  • ELF slide causes GCC to crash, but all other programs work fine. Disabled for now, but should be enabled, otherwise NULL is a valid pointer (which is the case now)
  • tmpfs cannot support hard links because it assumes that a vnode can only be present in one directory, but hard links work by having the same vnode in multiple directories
  • X11 windows (especially xterm) sometimes don't close. This is likelly to be a kernel issue, because they used to work in earlier 0.2.4 commits
  • uACPI mutex helpers currently stub to spinlock and semaphore helpers use waitlist (not sure if that's correct)
  • The kernel uses wway too much memory on QEMU TCG and WHPX because these use very high addresses for reserved ranges (solution: keep page meta array only up to highest usable address, not highest address in general)
  • The entire VMM is not thread safe: for example, unmapping a range while DMA to that range is happening will corrupt memory (solution: add range refcounts and hold/release on system calls with pointer arguments)
  • printf("%p") prints wrong number of hex digits

Autogenerated Changelog: kernel-0.2.3...kernel-0.2.4

SalernOS Kernel 0.2.3

26 Jul 14:17

Choose a tag to compare

New features

  • Kernel preemption
  • SMP (Symmetric Multiprocessing)
  • Multithreading (POSIX Threads API)
  • FUTEXes (Fast Userspace Mutexes)
  • Lazy process and thread destruction (uses separate reaper thread)
  • POSIX process management (process groups, sessions)
  • Optional kernel components: the build sysstem now supports toggling features from the src/opt/ directory with the add_option Make function in arch-specific code
    New unified terminal API for serial:fb/BIOS/etc with API
  • New unified terminal abstraction layer and API for (hopefully) terminals of all kinds (serial, framebuffer, BIOS, etc)
  • Kernel Console Layer: TTY multiplexer, can switch between 7 TTYs using RSHIFT + F{1-7}
    New TTYs with overridable backend for PTY and graphical sessions
  • New TTY abstraction layer and API, allowing easier implementation of TTYs of different kinds (PTYs, Kernel Text TTYs, graphical sessions, etc). Text TTYs make use of the Terminal API for portability
  • New System Call API: macros have been added to include/kernel/com/sys/syscall.h (e.g., COM_SYS_SYSCALL(name), COM_SYS_SYSCALL_ARG(type, idx), COM_SYS_SYSCALL_OK(retval) to (hopefully) avoid undefined behaviour while keeping a clean interface
  • Bug fixes
  • New bugs (check known issues)

New system calls

  • pipe
  • clone
  • exit_thread
  • futex
  • getppid
  • getpgid
  • getsid
  • setpgid
  • setsid
  • sigaction
  • sigprocmask
  • sigthreadmask
  • kill
  • Kill_thread
  • sigpending
  • sigreturn
  • dup2 (called dup3)
  • fcntl
  • getcwd
  • chdir
  • fstatat
  • openat (replacing open)
  • readdir
  • close

Other changes

  • Performance improvements: improvements to physical allocation and deallocation, memory initialization, and locking, alongside SMP and Kernel preemption have greatly contributed to this version's performance print
  • The maximum number of processes spawned has been lifted from 256 to 1024, and the maximum number of file descriptors opened has been raised from 16 to 48
  • Hashmap and ringbuffer data structures have been implemented in lib
  • Output through the new Terminal layer can be buffered and flushed at regular intervals to improve framebuffer performance on real hardware
  • System calls can now prevent the dispatcher from returning a value to userspace (useful, for example, in sigreturn where the return value would override registers set inside the syscall code itself)
  • SIGSEGV is now sent to userspace processes that cause a page fault instead of halting the whole kernel (experimental)

Known issues

  • CTRL+Z (SIGTSTP) does not fully resume execution of the parent process (unknown cause)
  • Some architecture-specific code is present in common directories. This is not an issue for now as it is mostly testing code, and the kernel is only available for x86-64 anyway
  • /dev/tty is missing since there's not a mechanism to implement custom open behaviour yet
  • Controlling terminals in session structs may have to be held (unconfirmed)
  • testsigheavy sometimes fails, though the cause is probably not a kernel bug
  • readdir currently does not list character devices as such, since tmpfs has no way of knowing wether an inode is a device. This will have to be fixed (probably by using stat on the node instead of grabbing the information directly). The readdir VFS operation might be moved out of FS implementations and into the VFS itself thanks to vnctl

SalernOS Kernel 0.2.2

01 Jul 17:41

Choose a tag to compare

New features

  • Better PS/2 Keyboard support
  • Shared code for ELF loading in execve and user trampoline
  • New VFS operations

New system calls

  • isatty
  • seek
  • truncate
  • set_tls

Fixes

  • Fixed scheduling issues for arrows in raw mode TTY
  • Fixed signess issues in ELF loading that caused some programs to crash the kernel
  • Fixed mmap POSIX compliance (mmap now returns zeroed pages as expected)

Known issues

  • com_sys_elf64_prepare_proc expects a null-terminated string, but this is not always gauranteed. A pathlen parameter should be added
  • The open syscall does not support O_CREAT

Other changes

  • Limine configuration, initrd, and ISO creation have been moved out of the kernel and into the SalernOS repository

SalernOS Kernel 0.2.1

29 Dec 18:58

Choose a tag to compare

New features

  • Virtual File System
  • Init RAM Disk (initrd) with tmpfs
  • ELF64 loader
  • devfs
  • pipefs (not tested)
  • Flanterm port
  • Framebuffer TTYs (partial)
  • Minimal PS/2 keyboard support

New system calls

  • read
  • write
  • fork
  • execve
  • exit
  • waitpid
  • sysinfo (temporary)

Other changes

  • Context switching now happens in kernel space, details can be found in comments in src/com/sys/sched.c
  • Refactoring
  • Bug fixes
  • kerntool now explicitly uses bash
  • Other changes I don't remember

SalernOS Kernel 0.2.0

08 Dec 20:59
42d67ef

Choose a tag to compare

This is a complete rewrite of the kernel. Only some bits of the PMM from SalernOS Kernel 0.0.x and 0.1.0 have been reused.
This is also the most advanced version of the kernel yet as it features preemptive multitasking, higher half kernel, system calls, and more. Note, however, that this version of the kernel IS NOT capable of loading and running programs, it doesn't even have TTY support.

SalernOS Kernel 0.1.0

28 Nov 13:16

Choose a tag to compare

Originally released on 2023-11-12 (development stopped that day).

This version is no better than the previous ones. It ś a partial rewrite inspired by the Lyre Kernel.

SalernOS Kernel 0.0.6 - Rome

24 Apr 22:44

Choose a tag to compare

New features:

  • Entering (But not leaving) userspace
  • Support for the Simple Boot Specification and newer SEB versions
  • SCE (System Call Extensions)
  • Updated boot screen
  • Fixed GDT and TSS bugs
  • Added simple ACPI Driver via the SBS RSDP Interface
  • Added simple (And poorly written) PCI Driver
  • Added broken AHCI Driver
  • Added broken PIT Driver
  • Added Kernel Heap Manager
  • Other bug fixes
  • Small structural changes

Note: Broken drivers will be rewritten in a future version. They're not fundamentl now, so their malfunctioning does not pose a real issue.
Overall, this is a big old broken and rushed release, I hope to get everything tidied up shortly.

SalernOS Kernel 0.0.5 - Florence

15 Mar 22:42
11a85f5

Choose a tag to compare

  • Code refactoring
  • Performance improvements
  • Bug fixes