Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ecb28e6
Merge pull request #13 from dexoron/main
emexos Feb 18, 2026
78e602e
push
emexos Feb 18, 2026
bf0310b
might fixed bootup screen
emexos Feb 18, 2026
94076a4
[KPROC] moved the kproc logic to kernel_processes, [FM] moved fm to p…
emexos Feb 18, 2026
81162d2
[BOOT] new bootscreen print logic (moved print), [CONSOLE] new consol…
emexos Feb 18, 2026
3809ad5
just renamed exec to packages
emexos Feb 18, 2026
816f79a
[CPIO] cpio newc parser, [RD] loading ram disk with cpio
emexos Feb 19, 2026
224ea5e
keyboard fixed, init script fixed, prompt fixed
emexos Feb 19, 2026
fa677bd
emex parser, packaging
emexos Feb 19, 2026
0c6b65b
path fixes, make fixes
emexos Feb 19, 2026
5337555
delete limine file
emexos Feb 19, 2026
c4c9aba
moved console init functions to general inits
emexos Feb 19, 2026
9410d5f
random scopes
emexos Feb 21, 2026
2071c92
finally jumping to userspace
emexos Feb 22, 2026
ec39225
moved fs_init to inits/
emexos Feb 22, 2026
40e546d
libc works... kinda.....
emexos Feb 23, 2026
c8cfb88
[user] new userspace shell
emexos Feb 25, 2026
fb37545
[GFX] fixed scroll_up, [USER] fixed crashing when executing command, …
emexos Feb 27, 2026
94ea216
fs commands
emexos Feb 28, 2026
fd91d8b
feat: moved website code to this repo
Feb 28, 2026
1304529
feat: added workflow to deploy website automatically
Voxi0 Feb 28, 2026
739eb4c
feat: added editorconfig and updated flake
Feb 28, 2026
ab8e554
chore: removed empty file from `docs`
Feb 28, 2026
b6f8a94
chore: updated flake
Feb 28, 2026
40ff1d4
chore: resolving compiler warnings and such
Feb 28, 2026
83a52ca
feat: beautifying readme
Feb 28, 2026
a644701
fix: added `const char *s` back to `#define FHDR` in `console.h`
Mar 1, 2026
813cac1
Merge pull request #14 from Voxi0/main
emexos Mar 1, 2026
27988b7
new commands: cat, cd
emexos Mar 1, 2026
b7e935b
new devices: fb0, null, zero, input/mouse0, input/keyboard0, hdd0; [F…
emexos Mar 1, 2026
e2ba8c8
implemented a tty and urandom/random, moved fb0 + tty0 from ioctl to …
emexos Mar 2, 2026
454a9c7
design changes, ioctl syscall
emexos Mar 3, 2026
45c0602
better readme
emexos Mar 3, 2026
69f37f5
ipc, whatever
emexos Mar 8, 2026
1af6ec6
lsblk command, hdd0 renamed to hda, new /sys/block
emexos Mar 8, 2026
7d6b17b
new panic screen
emexos Mar 9, 2026
768451d
new panic screen
emexos Mar 9, 2026
bbbdbfb
new panic screen
emexos Mar 9, 2026
386e89b
new panic screen...
emexos Mar 9, 2026
941eee6
new logging tags, changed panic screen design a bit
emexos Mar 9, 2026
46de549
fixed slow printing with >8bytes per time< copying, design changes on…
emexos Mar 9, 2026
ef33c7b
Mouse driver, .emxrc file parser, reboot command
emexos Mar 11, 2026
06632c9
Update TODO.md
D3LTA2033 Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = tab
trim_trailing_whitespaces = true
insert_final_newline = false
charset = utf-8

[*.nix]
indent_size = 2

[*.{c,h,ld}]
indent_size = 4
54 changes: 54 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy website

# Set permissions of the `GITHUB_TOKEN` to allow deployment to Github Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete
concurrency:
group: "pages"
cancel-in-progress: false

# Workflow triggers
on:
# Whenever any changes are made to `web/` from either a push or merging a pull request
push:
paths:
- "web/**"
pull_request:
paths:
- "web/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Workflow actions
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
# Clone repository
- name: Checkout
uses: actions/checkout@v4

# Configure Github Pages
- name: Setup Pages
uses: actions/configure-pages@v5

# Upload build - In this case it's just static files e.g. HTML and CSS
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload specific directory
path: './web'

# Deploy to Github Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build/
!build/src/kernel/console/functions/edit.c.o

# Libraries/Dependencies
include/limine
include/limine/*
#!include/limine/limine.h

.DS_Store
Expand All @@ -17,8 +17,9 @@ tools/png
tools/bmp
tools/lg.py

dsk/hdd0
dsk/disk.img
.github/*

logo.txt

src/kernel/console/functions/edit.c

Expand Down
3 changes: 3 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"project_name": "emexOS",
}
77 changes: 41 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ all: $(ISO)
fetchDeps:
@echo "[DEPS] Fetching dependencies/libraries"
@mkdir -p $(INCLUDE_DIR)
#@mkdir -p $(BUILD_DIR)/src/kernel/console/functions

@echo "[DEPS] Fetching Limine"
@rm -rf $(INCLUDE_DIR)/limine
@git clone https://codeberg.org/Limine/Limine.git --branch=v10.3.0-binary --depth=1 $(INCLUDE_DIR)/limine
@echo "[DEPS] Building limine binary"
@$(MAKE) -C $(INCLUDE_DIR)/limine
@rm -rf $(LIMINE_DIR)
@git clone https://codeberg.org/Limine/Limine.git --branch=v10.x-binary --depth=1 $(LIMINE_DIR)
@rm -rf $(LIMINE_DIR)/.git
@echo "[DEPS] Fetching Limine protocol header file"
@wget https://codeberg.org/Limine/limine-protocol/raw/branch/trunk/include/limine.h -O $(LIMINE_DIR)/limine.h

disk:
@mkdir -p $(DISK_DIR)
Expand All @@ -34,24 +35,16 @@ $(BUILD_DIR)/kernel.elf: src/kernel/linker.ld $(OBJS)
userspace:
@$(MAKE) -C src/userspace

# Ensure host limine tool exists (Linux/macOS binary).
# Compile Limine
$(LIMINE_TOOL):
@$(MAKE) -C $(LIMINE_DIR)

# Create bootable ISO
$(ISO): limine.conf $(BUILD_DIR)/kernel.elf disk userspace $(LIMINE_TOOL)
$(ISO): limine.conf $(LIMINE_TOOL) $(BUILD_DIR)/kernel.elf disk userspace
@echo "[ISO] Creating bootable image..."
@rm -rf $(ISODIR)
@rm -f $(DISK_DIR)/initrd.cpio
@mkdir -p $(ISODIR)/boot/limine $(ISODIR)/EFI/BOOT
#@cp $(BUILD_DIR)/kernel.elf $(ISODIR)/boot/
@cp $(BUILD_DIR)/kernel.elf $(ISODIR)/boot/kernel_a.elf
@cp $(BUILD_DIR)/kernel.elf $(ISODIR)/boot/kernel_b.elf
#@cp activeslot.txt $(ISODIR)/boot/activeslot.cfg # slot system

@cp $< $(ISODIR)/boot/limine/
@cp $(addprefix $(INCLUDE_DIR)/limine/limine-, bios.sys bios-cd.bin uefi-cd.bin) $(ISODIR)/boot/limine/
@cp $(addprefix $(INCLUDE_DIR)/limine/BOOT, IA32.EFI X64.EFI) $(ISODIR)/EFI/BOOT/

@mkdir -p $(ISODIR)/boot
@mkdir -p $(ISODIR)/boot/ui
@mkdir -p $(ISODIR)/boot/ui/fonts
Expand All @@ -60,26 +53,38 @@ $(ISO): limine.conf $(BUILD_DIR)/kernel.elf disk userspace $(LIMINE_TOOL)
@mkdir -p $(ISODIR)/boot/keymaps
@mkdir -p $(ISODIR)/boot/images
@mkdir -p $(ISODIR)/boot/programs
@cp $(BUILD_DIR)/kernel.elf $(ISODIR)/boot/kernel_a.elf
@cp $(BUILD_DIR)/kernel.elf $(ISODIR)/boot/kernel_b.elf
@cp $< $(ISODIR)/boot/limine/
@cp $(addprefix $(INCLUDE_DIR)/limine/limine-, bios.sys bios-cd.bin uefi-cd.bin) $(ISODIR)/boot/limine/
@cp $(addprefix $(INCLUDE_DIR)/limine/BOOT, IA32.EFI X64.EFI) $(ISODIR)/EFI/BOOT/

@echo "[MOD] creating executables..."
@cp src/userspace/hello.elf $(ISODIR)/boot/programs/hello.elf

#@echo "[MOD] copying configs..."
#@cp shared/theme/bootconf.emcg $(ISODIR)/boot/bootconf.emcg
#@cp shared/theme/font8x15.bin $(ISODIR)/boot/liminefont.f15

@echo "[MOD] copying assets..."
@cp shared/ui/assets/bootlogo.bin $(ISODIR)/boot/ui/assets/
#@cp shared/images/logo.bmp $(ISODIR)/boot/images/
#@cp shared/images/background.bmp $(ISODIR)/boot/images/
@cp shared/images/frog.bmp $(ISODIR)/boot/images/

#@cp shared/images/bg.jpg $(ISODIR)/boot/

@echo "[MOD] copying keymaps..."
@cp shared/keymaps/US.map $(ISODIR)/boot/keymaps/
@cp shared/keymaps/DE.map $(ISODIR)/boot/keymaps/
#@cp shared/keymaps/PL.map $(ISODIR)/boot/keymaps/
@echo "[MK] copying executables..."
@mkdir -p $(DISK_DIR)/rd/user/apps
@mkdir -p $(DISK_DIR)/rd/user/bin
@mkdir -p $(DISK_DIR)/rd/bin
@mkdir -p $(DISK_DIR)/rd/emr/system
@cp -r src/userspace/apps/shell/shell.emx $(DISK_DIR)/rd/user/apps/
@cp -r src/userspace/apps/system/system.emx $(DISK_DIR)/rd/emr/system/
@cp -r src/userspace/apps/gui/gui.emx $(DISK_DIR)/rd/user/apps/

@echo "[MK] copying files..."
#@cp limine.conf $(DISK_DIR)/rd/boot/
@cp src/userspace/apps/login/login.elf $(DISK_DIR)/rd/emr/system
@cp src/userspace/bin/echo/echo.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/hello/hello.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/ls/ls.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/tree/tree.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/cat/cat.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/cd/cd.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/lsblk/lsblk.elf $(DISK_DIR)/rd/bin/
@cp src/userspace/bin/reboot/reboot.elf $(DISK_DIR)/rd/bin/


@echo "[MK] creating initrd.cpio..."
@chmod +x tools/initrd.sh
./tools/initrd.sh
@cp $(DISK_DIR)/initrd.cpio $(ISODIR)/boot/

@xorriso -as mkisofs -b boot/limine/limine-bios-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
Expand Down Expand Up @@ -123,4 +128,4 @@ $(BUILD_DIR)/%.asm.o: %.asm
clean:
@echo "[CLR] Cleaning..."
@rm -rf $(BUILD_DIR)
@echo "[OK]"
@echo "[OK]"
91 changes: 38 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,62 @@
# emexOS - a simple 64 Bit OS written in C

<div align="center">
<img src="./screenshots/screen_size1.png" width="50%">
<img src="./screenshots/login.png" width="50%">
<h1>$${\Huge \color{white} \tilde{} emexOS \space \tilde{} \space \space \space }$$</h1>


$${\LARGE \color{red}a \space simple \space x86 \textunderscore 64 \space operating \space system \space in \space c}$$

![GitHub License](https://img.shields.io/github/license/emexos/emexOS1?style=for-the-badge&label=License&labelColor=black&color=white)
![GitHub repo size](https://img.shields.io/github/repo-size/emexos/emexOS1?style=for-the-badge&label=size&labelColor=black&color=white)
![GitHub Repo stars](https://img.shields.io/github/stars/emexos/emexos1?style=for-the-badge&labelColor=black&color=white)


![Discord Badge](https://img.shields.io/badge/Join%20the%20Discord-Black?style=for-the-badge&logo=discord&logoColor=white&color=black)

</div>

## Build Dependencies
## $${\large Build \space Dependencies}$$
For building and compiling emexOS, ensure you have the following installed,
- x86_64 GCC cross-compiler - This is our preferred compiler for the source code. Currently, emexOS only supports 64-bit x86 machines, but we plan to support more architectures in the future.
- [NASM](https://www.nasm.us/) - Assembler.
- [QEMU](https://www.qemu.org/) - Our preferred emulator.
- [Xorriso](https://www.gnu.org/software/xorriso/) - ISO creation.
- [Git](https://git-scm.com/) - To fetch dependencies.
- [Git](https://git-scm.com/) and [wget](https://www.gnu.org/software/wget/) - To fetch dependencies.

You can use Zig instead of x86_64-gcc if you prefer to,
- [Zig](https://ziglang.org/) - Zig lets you build the whole OS using just one command.
You can use [Zig](https://ziglang.org/) instead of GCC if you prefer to.

## For Nix Users
If you’re using [Nix](https://nixos.org/), you can run the provided flake that installs all the build dependencies. That way, you can set up a complete emexOS development environment with a single, simple command.
## $${\large For \space Nix \space Users}$$
Ensure you have flakes enabled first and then run `nix develop` to enter the provided development shell which will have all build dependencies and such installed for you. I'd recommend updating the flake using `nix flake update` as it's sometimes not updated for long periods of time.

## Building and Compiling
Now that you have all the required build dependencies installed, you can finally build and run emexOS.
## $${\large Building \space and \space Compiling}$$
With all build dependencies installed, you can finally build and run emexOS.
> [!CAUTION]
> emexOS currently only supports ATA disks, if such a disk is detected emexOS **WILL/CAN DELETE IT WITHOUT ASKING** (if you have OVERWRITEALL set to 1 in the configs which is by default 0.)

**Using gnu-make**
- `make fetchDeps` - Fetches all libraries and such that emexOS depends on. Obviously `git` is used for this operation.
- `make` - Builds emexOS.
- `make run` - Emulates emexOS using QEMU.
- `make clean` - Cleans up all build outputs.
- `make fetchDeps` - Fetch all libraries and such that emexOS depends on e.g. Limine. `git` and `wget` are used for this.
- `make` - Build emexOS.
- `make run` - Emulate emexOS using QEMU.
- `make clean` - Clean up all build outputs.

**Using Zig**
- `zig build` - Fetch, build and run.
- `zig build -Dnofetch` - Build and run.
- `zig build -Dclean` - Remove (cache, output), fetch, build and run.
- `zig build -Dnofetch -Dclean` - Remove (cache, output), build and run.

## Running
to run emexOS on QEMU use `make run`
on real hardware make sure your device does not have any existing data on the disk, emexOS will delete it without asking! (soon there will be a menu which asks you)

## Console
After the bootup emexOS will ask you about a password to login. the password is "emex", but you can change that in shared/config/user.h
## $${Console}$$
After booting, you will be asked for a password which is "emex" by default, to log in. The password can be changed in `shared/config/user.h`.

## Commands
Currently, no SMP support is available just yet so emexOS runs using only a single core.

### Common

| command | example | output |
|-----------------|-----------------|------------------------------|
| echo | echo text | text |
| clear | clear | [clears screen] |
| help <command> | help echo | [help menu/specific command] |
| scale | scale 3 | [font size from 1 to 4] |
| date | date | [shows current date] |
| calendar | calendar | [shows current date & time] |
| time | time | [shows current time] |
| uptime | uptime | [shows current uptime] |

### System

| command | example | output |
|-----------------|-----------------|------------------------------|
| meminfo | meminfo | free memory: ... |
| dofetch | dofetch | [emexOS logo, user, ...] |
| date | date | [shows current date] |

---

## License:
- GNU GPLv3
- Attribution required (see ATTRIBUTION.md)
<div align="center">
<h2>$${Contributors}$$</h2>
<a href="https://github.com/emexos/emexOS1/graphs/contributors">
<img src="https://contrib.rocks/image?repo=emexos/emexOS1" />
</a>
</div>

</br>

## Writer
- README.md by Voxi0 & emexSW & Bi Moz
- emexOS project started by emexSW
##
<div align="right">
<p>$\color{gray}{readme\ by\ emexSW,\ Voxi0\ and\ Bi\ Moz}$</p>
</div>
8 changes: 4 additions & 4 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ VLD = @echo "[LD] $@" && $(LD)
# Compiler Flags
COMMON_FLAGS += -I $(INCLUDE_DIR) -I $(SRC_DIR) -I shared/ -ffreestanding -fno-stack-protector -fno-lto \
-fno-PIE -fno-pic -m64 -march=x86-64 -mno-80387 -mno-mmx \
-mno-sse -mno-sse2 -mno-red-zone -mcmodel=kernel -Wall -Wextra
CFLAGS ?= $(COMMON_FLAGS) -std=gnu11
-mno-sse -mno-sse2 -mno-red-zone -mcmodel=kernel -Wall -Wextra -Wpedantic
CFLAGS ?= $(COMMON_FLAGS) -std=c23
CXXFLAGS ?= $(COMMON_FLAGS) -std=c++17 -fno-exceptions -fno-rtti
LDFLAGS ?= -nostdlib -static -no-pie -z text -z max-page-size=0x1000
ASFLAGS ?= -f elf64
Expand All @@ -28,8 +28,8 @@ SRC_DIR := src
USERSPACE_DIR = src/userspace
USERSPACE_BUILD = build/userspace
BUILD_DIR := build
DISK_DIR := $(BUILD_DIR)/dsk
DISK_DIR := dsk
DISK_IMG := $(DISK_DIR)/disk.img
INCLUDE_DIR := include
ISODIR := $(BUILD_DIR)/isodir
ISO := $(BUILD_DIR)/$(OS_NAME).iso
ISO := $(BUILD_DIR)/$(OS_NAME).iso
1 change: 0 additions & 1 deletion docs/Building emexOS from source

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Emulating_emexOS_binary_using_QEMU.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ The easiest way to run emexOS is to run it in QEMU.
- Choose either to enable storage or not to.
- Keep the default options and select "finish".

Learn how to install QEMU in [Arch](https://github.com/BloopBiMoz/emexOS1/blob/main/docs/QEMU_Arch.md) and [Debian](https://github.com/BloopBiMoz/emexOS1/blob/main/docs/QEMU_Debian.md) based distributions.
Learn how to install QEMU in [Arch](./QEMU_Arch.md) and [Debian](./QEMU_Debian.md) based distributions.
Binary file added dsk/disk.img
Binary file not shown.
Binary file added dsk/initrd.cpio
Binary file not shown.
Binary file added dsk/rd/bin/cat.elf
Binary file not shown.
Binary file added dsk/rd/bin/cd.elf
Binary file not shown.
Binary file added dsk/rd/bin/echo.elf
Binary file not shown.
Binary file added dsk/rd/bin/hello.elf
Binary file not shown.
Binary file added dsk/rd/bin/ls.elf
Binary file not shown.
Binary file added dsk/rd/bin/lsblk.elf
Binary file not shown.
Binary file added dsk/rd/bin/reboot.elf
Binary file not shown.
Binary file added dsk/rd/bin/rm.elf
Binary file not shown.
Binary file added dsk/rd/bin/tree.elf
Binary file not shown.
1 change: 1 addition & 0 deletions dsk/rd/boot/activeslot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A
40 changes: 40 additions & 0 deletions dsk/rd/boot/limine.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
timeout: 1 # better for trying on real hardware

kaslr: yes
verbose: yes

#wallpaper: boot():/boot/bg.jpg
default_entry: 0

#term_font: boot():/boot/liminefont.f15
#term_font_size: 8x15
#term_font_spacing: 0

# ----
# Dualslot kernel system
# ----

# default/ active
/emexOS A
protocol: limine
kernel_path: boot():/boot/kernel_a.elf
#module_path: boot():/boot/activeslot.txt # Slot A

module_path: boot():/boot/initrd.cpio

# slot 2 for update
/emexOS B
protocol: limine
kernel_path: boot():/boot/kernel_b.elf
#module_path: boot():/boot/activeslot.txt # slot B

module_path: boot():/boot/initrd.cpio


# ----
# resolutions
# ----

# resolution: 1920x1080x32
# resolution: 2560x1440x32
# resolution: 3840x2160x32
File renamed without changes.
File renamed without changes.
Binary file added dsk/rd/boot/ui/fonts/unifont.sfn
Binary file not shown.
Loading