-
Luna September 13 Release - 0.7.0 "Pulsar"
All checks were successfulBuild and test / build (push) Successful in 1m45sreleased this
2024-09-07 15:40:39 +00:00 | 57 commits to main since this releaseIt's been a while since the last one, huh?
Activity in Luna has died down quite a bit - but 8 months are still enough for quite a few changes, even if none of them too flashy.
As you can see, my QEMU menu bar is now white, for some reason.
The only difference between this picture and the one for 0.6.0 (apart from the version info) is the process list, which as you can see shows there's been some behind-the-scenes changes in the organization of processes (and yes, clock and about are missing- I ran ps first).
New features:
- Add more functionality to libos's Timers
- Add a (user) prefix to init's logs when not running as system init (PID 1)
- Add startui, which starts and manages an entire UI session
- Add a second unix socket for privileged wind clients which need to be in a different group
- Add a background launcher service
- Make os::IPC code object-oriented and add functionality for properly receiving messages
- Add a wind request for setting special window attributes
- Add a basic Gitea actions file
- Add LinkedList tags to libluna
- Add kernel support for extended keyboard scancodes
- Use the arrow keys and the Home key as input in 2048
- Add run, a command-line utility to start an app detached from the terminal session
- Add kernel support for regular ATA drives (non-ATAPI)
- Add ways to format output to an os::File
- Add libwind port (to use wind APIs in third-party ports)
- Add doomgeneric port
- Add a _POSIX_VERSION define to libc
- Make taskbar entries configurable
- Add taskbar entry for 2048
- Add support for a shadow file and use it by default
- Add a basic text editor
- Add support for keyboard shortcuts directly in libui
- Split shell code into multiple files, add the "echo" builtin, and add support for a .shellrc file
- Try to grow the process stack on stack overflows, up to a maximum of 8MB
- Add (slightly outdated) documentation for the boot process in boot_process.md
- Implement hash table iteration in libluna
- Add a SHA256 hash implementation
- Add endianness-dependent functions to libc (endian.h)
- Add the "arch" command (equivalent to uname -m)
- Add a os::Notifier API to know when child processes have finished initialization
- Add a login UI
- Add a reference-counted immutable string type
- Add a standard API for config file access
- Add a hackish "logout" command
Fixes:
- Make ui::App::process_events() private
- Make os::EventLoop callbacks more versatile
- Stop using magic numbers for user and group IDs in wind
- Change ui::App::init() to take the socket path directly instead of command-line arguments
- Handle aborted connections in the kernel instead of crashing
- Rename SetTitlebarRect in libui to SetTitlebarHeight
- Fix libc's memmove when dest > src (this was crashing gcc, and this fix finally made gcc work!)
- Fix String::from_string_view construction for inline strings
- Fix mpfr download url
- Build gcc without --enable-checking
- Avoid starting a shell to spawn test processes
- Correct a bunch of format strings
- Show which wind IPC function was called with an invalid window id
- Ignore alpha bits in wind's window buffer
- Make luna-pkg-config executable
- Implement strtoll and strtoull as functions
- Use the correct architecture in make-package.sh
- Close all pipe file descriptors in popen() after dup2() is called
- Properly initialize the kernel's shebang read buffer with zeros
- Change the year in the default ArgumentParser copyright message (yes, this took a while)
- Map kernel-side pages as global to avoid TLB flushes
- Remove the server->client wind message "WindowCloseRequest"
- Correct description for the login service
- Change ownership of skeleton files when copying them to the home folder
- Show an error message when attempting to copy a directory into a file using cp
- Prevent kernel threads from calling exit_and_signal_parent()
- Partially implement freopen() when a null pathname is provided
- Avoid assuming endianness in ATA kernel functions
- Reorder directory structure
- Use SIGQUIT to restart the taskbar instead of SIGHUP
- Make StorageCache have a reference to its parent BlockDevice
- Make libluna's new and delete weak to avoid conflicts with libstdc++
- Clean up LocalServer's socket file on exit
- Remove /tmp/launch.sock as root when starting a new launch process
As always, you can download this release from pub.cloudapio.eu. Keep in mind that this release now has a login UI (usually disabled in development builds, but not here!), so you'll have to use the username "selene" and the password "moon" to log in (or username "root" and password "toor" for a superuser session).
Downloads
-
released this
2024-01-06 18:46:42 +00:00 | 191 commits to main since this releaseHappy new year!
As you can see from the date of the previous release, monthly beta releases are a thing of the past. I don't think I can manage doing a full release every month (depends on what you call a release), as I've not been working on Luna that much, and I prefer not having a deadline. From now on, releases will be whenever there's enough interesting things to show and the system is reasonably stable :)
And yes, I know this release is still beta, but I decided the changes here were enough to warrant a new release name.
The big change (drum roll...)
Luna has gone graphical! (#38)
I had a lot of fun implementing the GUI over the summer, but I kept delaying making a release out of it since I felt it was not good enough for a release. During the following months, I have been adding a few nice features (event loops, running as a separate user, client side decorations), and although it is still far from complete, I feel it is good enough (and stable) to release!
Part of this has been removing the virtual terminal support from the kernel. I think a full-blown terminal emulator should not be built into the kernel, but for people who want a full-CLI environment, the kernel provides enough primitives to implement one in userspace (something like kmscon for example).
Additionally, I don't want to build a GUI on top of a TTY. In Linux (as far as I know), GUI sessions are started inside an obligatory TTY session (for example /dev/tty1). I prefer having the CLI be optional.
The GUI system is made up of:
- A display server, /usr/bin/wind. (The name stands for WINdow Daemon, even though it's not a daemon, I liked the name). The display server only handles window compositing (the windows are rendered directly as provided by client programs, even the titlebar is client-side) and moving, and input, everything else is done by other programs. The idea is to make the GUI as modular as possible. Applications connect to the display server through the UNIX socket located at /tmp/wind.sock. This means only one GUI session can run at a time, I'll see if I want to change this in the future or not.
- A UI library, libui. This library communicates with the display server, draws window titlebars (in the future, applications will be allowed to override this and make their own titlebars if they so desire), dispatches events to their proper handlers and provides a widget system for applications to compose UIs. It also contains code to draw PSF font glyphs, and decode and draw TGA images.
- A taskbar, /usr/bin/taskbar. It operates completely independently from the display server, and uses the same APIs as any other UI program (it does not have any special privileges within the UI system). It does not draw a titlebar, and queries the screen size to draw itself in the correct position (which any application could do if they wanted to). The entries in the taskbar are built-in for now. One problem that stems from the fact that it is treated as a normal window is that windows can be dragged on top, and clicking on it can remove the focus from another window. I might change this in the future, however for now I'm not sure how I want to do it.
- UI applications! Currently only a terminal emulator, a clock, an about dialog, a game of life simulation, and a 2048 game (must be run from the terminal, since it is not on the taskbar yet. The program is at /bin/2048).
Other significant features
1. Pseudoterminals
PTYs were a prerequisite for implementing a GUI terminal in userspace.
2. POSIX timers and setitimer()
Programs might want more flexible timers than alarm(), with precision less than one second. First, setitimer() was added, then the POSIX timer API, which lets you create multiple timers at once. This can be used with libos's EventLoops using the os::Timer class.
3. Supplementary groups
Extra groups were added in this release, which were needed to run the display server as a separate user while still making sure programs could connect to it. No id program to read your supplementary groups yet though.
4. POSIX sessions
Allows for greater control over pseudoterminals, also used in the GUI system.
5. GCC can be compiled for Luna
Note the use of the word "compiled": a GCC executable for Luna can be produced. Programs cannot be compiled with it yet. It used to crash soon after startup because of an issue we had with global constructors, but that was fixed. Now it crashes in the middle of the compilation process. Woo, progress!!
Other features:
- Add support for files larger than 4MB in the ext2 driver
- Improve the kernel mutex system
- Add POLLHUP to the poll() syscall and store it when a polled socket's peer disconnects
- Add basic IPC message framework to libos
- Allow performing extra actions when opening an inode
- Allow sending signals to process groups from userspace
- Allow mapping the framebuffer even if its size is not page-aligned
- Remove the kernel TTY and support only userspace terminals
- Move pseudoterminal input processing to kernel-space
- Implement openpty() and forkpty()
- Add support for WorkingDirectory keys to init
- Support the -R flag and add better verbose messages to cp
- Add a 2048 game
- Add a clock application
- Lookup and print symbols for addresses in backtraces
- Handle SIGCHLD signals in init
- Add /dev/tty
- Add ctermid, pclose, WUNTRACED, and a madvise stub
- Move kernel file descriptor code into its own separate file
- Add a registry for file system implementations
- Implement thread stopping and continuing
- Add a timer queue with more versatility than simple alarm()
- Add setitimer()
- Add support for supplementary groups
- Allow disabled passwords and support supplementary groups in su
- Recognize sockets properly in stat
- Add stack diagnostics to userspace fault reporting
- Add a useful script to develop ports
Fixes:
- Fix sector number calculation for ATA drives
- Remove unused legacy variable from sys_mmap()
- Remove some shared pointers in libos and change them to owned/live on the stack
- Fix the poll() syscall
- Handle interrupted reads properly in IPC code
- Fix sending signals to threads that are in a long syscall
- Start clearing caches when free memory is lower than 4MiB
- Schedule cache clears only on certain checkpoints
- Do not allow sending signals to dying threads
- Avoid page faults when reading from a slave pseudoterminal after the master is destroyed
- Rename Scheduler::new_userspace_thread in the kernel to clarify that it's only meant for init
- Remove unused stray script file
- Fix off-by-one error in kernel symbol lookup and add locking
- Add locking to BinaryFormat and DeviceRegistry
- Show symbols correctly when at the beginning of a function
- Rework the entire time system to use modular clocks
- Set the initial foreground process group when acquiring a controlling terminal
- Correctly register file times for more file systems and file types
- Call global constructors in userspace code
- Show stacktraces on all signal terminations
- Reenable stack tracing in kernel-mode exceptions
- Unify panic messages
- Fix kernel panic when adding a timer before another one
- Read password from /dev/tty instead of stdin in su
Try this release: Luna-0.6.0.iso
Command:
qemu-system-x86_64 -cdrom Luna-0.6.0.iso -enable-kvm -m 1G -serial stdio
Downloads
-
Luna September 5 release - 0.5.0
All checks were successfulcontinuous-integration/drone/push Build is passingreleased this
2023-09-05 08:56:28 +00:00 | 384 commits to main since this releaseSame release name, still an alpha release.
This month (the release was supposed to be at the end of August but I'm a bit behind schedule)'s big features:
1. UNIX local domain sockets
Yes! No internet support, but local communication sockets are now supported on Luna. They are used through the standard Berkeley sockets API, and only support the SOCK_STREAM socket type.
This was a prerequisite for a window server and graphical system (still being worked on in #38).2. Shebang scripts and multiple binary formats
This month, support for shebang scripts (scripts that begin with a line like
#!/bin/sh
or#!/bin/python3
and are treated as normal executables) was added, along with an extensible framework for other executable formats to be added in the future, even allowing for a future subsystem in userspace similar to Linux's binfmt_misc.3. Raw input support
Previously, the only way to read keyboard input was through the TTY. But that has only its own keyboard layout, reads output in lines, and many more things that wouldn't work for a desktop. Now, there is a raw keyboard input device that can be switched on, turning the TTY off, and a raw mouse input device, which wasn't present before.
4. Shared memory
Another prerequisite for a GUI system, anonymous shared memory can be created via mmap(MAP_SHARED | MAP_ANONYMOUS) and most files can also be mapped as shared. POSIX shared memory support is provided via the /dev/shm RAM filesystem, as is done in Linux.
5. Third-party software ports
This month, Luna gained a new system to store port patches and build and install them onto the system root, letting some software be properly ported to Luna, such as the GNU binutils suite.
6. Simple program sandboxing using pledge()
The pledge() call, borrowed from OpenBSD, is a simple way to restrict process operations to limit the damage caused by a potential security vulnerability in a program. This mechanism is not intended to protect from malicious programs, as pledges can be removed by a call to exec (if it is allowed by the process' current set of promises). That will hopefully come later.
7. Greater terminal functionality
Finally, the Luna TTY has a blinking cursor! Also, colors.
Luna now supports basic escape sequences, allowing for color changes and cursor movement. This is used in the shell to add a colorful prompt, and in ls to distinguish file types.
Hopefully coming soon (next month?), a proper terminal editor using this functionality. I can't wait to get rid of edit.Other features:
- Make HashTable and Vector grow exponentially
- Start documenting the entirety of libluna (not finished, libluna is too large to document it all in a single release)
- Add a Bitset class to libluna
- Make edit more user-friendly
- Add a configurable service directory to init
- Add welcome and license files to the OS
- Add the free utility
- Add a memstat() system call
- Make disk reads cached, with cache memory reclaimed on OOM
- Implement popen/pclose
- Use pledge in init
- Add support for init --user
- Add a pledge wrapper to libos
- Build the GNU libstdc++ for third-party ports
- Add alarm() and getpagesize()
- Add putenv() and strcoll()
- Add some math.h functions (wrappers around GCC builtins)
- Add the touch utility
- Add support for file times
- Add Process::spawn() to libos
- Use memory-mapped IO in gol
- Add the poll() system call
- Install kernel API headers into /usr/include/moon
- Add a PS/2 mouse driver
- Add CircularQueue::is_empty()
- Add a variant of CircularQueue that dynamically allocates its buffer at runtime
- Add kernel functionality to allow external inodes (such as sockets) to acquire an inode number from a file system
- Add Buffer::dequeue_data()
- Add the SIGWINCH signal
- Reenable userspace stack tracing, but hidden behind a config flag
- Actually implement sigsetjmp() and siglongjmp()
- Add bc port
Fixes:
- Remove the pivot_root utility
- Handle tab properly in the kernel TTY
- Use /usr/bin instead of /bin everywhere
- Store the full command line of a process
- Move the scanf implementation from libc to libluna
- Stop using syscalls directly in libos
- Avoid scrubbing malloc memory in places where the memory is already going to be overwritten
- Validate the hostname in init
- Move luna/Syscall.h to the kernel API directory
- Completely prevent sending signals to kernel threads
- Remove many legacy test apps
- Install libluna.a and libos.a into the system root
- Use libluna Buffers in more places instead of manually allocating memory
- Return SIGPIPE/EPIPE when writing to a pipe with no more readers
- Detect more cases of no DMA support
- Avoid memory leaks when calling kernel_exit()
- Reset the read buffer even when read() returns an error
- Properly check memory bounds in strdup_from_user()
- Properly check memory bounds while touching user memory
- Allow null envp in execve()
- Store FD_CLOEXEC in the file descriptor itself
- Remove make_array() and destroy_array()
- Create a new process group to log in
- Properly propagate errors through fgetc() and File::getchar()
- Rework the kernel VFS metadata system to make it simpler
- Set the close-on-exec flag for directories opened using opendir()
- Remove support for 'Script' parameters in init config files
- Rename Inode::blocking() to Inode::will_block_if_read()
- Separate FileDescriptors and OpenFileDescription in the kernel
- Store SharedPtr's ref count in the object itself
- Use pid_t internally in the kernel for process IDs
- Fail on invalid interrupts instead of calling FIXME_UNHANDLED_INTERRUPT
- Wrap around when iterating through a HashTable's buckets array
- Include waited-for grandchildren in RUSAGE_CHILDREN's times
- Fix comparison of StringViews without null termination
- Change program description for stat
- Error out on bidirectional characters
- Make init's log stream line-buffered
- Log the release name and build date in the boot log
ISO: pub.cloudapio.eu
Downloads
-
Luna July 22 release - 0.4.0 "Mercury"
All checks were successfulcontinuous-integration/drone/push Build is passingreleased this
2023-07-22 11:32:40 +00:00 | 579 commits to main since this releaseThis month's release features five big new features:
1. Ext2 filesystem support (read-only)
Having disk access is nice, but not really useful if you don't have a file system driver to actually access files on the disk.
This release adds read-only support for the Ext2 filesystem, and uses it as the root file system (but /tmp and /home/selene are still writable, don't worry!).
This means that we can store a lot more stuff in the root filesystem (since we're not running off an initial ramdisk), including the entire sysroot (/usr/lib, /usr/include, etc).
This driver is missing many features (file size is limited to 4 MB, no caching, and obviously no writing), but it's fully usable!
2. Basic POSIX signal support
Signals are an important part of POSIX (and C) compatibility, and almost all third-party software has calls to signal() somewhere. Plus, who doesn't want to interrupt their running programs using ^C? (although that requires the fourth feature as well).
This release adds basic POSIX signal support, although some features are still missing (alternate stack, siginfo_t, stopping and continuing, core dumps), and not all signals are defined.
3. Enhanced termios compatibility
Terminals are complicated, and termios.h is full of parameters. Before this release, termios support was limited to turning echoing off and on, without even using termios (using direct ioctls).
This release adds termios.h, tcgetattr, tcsetattr, and more. The termios structure has also been enhanced with MANY more control flags for applications to control their terminal.
4. Foreground and background process groups (basic job control)
POSIX terminals/job control depend on process groups (and sessions, but that's not yet implemented) for a few things, namely sending terminal signals such as ^C (SIGINT) or ^Z (SIGTSTP).
This release adds process groups to the kernel, a foreground process group to the terminal, and the shell controls this foreground process group to manage jobs.
It also adds ^C and ^\ to send signals to the terminal's foreground process group.
There are a few unimplemented things in process groups (orphaned process groups) for now.
5. stdio and os::File buffering
With the introduction of Ext2 (especially without caching), buffering has been needed in the standard library more than ever.
This release adds read and write buffers to stdio's FILE, adds setvbuf(), and properly implements fflush() and ungetc(). os::File is also now a wrapper around stdio's FILE, to get the same benefits.
Other features:
- Add release names and implement them in uname (alpha releases will have the name "Mercury" from now on)
- Improve formatting scripts
- Add os::Process::exit()
- Improve shell builtins and add a few (exit, set, unset)
- Add a simple Game of Life implementation
- Use an alternate kernel stack for exceptions
- Run tests in a headless manner automatically on CI
- Allow 'Description' fields in init service files
- Implement isatty()
- Checksum validation of GPT headers
- Panic the kernel when init exits
- Use the config.cmake file
- Stop showing memory usage stats in the early boot log
- Add a source parameter to the mount() system call
- Add cp
- Make the kernel filename restrictions on creation configurable
- Add prompting functions to libos
- Move user threads' page directories to UserVM and rename it to AddressSpace
- More string functions
Fixes:
- Avoid copying and reallocation when creating Strings
- When allocating zeroed memory, zero physical frames instead of virtual pages
- Don't keep the first page directory it uses for the idle thread
- Preserve temporary page directory changes across task switches
- Make the CRC32 algorithm actually work
- Only show kernel addresses in exception backtraces
- Don't create a new kernel stack on exec (fixes a sizeable memory leak)
- Check for manual modifications of environ
- Do not use KVM when it's not supported
- Avoid making the tests interfere with the main build directory
ISO: pub.cloudapio.eu
Downloads
-
Luna June 19 release - 0.3.0
All checks were successfulcontinuous-integration/drone/push Build is passingreleased this
2023-06-19 11:17:14 +00:00 | 691 commits to main since this releaseChangelog:
- Make the stack and loaded program code regions persistent
- Add freopen()
- Show stack traces on page faults and general protection faults
- Make sure the stack is 16-byte aligned on program startup
- Add the scanf() family functions
- Update the VM allocator for userspace to use a linked list
- Make long value arguments use '=' and make value arguments' values always required
- Provide more meaningful panic messages for critical failures
- Make the root inode be a mountpoint as well
- Add the pivot_root() system call
- Add a basic HashMap and HashTable
- Add GUID partition table (GPT) support
- Add Master Boot Record (MBR) support
- Mount the /dev file system in userspace
- Add ATA controller support and ATAPI drive reading
- Add os::Process::wait()
- Document libos entirely using Doxygen comments
- Fix 0-delay sleeps blocking forever
- apps: Add sysfuzz, mktemp
- Add sticky bit support
- Create /tmp and mount it on boot
- Sort ls output
- Support comments in shell scripts
- Fix a bunch of libc compatibility issues
- Fix many bugs
I also managed to port nasm/ndisasm (shown in the screenshot, not in the repo at the moment) with the current set of features and fixes (and patching out a call to setvbuf). Sadly, the assembled program cannot be run as it is a flat binary and there's no linker ported yet to generate ELF programs.
ISO: pub.cloudapio.eu
Downloads
-
Luna May 27 release - 0.2.0
All checks were successfulcontinuous-integration/drone/push Build is passingreleased this
2023-05-27 17:40:03 +00:00 | 791 commits to main since this releaseChangelog:
- Add support for hard link creation and symlinks
- Add support for multiple mounted file systems and a userspace interface for it
- Move /dev to a separate file system
- Add umask() support
- Add block device support
- Add more options and features to varied CLI utilities, especially ls
- Add a lot more functionality to libc
- Add the ps utility and system calls for process information
- Add getrusage() support, and with it the time CLI utility
- Add a test suite for the format engine
- Add a CLI login screen
- Add support for unnamed pipes
- Change the kernel to be more event-based instead of polling everything (still in progress)
- Launch init services in order
- Add os::Directory, a C++ API for directory listing
- Add version information (--version) to CLI utilities
- Run the kernel initialization process in a thread
- Add Base64 encoding and decoding support
ISO: pub.cloudapio.eu
Downloads
-
Luna April 24 release - 0.1.0
All checks were successfulcontinuous-integration/drone/push Build is passingreleased this
2023-04-24 20:49:07 +00:00 | 938 commits to main since this releaseIt's been half a year and 800 commits since the last release...
Changelog:
- Rewrote every part of the operating system from scratch, using proper C++ instead of C-like C++.
- Thanks to this, the system (especially the kernel) is literally a thousand times more stable.
- No longer using liballoc, instead a custom malloc is used (everything is really from scratch now).
- Proper readable and writable VFS (no disk support this time either... for now).
- Value-based error handling, instead of barely no error handling.
- No privilege escalation bugs in mprotect (although there is no mprotect as of now).
- So much more...
ISO: pub.cloudapio.eu
Downloads
-
Old Luna (pre-rewrite) Stable
released this
2022-11-09 16:23:07 +00:00 | 1737 commits to main since this releaseUploading this and removing previous tags/releases.
This was the last """"stable"""" release of the previous version of Luna, before it was completely rewritten and made 1000% better.
All old releases can be found as tags named 'old-0.*'
Release text for old releases:
Version 0.14
Well, this update was a big one... 201 commits between 0.13 and 0.14!
Most notable changes:
- New ports: nasm, gmp, mpfr, mpc, but most notably binutils.
- Lots of new functions and APIs implemented in libc, like qsort() or bsearch().
- The kernel got more robust, with better userspace memory management. Most likely, the switch from user_refs and physical addresses to copy_to_user() and copy_from_user(), which is still in progress.
- Argument passing support in the kernel and C Library (argv, argc)!! Environment variables are not there yet, but they should be a breeze to implement now that the basic framework is already there.
- The framebuffer is now available as a device in the /dev filesystem! ioctl() was also added, and for now it can only be used to get framebuffer information. We use this for a little screen utility, which outputs your screen resolution =D
Version 0.13
This one got a lot of changes :)
First of all, a keyboard interface for userspace, which made a command-line shell possible.
The getdents() system call and dirent.h, which is necessary for ls-like utilities.
A test system, with some tests, got added.
A ports system, with one port (bc), got added. bc may be janky on Luna, but it is a piece of third-party software running on the system!
Overall, 120 commits were made since the previous version, and we reached the 600th commit :)
Version 0.12
0.12: A working fork(), finally! As well as /dev/random, and quite a few more libc functions.
Version 0.11
0.11: More VFS stuff, as well as some multitasking improvements, such as multiple address spaces so there can be multiple tasks in parallel + an exec() syscall. Once fork() is implemented, we'll have basic process management!
Version 0.10
0.10: the great VFS update!! we now have a virtual file system which enables us to mount the initrd as filesystem root, but overlay other filesystems on top of it, such as a device filesystem...
This version was the one with the greatest number of commits between the previous version and this one, it seems. 78 commits!!
Downloads