Update README.md

This commit is contained in:
apio 2022-10-29 10:13:36 +02:00
parent 33ed6e5c17
commit 7aad256acd

View File

@ -1,16 +1,21 @@
# Luna # Luna
A simple kernel and userspace for the x86_64 platform, written mostly in C++. A simple kernel and userspace for the x86_64 platform, written mostly in C++ and C.
## Features ## Features
- x86_64-compatible [kernel](kernel/). - x86_64-compatible [kernel](kernel/).
- Keeps track of which [memory](kernel/src/memory/) is used and which memory is free, and can allocate memory for itself and [user programs](kernel/src/sys/mem.cpp). - Keeps track of which [memory](kernel/src/memory/) is used and which memory is free, and can allocate memory for itself and [user programs](kernel/src/sys/mem.cpp).
- Can load files from a [virtual file system](kernel/src/fs/) supporting an initial ramdisk, device pseudo-filesystems... but no hard disks yet. - Can read, write and execute files from a [virtual file system](kernel/src/fs/) supporting an initial ramdisk, device pseudo-filesystems... but no hard disks yet.
- Basic preemptive multitasking, round-robin [scheduler](kernel/src/thread/) that can switch between tasks. - Preemptive multitasking, with a round-robin [scheduler](kernel/src/thread/) that can switch between tasks.
- Can [load userspace ELF programs](kernel/src/sys/elf/) from the file system as user tasks. - Can [load ELF programs](kernel/src/sys/elf/) from the file system as userspace tasks.
- [System call](kernel/src/sys/) interface and simple [C Library](libs/libc/), aiming to be POSIX-compatible. - [System call](kernel/src/sys/) interface and [C Library](libs/libc/), aiming to be mostly POSIX-compatible.
- Some very simple [example programs](apps/), written in C, that then can get loaded and executed by the kernel at userspace demand.
- UNIX-like [multitasking primitives](kernel/src/sys/exec.cpp), which allow user tasks to spawn other tasks. - UNIX-like [multitasking primitives](kernel/src/sys/exec.cpp), which allow user tasks to spawn other tasks.
- Very simple [command-line shell](apps/src/sh.c), allowing interactive use of the system. - Some simple [userspace programs](apps/src/), written in C.
- Simple [command-line shell](apps/src/sh.c), allowing for interactive use of the system.
- Basic multi-user system with [a password file](initrd/etc/passwd) and utilities for [logging in](apps/src/session.c) and [switching users](apps/src/su.c).
## Notes
- The default user is named 'selene' and you can log into it with the password 'moon'.
- Beware of backspace, as it looks like it works but it doesn't work except when entering shell commands. So if you make a mistake while entering a username or password, you'll have to try again.
## Setup ## Setup
To build and run Luna, you will need to build a [GCC Cross-Compiler](https://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler%3F) and cross-binutils for `x86_64-luna`. (Yes, Luna is advanced enough that it can use its own [OS-Specific Toolchain](https://wiki.osdev.org/OS_Specific_Toolchain), instead of a bare metal target like `x86_64-elf`. It is the first of my OS projects to be able to do so. The patches for Binutils and GCC are [binutils.patch](tools/binutils.patch) and [gcc.patch](tools/gcc.patch)). To build and run Luna, you will need to build a [GCC Cross-Compiler](https://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler%3F) and cross-binutils for `x86_64-luna`. (Yes, Luna is advanced enough that it can use its own [OS-Specific Toolchain](https://wiki.osdev.org/OS_Specific_Toolchain), instead of a bare metal target like `x86_64-elf`. It is the first of my OS projects to be able to do so. The patches for Binutils and GCC are [binutils.patch](tools/binutils.patch) and [gcc.patch](tools/gcc.patch)).
@ -77,9 +82,8 @@ These images do reflect the latest changes on the `main` branch, but are obvious
## Is there third-party software I can use on Luna? ## Is there third-party software I can use on Luna?
Yes, actually! Check out the [ports](ports/) directory. Yes, actually! Check out the [ports](ports/) directory.
Right now, only [bc](https://github.com/gavinhoward/bc) is ported, because right now our C Library is quite primitive and doesn't support projects more complex than that. Right now, there are very few ports, because our C Library is quite primitive and doesn't support complex projects.
I'm in the process of trying to port the [GNU binutils](https://www.gnu.org/software/binutils/), though.
And bc itself doesn't run very well... most notably, user input doesn't echo. But that's on our side. At least it runs!
You should also keep in mind that it is not possible to compile software written in any language other than C for Luna right now. You should also keep in mind that it is not possible to compile software written in any language other than C for Luna right now.