├── .gitignore ├── .github ├── FUNDING.yml └── workflows │ ├── build-mac.yml │ └── nightly-mac.yml ├── ramdisk └── test.txt ├── lxboot.conf ├── .gitmodules ├── LICENSE ├── Makefile └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.hdd 2 | *.tar 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: luxOS 2 | -------------------------------------------------------------------------------- /ramdisk/test.txt: -------------------------------------------------------------------------------- 1 | some file that will just go in the ramdisk -------------------------------------------------------------------------------- /lxboot.conf: -------------------------------------------------------------------------------- 1 | [entry] 2 | name luxOS 3 | disk boot 4 | kernel /lux 5 | ramdisk /ramdisk.tar 6 | boot 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lxfs"] 2 | path = lxfs 3 | url = https://github.com/lux-operating-system/lxfs 4 | [submodule "boot-x86_64"] 5 | path = boot-x86_64 6 | url = https://github.com/lux-operating-system/boot-x86_64 7 | [submodule "toolchain-x86_64"] 8 | path = toolchain-x86_64 9 | url = https://github.com/lux-operating-system/toolchain-x86_64 10 | [submodule "kernel"] 11 | path = kernel 12 | url = https://github.com/lux-operating-system/kernel 13 | [submodule "lucerna"] 14 | path = lucerna 15 | url = https://github.com/lux-operating-system/lucerna 16 | [submodule "lumen"] 17 | path = lumen 18 | url = https://github.com/lux-operating-system/lumen 19 | [submodule "servers"] 20 | path = servers 21 | url = https://github.com/lux-operating-system/servers 22 | [submodule "utilities"] 23 | path = utilities 24 | url = https://github.com/lux-operating-system/utilities 25 | [submodule "ports"] 26 | path = ports 27 | url = https://github.com/lux-operating-system/ports 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 by the luxOS authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/build-mac.yml: -------------------------------------------------------------------------------- 1 | name: build - macOS 2 | 3 | on: 4 | [push, pull_request, workflow_dispatch] 5 | 6 | jobs: 7 | build: 8 | runs-on: macos-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | with: 13 | submodules: recursive 14 | token: ${{ secrets.PAT_TOKEN }} 15 | 16 | - name: Install dependencies 17 | run: brew install nasm curl make 18 | 19 | - name: Fetch and install toolchain 20 | run: | 21 | curl https://jewelcodes.io/lux/toolchain-macos-arm64.tar.xz -o toolchain-macos-arm64.tar.xz 22 | tar -xvJf toolchain-macos-arm64.tar.xz 23 | mv toolchain $HOME/work/toolchain 24 | mv host $HOME/work/host 25 | echo "$HOME/work/toolchain/bin" >> $GITHUB_PATH 26 | 27 | - name: Verify toolchain is executable 28 | run: x86_64-lux-gcc -v 29 | 30 | - name: Build LXFS disk image manager 31 | run: make -C lxfs 32 | 33 | - name: Build x86_64 boot loader 34 | run: make -C boot-x86_64 35 | 36 | - name: Build kernel 37 | run: make -C kernel 38 | 39 | - name: Build lucerna 40 | run: make -C lucerna 41 | 42 | - name: Install lucerna 43 | run: make install -C lucerna 44 | 45 | - name: Build servers 46 | run: make -C servers 47 | 48 | - name: Install servers 49 | run: make install -C servers 50 | 51 | - name: Build lumen 52 | run: make -C lumen 53 | 54 | - name: Clean up artifacts 55 | run: | 56 | rm -rf toolchain-macos-arm64.tar.xz $HOME/work/toolchain $HOME/work/host 57 | make clean 58 | -------------------------------------------------------------------------------- /.github/workflows/nightly-mac.yml: -------------------------------------------------------------------------------- 1 | name: nightly - macOS 2 | 3 | on: 4 | schedule: 5 | - cron: "0 3 * * *" # run daily at 3:00 AM UTC 6 | 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: macos-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | with: 16 | submodules: recursive 17 | token: ${{ secrets.PAT_TOKEN }} 18 | 19 | - name: Install dependencies 20 | run: brew install nasm curl make 21 | 22 | - name: Fetch and install toolchain 23 | run: | 24 | curl https://jewelcodes.io/lux/toolchain-macos-arm64.tar.xz -o toolchain-macos-arm64.tar.xz 25 | tar -xvJf toolchain-macos-arm64.tar.xz 26 | mv toolchain $HOME/work/toolchain 27 | mv host $HOME/work/host 28 | echo "$HOME/work/toolchain/bin" >> $GITHUB_PATH 29 | 30 | - name: Verify toolchain is executable 31 | run: x86_64-lux-gcc -v 32 | 33 | - name: Build LXFS disk image manager 34 | run: make -C lxfs 35 | 36 | - name: Build x86_64 boot loader 37 | run: make -C boot-x86_64 38 | 39 | - name: Build kernel 40 | run: make -C kernel 41 | 42 | - name: Build lucerna 43 | run: make -C lucerna 44 | 45 | - name: Install lucerna 46 | run: make install -C lucerna 47 | 48 | - name: Build servers 49 | run: make -C servers 50 | 51 | - name: Install servers 52 | run: make install -C servers 53 | 54 | - name: Build lumen 55 | run: make -C lumen 56 | 57 | - name: Create disk image 58 | run: make 59 | 60 | - name: Timestamp disk image 61 | run: mv lux.hdd lux-nightly-$(date +"%Y-%m-%d").hdd 62 | 63 | - name: Archive disk image 64 | uses: actions/upload-artifact@v4 65 | with: 66 | name: disk-image 67 | path: lux*.hdd 68 | 69 | - name: Clean up artifacts 70 | run: | 71 | rm -rf *.hdd toolchain-macos-arm64.tar.xz $HOME/work/toolchain $HOME/work/host 72 | make clean 73 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo "\x1B[0;1;35m make\x1B[0m lxfs" 3 | @make -C lxfs 4 | @echo "\x1B[0;1;35m make\x1B[0m boot-x86_64" 5 | @make -C boot-x86_64 6 | @echo "\x1B[0;1;35m make\x1B[0m kernel" 7 | @make -C kernel 8 | @echo "\x1B[0;1;35m make\x1B[0m lucerna" 9 | @make -C lucerna 10 | @echo "\x1B[0;1;35m make\x1B[0m install lucerna" 11 | @make install -C lucerna 12 | @echo "\x1B[0;1;35m make\x1B[0m servers" 13 | @make -C servers 14 | @echo "\x1B[0;1;35m make\x1B[0m install servers" 15 | @make install -C servers 16 | @echo "\x1B[0;1;35m make\x1B[0m lumen" 17 | @make -C lumen 18 | @echo "\x1B[0;1;35m make\x1B[0m utilities" 19 | @make -C utilities 20 | @echo "\x1B[0;1;35m make\x1B[0m install utilities" 21 | @make install -C utilities 22 | @echo "\x1B[0;1;35m lxfs\x1B[0m create" 23 | @./lxfs/lxfs create lux.hdd 10 24 | @echo "\x1B[0;1;35m lxfs\x1B[0m format" 25 | @./lxfs/lxfs format lux.hdd 9 26 | @echo "\x1B[0;1;35m lxfs\x1B[0m mbr" 27 | @./lxfs/lxfs mbr lux.hdd boot-x86_64/mbr.bin 28 | @echo "\x1B[0;1;35m lxfs\x1B[0m boot" 29 | @./lxfs/lxfs boot lux.hdd 0 30 | @echo "\x1B[0;1;35m lxfs\x1B[0m bootsec" 31 | @./lxfs/lxfs bootsec lux.hdd 0 boot-x86_64/bootsec.bin 32 | @echo "\x1B[0;1;35m lxfs\x1B[0m bootblk" 33 | @./lxfs/lxfs bootblk lux.hdd 0 boot-x86_64/lxboot.bin 34 | @echo "\x1B[0;1;35m lxfs\x1B[0m cp lxboot.conf" 35 | @./lxfs/lxfs cp lux.hdd 0 lxboot.conf lxboot.conf 36 | @echo "\x1B[0;1;35m lxfs\x1B[0m cp lux" 37 | @./lxfs/lxfs cp lux.hdd 0 kernel/lux lux 38 | @cp lumen/lumen ramdisk/ 39 | @cp -r servers/out/* ramdisk/ 40 | @cp -r utilities/out/* ramdisk/ 41 | @echo "\x1B[0;1;35m tar \x1B[0m c ramdisk.tar" 42 | @cd ramdisk; tar --format ustar -c * > ../ramdisk.tar; cd .. 43 | @echo "\x1B[0;1;35m lxfs\x1B[0m cp ramdisk.tar" 44 | @./lxfs/lxfs cp lux.hdd 0 ramdisk.tar ramdisk.tar 45 | @./lxfs/lxfs mkdir lux.hdd 0 /bin 46 | @./lxfs/lxfs mkdir lux.hdd 0 /dev 47 | @./lxfs/lxfs mkdir lux.hdd 0 /proc 48 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/nterm /bin/nterm 49 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/hello /bin/hello 50 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/lush /bin/lush 51 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/echo /bin/echo 52 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/pwd /bin/pwd 53 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/ls /bin/ls 54 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/cat /bin/cat 55 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/luxfetch /bin/luxfetch 56 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/head /bin/head 57 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/reset /bin/reset 58 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/chmod /bin/chmod 59 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/touch /bin/touch 60 | @./lxfs/lxfs cp lux.hdd 0 ramdisk/rm /bin/rm 61 | @./lxfs/lxfs mkdir lux.hdd 0 /test 62 | 63 | clean: 64 | @echo "\x1B[0;1;35m make\x1B[0m clean lxfs" 65 | @make -C lxfs clean 66 | @echo "\x1B[0;1;35m make\x1B[0m clean boot-x86_64" 67 | @make -C boot-x86_64 clean 68 | @echo "\x1B[0;1;35m make\x1B[0m clean kernel" 69 | @make -C kernel clean 70 | @echo "\x1B[0;1;35m make\x1B[0m clean lucerna" 71 | @make -C lucerna clean 72 | @echo "\x1B[0;1;35m make\x1B[0m clean lumen" 73 | @make -C lumen clean 74 | @echo "\x1B[0;1;35m make\x1B[0m clean servers" 75 | @make -C servers clean 76 | @echo "\x1B[0;1;35m make\x1B[0m clean utilities" 77 | @make -C utilities clean 78 | 79 | toolchain: 80 | @cd toolchain-x86_64; ./build-toolchain.sh 81 | 82 | qemu: 83 | @qemu-system-x86_64 -monitor stdio -m 4096 -smp 4 -cpu Skylake-Client \ 84 | -drive file=lux.hdd,format=raw,if=none,id=disk \ 85 | -device nvme,serial=12345678,drive=disk 86 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | [![luxOS logo](https://jewelcodes.io/lux/logo-small.png)](https://github.com/lux-operating-system) 4 | 5 | [![License: MIT](https://img.shields.io/github/license/lux-operating-system/lux?color=red)](https://github.com/lux-operating-system/lux/blob/main/LICENSE) [![Build status](https://github.com/lux-operating-system/lux/actions/workflows/build-mac.yml/badge.svg)](https://github.com/lux-operating-system/lux/actions) [![GitHub Issues](https://img.shields.io/github/issues/lux-operating-system/lux)](https://github.com/lux-operating-system/lux/issues) 6 | 7 | # 8 | 9 |
10 | 11 | **luxOS** is a planned prototype Unix-like operating system that will be built on the [lux microkernel](https://github.com/lux-operating-system/kernel). This repository contains the build system for a disk image containing luxOS that can be booted on a virtual machine or on real hardware, as well as the overall project roadmap. 12 | 13 | ![Screenshot of luxOS running on QEMU](https://jewelcodes.io/lux-01-14-24.png) 14 | 15 | # Nightly Builds 16 | If you prefer to build luxOS yourself, scroll down. 17 | 18 | If you prefer to use a nightly build, build images will be generated every night at 3:00 AM GMT, and builds from the last 90 days are available under the [Actions tab](https://github.com/lux-operating-system/lux/actions/workflows/nightly-mac.yml). 19 | 20 | # Building 21 | ## 1. Requisites 22 | Before building luxOS, you will need to install several tools necessary to build the build system itself. You will need a cross compiler that can generate executables for luxOS regardless of your host system. The compiler used in the development of luxOS is gcc and the assembler is nasm. 23 | 24 | This guide will assume you are running on a Unix-like system. 25 | 26 | **You will need to install the following packages before proceeding:** 27 | * working host C and C++ compilers (gcc and g++, or clang and clang++) 28 | * nasm 29 | * curl 30 | * make 31 | * autoconf (==2.69) 32 | * automake (>=1.16) 33 | * texinfo 34 | * m4 35 | * libgmp-dev (on Linux distributions) 36 | * libgmp (on Linux distributions) 37 | * qemu (for testing) 38 | 39 | Many Unix-like systems ship with several of these packages installed. You may need to run one of the following commands depending on your system. 40 | 41 | **macOS with Homebrew:** 42 | ```shell 43 | brew install nasm curl make autoconf@2.69 automake texinfo m4 qemu 44 | ``` 45 | 46 | **Debian derivatives:** 47 | ```shell 48 | sudo apt install nasm curl build-essential autoconf=2.69* automake texinfo m4 libgmp-dev libgmp qemu 49 | ``` 50 | 51 | ## 2. Clone the repository 52 | After all the dependencies are installed, recursively clone this repository and `cd` into it: 53 | ```shell 54 | git clone --recurse-submodules https://github.com/lux-operating-system/lux 55 | cd lux 56 | ``` 57 | 58 | ## 3. Build the toolchain 59 | The luxOS build system provides a script to automatically configure and build binutils and gcc to generate executables for luxOS. 60 | ```shell 61 | cd toolchain-x86_64 62 | ./build-toolchain.sh 63 | ``` 64 | 65 | If this step was completed successfully, you should now have a toolchain targeting luxOS in `.../lux/toolchain-x86_64/cross/bin`. Add that path to your `PATH` and `cd` back into the luxOS root so that the rest of the build process can go smoothly. 66 | ```shell 67 | export PATH="$PATH:.../lux/toolchain-x86_64/cross/bin" 68 | cd .. 69 | ``` 70 | 71 | ## 4. Build and run luxOS 72 | Building a bootable disk image of luxOS is now as simple as running one command. 73 | ```shell 74 | make 75 | ``` 76 | 77 | You should now have a file called `lux.hdd` in the project root. You can now run luxOS in QEMU by running: 78 | ```shell 79 | make qemu 80 | ``` 81 | 82 | Or if you'd prefer to use another virtual machine, you can attach the virtual disk image to a VirtualBox VM or similar. 83 | 84 | ## 5. Optional: Cleanup 85 | Many artifacts are generated from intermediate steps in the build process. If you are not planning to modify and rebuild luxOS, you may find it useful to delete them. 86 | ```shell 87 | make clean 88 | ``` 89 | 90 | # Progress Checklist 91 | 92 | This checklist provides a rough overview of the backlog for the luxOS project. It is not meant to be all-inclusive and is subject to change as more components of the system are developed and/or if the vision or design changes. 93 | 94 | - [ ] **Milestone 0: Requisite to all other milestones:** 95 | - [x] Priority scheduling 96 | - [x] Multiprocessing 97 | - [x] Multithreaded and preemptible microkernel 98 | - [x] User space 99 | - [x] C library (partial) 100 | - [ ] C++ library 101 | - [x] Unix domain sockets 102 | - [x] POSIX signals 103 | - [x] Standard communication protocol for microkernel servers 104 | - [x] Framework for drivers running in user space 105 | - [x] Unix-like `/dev` file system 106 | - [x] Unix-like `/proc` file system (partial) 107 | - [ ] Anonymous pipes 108 | - [ ] Named pipes 109 | - [ ] Wildcards 110 | - [x] At **least** one read-write storage device driver: 111 | - [x] NVMe SSDs 112 | - [ ] AHCI (SATA SSDs and HDDs) 113 | - [x] IDE (ATA HDDs) 114 | - [x] At **least** one read-write file system driver with enforced Unix permissions: 115 | - [x] lxfs 116 | - [ ] ext2 117 | - [ ] ext3/4 118 | - [x] Keyboard input 119 | - [x] Unix-style pseudo-terminal driver 120 | - [x] Terminal emulator with support for ANSI control codes 121 | - [ ] Port ncurses 122 | - [ ] Port **one** shell: 123 | - [ ] zsh (preferred) 124 | - [ ] bash 125 | 126 | - [ ] **Milestone 1: Independence and self-hosting:** 127 | 128 | - [ ] Port binutils 129 | - [ ] Port GCC 130 | - [ ] Port NASM 131 | - [ ] Port make 132 | - [x] Port a simple text editor 133 | - [ ] Edit and recompile the OS running under itself 134 | 135 | - [ ] **Milestone 2: Networking:** 136 | 137 | - [ ] At **least** one ethernet device driver: 138 | - [ ] NE2000 (Bochs and QEMU) 139 | - [ ] Realtek RTL8139 (QEMU) 140 | - [ ] Realtek RTL8111/RTL8169 (real hardware) 141 | - [ ] AMD PC-NET (VirtualBox) 142 | - [ ] Intel i8254x (QEMU and VirtualBox) 143 | - [ ] TCP/IP stack with support for IPv4 and IPv6 144 | - [ ] DHCP client implementation 145 | - [ ] DNS lookup implementation 146 | - [ ] Port OpenSSL for secure TCP connections 147 | - [ ] Port wget and/or curl 148 | - [ ] Port git 149 | - [ ] Port ssh 150 | - [ ] Package and repository manager 151 | 152 | - [ ] **Milestone 3: USB:** 153 | 154 | - [ ] Device driver for xHCI (USB 3.x) 155 | - [ ] Device driver for USB hubs 156 | - [ ] Drivers for USB HIDs (keyboards and mice) 157 | - [ ] Driver for USB mass storage devices 158 | - [ ] Driver for USB ethernet controllers 159 | 160 | - [ ] **Milestone 4: Iris (graphical user interface):** 161 | 162 | - [ ] Display manager 163 | - [ ] Compositor 164 | - [ ] Windowing system 165 | - [ ] Graphical terminal emulator 166 | - [ ] Graphical file manager 167 | - [ ] Frontends for common command-line utilities 168 | 169 | - [ ] **Milestone 5: Port from x86_64 to ARM64:** 170 | 171 | - [ ] **TODO:** Specifics yet to be decided 172 | 173 | # Contributing 174 | 175 | The lux microkernel and the luxOS Project are both personal educational/research projects and are not planned to be community-developed. However, if you like what you're seeing and/or you learned something, monetary contributions would be greatly appreciated and provide a direct incentive to allocate more time to the project. You can support my work on [Patreon](https://patreon.com/luxOS) if you're interested. 176 | 177 | # Contact 178 | Join the project's [Discord server](https://discord.gg/GEeekQEgaB) if you just wanna say hi or talk about OS development in general. 179 | 180 | # License 181 | The lux microkernel is free and open source software released under the terms of the MIT License. Unix is a registered trademark of The Open Group. 182 | 183 | # 184 | 185 | Made with 💗 from Boston and Cairo 186 | --------------------------------------------------------------------------------