All Projects → TravorLZH → TravorOS

TravorLZH / TravorOS

Licence: GPL-3.0 license
A simple OS running on Intel x86 architecture | No longer updating

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
Makefile
30231 projects

Projects that are alternatives of or similar to TravorOS

Toaru Nih
NOTICE: The ToaruOS-NIH Project has been MERGED UPSTREAM. This repository is now archived.
Stars: ✭ 66 (+175%)
Mutual labels:  kernel, os, operating-system, x86, bootloader
Toaruos
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
Stars: ✭ 4,687 (+19429.17%)
Mutual labels:  kernel, os, operating-system, x86, bootloader
Aqeous
(Inactive, Checkout AvanaOS, Rewrite of this) This is a New Operating System (Kernel right now). Made completely from scratch, We aim to make a complete OS for Learning purpose
Stars: ✭ 23 (-4.17%)
Mutual labels:  os, operating-system, x86, i386
RocketOS
RocketOS is a Unix based OS that uses legacy BIOS and GRUB and is written in C17. It is being developed for educational purposes primarily, but it still is a serious project. It is currently in its infancy.
Stars: ✭ 23 (-4.17%)
Mutual labels:  kernel, os, operating-system, x86
Macaron
A sweet hobby made operating system written in C++ for x86 CPUs with GUI
Stars: ✭ 34 (+41.67%)
Mutual labels:  kernel, os, operating-system, x86
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (+120.83%)
Mutual labels:  kernel, os, operating-system, x86
Reactos
A free Windows-compatible Operating System
Stars: ✭ 10,216 (+42466.67%)
Mutual labels:  kernel, os, operating-system, x86
Cyjon
A simple, clean code, multi-tasking operating system written in pure assembly language for 64-bit processors from the AMD64 family.
Stars: ✭ 184 (+666.67%)
Mutual labels:  kernel, os, operating-system, bootloader
scaraOS
A 32bit multiboot OS kernel for IA32 (PC/AT) systems.
Stars: ✭ 31 (+29.17%)
Mutual labels:  kernel, operating-system, x86, i386
OpenHarmony
华为鸿蒙分布式操作系统(Huawei OpenHarmony)开发技术交流,鸿蒙技术资料,手册,指南,共建国产操作系统万物互联新生态。
Stars: ✭ 373 (+1454.17%)
Mutual labels:  kernel, os, operating-system
tinyos
An UNIX-like toy operating system runs on x86 CPU
Stars: ✭ 47 (+95.83%)
Mutual labels:  kernel, operating-system, x86
beeos
A simple "Unix-like" kernel trying to be POSIX compliant
Stars: ✭ 103 (+329.17%)
Mutual labels:  kernel, os, operating-system
nautilus
Nautilus Aerokernel
Stars: ✭ 30 (+25%)
Mutual labels:  kernel, os, operating-system
chaos-2
A hand-made SMP-aware kernel
Stars: ✭ 20 (-16.67%)
Mutual labels:  kernel, os, operating-system
biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (+95.83%)
Mutual labels:  kernel, os, operating-system
Cardinal
Operating system designed to be fast and secure.
Stars: ✭ 20 (-16.67%)
Mutual labels:  kernel, os, operating-system
CPL-1
Operating system in C written for fun and glory
Stars: ✭ 33 (+37.5%)
Mutual labels:  kernel, operating-system, i386
pranaOS
A unix operating system written from scratch in c that gives support for arm, x86
Stars: ✭ 138 (+475%)
Mutual labels:  kernel, os, operating-system
DentOS
Experimental Stand-alone 32-bit Kernel with Bootloader written in AT&T Assembly and Freestanding C
Stars: ✭ 32 (+33.33%)
Mutual labels:  kernel, os, operating-system
kernel
Main kernel tree
Stars: ✭ 28 (+16.67%)
Mutual labels:  kernel, os, x86

TravorOS - Developing with Simplification

Github Release Github License Build Status AppVeyor Branch Coverage Status

This is the first Operating System I created. It's written in two languages: C language and Assembly.

This project has been activated since December 15, 2017

screenshot

Table of Contents

Work Plan

  • Write text to VGA

  • CPU Interrupt (IDT, ISRs, IRQs, etc.)

  • Read character from PS/2 Keyboard

  • Read string from PS/2 Keyboard

  • Virtual Memory (Paging, Frames, etc.)

  • Page Frame Allocation and De-allocation

  • Dynamic Memory Allocation (liballoc)

  • CPU Timer

  • Get CPU Information

  • Real-Time Clock: So we can know when the movie starts

  • Kernel Stack Trace

  • Multitasking

  • User-mode processes

  • Hard Disk Driver

  • Floppy Disk Driver

  • File System

  • Graphical User Interface

Bootloader

Custom

This OS uses a 2-staged bootloader. In case the second stage is when we entered Protected Mode and calls kernel.

Boot Sector

The first 512 bytes of my floppy image contains the Boot Sector which does a lot of stuff that Protected Mode cannot do. (e.g. Loading stuff from disk). Then it jumps to the second stage loaded at 0x7E00 (just after the boot sector).

Stage 2

This stage loads the GDT and enters Protected Mode, then it copies the kernel loaded by boot sector at 0x1000 to 0x100000 (1 MB). At last jump!

GRUB

The size of the kernel is always growing, but I can't always increase the sectors to load. As a solution. I decide to use GRUB. The kernel is stored as an ELF image (kernel.img) in a CD which uses ISO 9660 as its file system. GRUB also supports multiboot, so my Operating System can work together with others (Windows, Linux, etc.).

Kernel

We entered protected mode which means we don't have access to BIOS functions. So, this kernel needs to re-implement those functions for controlling the hardware.

Now, I have re-implemented standard devices: screen and keyboard. In the further development. I am going to implement disk driver.

Memory Management

This Operating System uses both segmentation and paging to provide memory protection. In my Global Descriptor Table, I put 5 segment descriptors:

  1. Null Segment

  2. Code Segment for kernel: The segment where my kernel code belongs to

  3. Data Segment for kernel: The segment where my kernel global variables belong to

  4. Code Segment for user: Currently not using

  5. Data Segment for user: Same as 4

I also enable paging. Now I intentionally maped the fourth page in the first page table to not-present and read-only, so you can generate a Page Fault by executing entering bsod in my OS's command line.

bluescreen

Page Frame Allocator

This kernel provides a Page Frame Allocator, so the memory management will be more convenient and I will be easier to approach multitasking.

As JamesM's Tutorial suggests, I will use a bitset to determine whether a frame is free or not.

           1: Allocated      0: Free
                 v              v
frame_bitset: 11110111110101111101111111
                  ^
            get_free_frame()

Dynamic Memory Allocation

I have currently implemented a placement malloc without free because all variables used by kernel never need to be freed until powers off.

Heap Allocation
-----------------------------------------------
Allocated |
Memory    | Free.......until the end of memory
          |
-----------------------------------------------

Because I am lazy, I port a 3rd party memory allocator called liballoc which only required few functions in my OS.

Building System

This project uses GNU Make to build. So, the way to build is to type make, if any problems occur during the build, type make dep before make. Open an issue if still stuck.

asciicast

If you are not using Linux or WSL (Windows Subsystem for Linux), you will need to download a cross compiler from here. Then modify CC and LD in config.mk.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].