An open API service indexing awesome lists of open source software.

https://github.com/saltytine/tivos

amd64 operating system in C. Trying to make a full OS, with a simple and readable codebase
https://github.com/saltytine/tivos

c kernel operating-system operating-system-kernel os osdev x86-64

Last synced: about 2 months ago
JSON representation

amd64 operating system in C. Trying to make a full OS, with a simple and readable codebase

Awesome Lists containing this project

README

        

# TIV Operating System
tivOS is a POSIX-compliant operating system in C. An active effort of making a full OS, with a simple and readable codebase.

## Why make your own OS in [insert year]?
> **because I can.**

Having a good time is my drive for this project + I learn a lot of cool low level stuff alongside that!

## Kernel status
The tivOS kernel is a monolithic x86_64 one written in relatively simple C with a few bits of Intel assembly here and there. It uses the Limine bootloader and leverages the FAT32 filesystem for booting along with Ext2 for the root partition. I try to keep the code structure clean and fairly easy to understand, while avoiding too much abstraction. Hence, code quality and clarity are sometimes prioritized over performance gains.

- x86_64 pre-emptive kernel that is Unix-like and POSIX-compliant
- Architecture features fully supported (GDT, IDT, ISR, (I/O)APIC, SSE, LAPIC timer, RTC clock, `syscall` instruction)
- ACPI mode, using I/O APIC redirects for interrupts
- PCI scanning and various PCI device drivers
- Full network stack (including TCP and DHCP) with network interface support (Realtek RTL8139/RTL8169)
- Two-way pipes and Unix domain sockets (AF_UNIX)
- FAT32, Ext2 and virtual file systems (/proc, /sys, /dev, etc)
- PS/2 Keyboard/Mouse drivers along with serial port (COM1, COM2, etc) output
- ELF64 binary loading, dynamic linking and shared libraries
- Musl libc, Linux system call layer, pre-emptive multitasking
- Primitive kernel tty with 8-bit color, some basic ANSI codes and psf1 fonts
- BIOS/UEFI framebuffer utilization and exposure to userland via /dev/fb0

## Userspace status
Userspace is my primary focus at the time being, with the kernel being *quite* stable. I'm trying to make this OS as close to Linux as I can, while adding my own stuff on top of it. This is visible with the system calls that are exactly like Linux's. That isn't random, I want tivOS to be as binary compatible with it as possible!

## Is this a Linux distribution?
No! The tivOS kernel does not share source code or headers with Linux. The Linux source code *is* pulled during userspace assembly, but only because some third party (ported) programs depend on [it's headers](https://wiki.gentoo.org/wiki/Linux-headers). Even then, no actual code is shared.

## Documentation
- **Contributing:** Information about contribution guidelines & suggestions [docs/contributing.md](docs/contributing.md)
- **Compiling:** Information about building the OS correctly & cleaning unused binaries [install.md](docs/install.md)

## Credits
- [Limine](https://github.com/limine-bootloader/limine): Modern, advanced, portable, multiprotocol bootloader and boot manager
- [uACPI](https://github.com/uACPI/uACPI): A portable and easy-to-integrate implementation of the ACPI
- [lwIP](https://savannah.nongnu.org/projects/lwip/): A small independent implementation of the TCP/IP protocol suite
- [dlmalloc](https://gee.cs.oswego.edu/pub/misc/): Doug Lea's Memory Allocator, a good all purpose memory allocator that is widely used and ported
- [eyalroz/printf](https://github.com/eyalroz/printf): Tiny, fast(ish), self-contained, fully loaded printf, sprinf etc. implementation
- [G-9](https://nr9.online/): Made the ASCII art for the kernel's `fetch` command

## License
This project is licensed under GPL v3 (GNU General Public License v3.0). For more information go to the [LICENSE](LICENSE) file.

## Related repos (from pwnjester)
[tiv-repo](https://github.com/pwnjester/tiv-repo) tivOS packaging system
[tiv-pkg](https://github.com/pwnjester/tiv-pkg) tivOS package manager