Releases: Alessandro-Salerno/SalernOS-Kernel
SalernOS Kernel 0.2.4
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(replacingreadandwrite)clock_getfaccessatppollreadlinkatsymlinkatunlinkatsocketbindlistenacceptconnectsendmsgrecvmsgsetitimermkdiratgetpeernamemunmap
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
sigthreadmasksystem 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
symlinkatsystem 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
-dumbschedand 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
mmaprequires 6) mmapdoes tricks withPROT_EXECbecause we don't havemprotectyet- 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
NULLis a valid pointer (which is the case now) tmpfscannot 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
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 theadd_optionMake 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
pipecloneexit_threadfutexgetppidgetpgidgetsidsetpgidsetsidsigactionsigprocmasksigthreadmaskkillKill_threadsigpendingsigreturndup2(calleddup3)fcntlgetcwdchdirfstatatopenat(replacingopen)readdirclose
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
sigreturnwhere the return value would override registers set inside the syscall code itself) SIGSEGVis 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/ttyis missing since there's not a mechanism to implement custom open behaviour yet- Controlling terminals in session structs may have to be held (unconfirmed)
testsigheavysometimes fails, though the cause is probably not a kernel bugreaddircurrently does not list character devices as such, sincetmpfshas no way of knowing wether aninodeis a device. This will have to be fixed (probably by usingstaton the node instead of grabbing the information directly). ThereaddirVFS operation might be moved out of FS implementations and into the VFS itself thanks tovnctl
SalernOS Kernel 0.2.2
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
mmapPOSIX compliance (mmapnow returns zeroed pages as expected)
Known issues
com_sys_elf64_prepare_procexpects a null-terminated string, but this is not always gauranteed. Apathlenparameter should be added- The
opensyscall does not supportO_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
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
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
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
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
- Code refactoring
- Performance improvements
- Bug fixes