All Projects → acmiitr → KSOS

acmiitr / KSOS

Licence: MIT license
Our very own Operating System built from scratch for x86 architecture systems!

Programming Languages

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

Projects that are alternatives of or similar to KSOS

LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-54.22%)
Mutual labels:  osdev, operating-system, operating-system-kernel, operating-systems-learning
MoonOS
MoonOS (just a kernel atm) is a micro kernel designed for the x86_64 and arm architecure.
Stars: ✭ 82 (-1.2%)
Mutual labels:  osdev, operating-system, operating-system-kernel
DentOS
Experimental Stand-alone 32-bit Kernel with Bootloader written in AT&T Assembly and Freestanding C
Stars: ✭ 32 (-61.45%)
Mutual labels:  osdev, operating-system, x86-os
zambesii
Non-unix, custom-API hybrid OS kernel written in C++ which can be thought of as an emulated microkernel. The native API is almost fully asynchronous and the kernel is aimed at high-scaling, high-throughput-requiring multiprocessor workloads, with working support for SMP and NUMA already implemented. Join the IRC channel, #zbz-dev on freenode!
Stars: ✭ 13 (-84.34%)
Mutual labels:  operating-system, operating-system-kernel
kora-kernel
Kernel for my operating system KoraOS
Stars: ✭ 15 (-81.93%)
Mutual labels:  osdev, operating-system
greenteaos.github.io
🏠 Homepage of the @GreenteaOS
Stars: ✭ 16 (-80.72%)
Mutual labels:  osdev, operating-system
kwast
Rust operating system running WebAssembly as userspace in ring 0
Stars: ✭ 83 (+0%)
Mutual labels:  osdev, operating-system
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 (-72.29%)
Mutual labels:  osdev, operating-system
Melvix
💻 A small operating system written from scratch
Stars: ✭ 69 (-16.87%)
Mutual labels:  osdev, operating-system
Osmanthus
A developing operating system
Stars: ✭ 36 (-56.63%)
Mutual labels:  osdev, operating-system
SnowFlake
Technology is free, SnowFlakeOS
Stars: ✭ 38 (-54.22%)
Mutual labels:  osdev, operating-system
munix
🦠 µnix is a UNIX-like operating system
Stars: ✭ 57 (-31.33%)
Mutual labels:  osdev, operating-system
MeetixOS
An hobby OS written in modern C++20 which aims to be Unix-like. Currently based on EvangelionNG, a GhostOS derived kernel
Stars: ✭ 179 (+115.66%)
Mutual labels:  osdev, operating-system
saturn
A microkernel based operating system developed from scratch. This repository also includes all Saturn services and applications.
Stars: ✭ 21 (-74.7%)
Mutual labels:  osdev, operating-system
Cardinal
Operating system designed to be fast and secure.
Stars: ✭ 20 (-75.9%)
Mutual labels:  osdev, operating-system
Polaris
A WIP 64-bit UNIX-like kernel
Stars: ✭ 72 (-13.25%)
Mutual labels:  osdev, operating-system
ShawnOS
A Basic x86 Operating System/Kernel
Stars: ✭ 39 (-53.01%)
Mutual labels:  osdev, operating-system
Macaron
A sweet hobby made operating system written in C++ for x86 CPUs with GUI
Stars: ✭ 34 (-59.04%)
Mutual labels:  osdev, operating-system
Luakernel
Lua + SQLite + musl libc running on x86.
Stars: ✭ 223 (+168.67%)
Mutual labels:  osdev, operating-system
rust os
My hobby operating system microkernel written in Rust
Stars: ✭ 33 (-60.24%)
Mutual labels:  osdev, operating-system

"If you want to travel around the world and be invited to speak at a lot of different places, just write a Unix operating system." ~ Linus Torvalds, creator of Linux

KSOS

This repository contains the code for the operating system, KSOS, developed by the members of IIT Roorkee ACM Student Chapter. Get a prebuilt version of the latest release of KSOS here!

To know more about the development journey from the beginning, read our blog written by Suraaj. In the future, we will be releasing blogs highlighting the different core aspects of KSOS, so stay tuned!

You asked for it!

Contents

Introduction

This OS is being built for an x86 architecture system using Legacy BIOS and was started from scratch in November 2019. It has been developed on a Debian-based Linux distribution. We emulate using qemu, a general-purpose CPU emulator.

We also write our very own Bootloader for Legacy BIOS. The bootloader handles the initial 16-bit CPU mode, preparing the switch to 32-bit protected mode. It also parses the filesystem and loads the kernel before passing control to it. The kernel has been implemented mostly in C.

Btw, what KSOS means shall remain a secret. 😉

Build and Run from Source

This section will mainly explain how to build KSOS on a Debian-based Linux.

NOTE: If you just want to run the latest release of KSOS, you can download a prebuilt version from here. Simply run it using qemu-system-i386 disk.img.

Dependencies

Make sure the following are installed before proceeding further:

  • git : sudo apt install git
  • nasm (assembler): sudo apt install nasm
  • qemu (cpu emulator): sudo apt install qemu
  • make (build system): sudo apt install make

Setup

If you are here to just try and test the OS, carry out these commands in Bash to get started:

  1. Clone this repository:
git clone https://github.com/acmiitr/KSOS.git
  1. Switch to the main directory of the repository:
cd KSOS
  1. If you already have a cross compiler installed, please skip this step. Run the script file for the same (only once, it takes time and around 2 gigs of memory!):
bash script.sh
  1. Restart the terminal.
  2. Do a fresh make of the OS:
make

Detailed Explanation of Setup

A detailed explanation of each of the above-mentioned instructions are given below:

  1. Firstly, clone the repository.
  2. Switch to the main directory of the repository.
    1. If you already have a cross compiler installed, please skip this step!
    2. Ours is a 32-bit Operating System. We do not want to use your system compiler (which probably produces 64-bit binaries) and libraries to build this operating system. Hence, we build a cross compiler (we use the system compiler to make a custom compiler that produces 32-bit binaries. Yes, you read it right, we use a compiler to compile a compiler). If this went over your head, don't worry, a bash script comes along with the repository, and you just need to run the script. The script handles the rest!
    3. To build our cross compiler using the script, go to the directory where the script is stored and run bash script.sh. After this, you will have to restart the terminal.
    4. If you don't believe that you need a cross compiler, read this and think again. Building the cross compiler will take time and around 2 GB of memory! After all, you are building an entirely new compiler.
    1. To build the OS, we need to compile the C code, assemble the assembly code, link them, make a file system on a disk, copy the kernel to the file system, make the file system bootable, and a lot more. Did you catch all that? xD
    2. Thankfully, all of this is done using a Makefile, which we can run using a single line: make.
    3. And voila! It creates a disk.img file, which is the operating system. Pretty neat (it's only 1MB so far)!
    1. You can emulate KSOS using: qemu-system-i386 disk.img or even simplermake run.
    2. This results in a new window that runs KSOS. Enjoy the bright colors!

Running on a Real Machine

  1. To run it directly on a PC without an emulator, you would need to have a Legacy BIOS system. Let's say you did have one lying around for 12+ years, follow the next instructions!
  2. First, we would have to copy it to a USB by plugging it into your system where you have built the OS and run:sudo dd if=disk.img of=/dev/sdx where sdx is sda/sdb/sdc depending on the output of lsblk.
  3. However, this would not work with UEFI systems (almost all of the systems nowadays). Porting to UEFI is something you could contribute to (see potential features).
  4. Then plug in your USB into the system, turn it on, and the OS boots up!

Changelog

Unreleased

Added

  • Mini Standard Library
  • User Mode
  • FAT Filesystem Driver
  • ATA Disk Driver

Changed

  • Build System

Removed

v1.0.0 - 2020-04-30

Added

  • Interrupt Handler
  • Timer
  • Keyboard Driver
  • Virtual Memory
  • File System
  • Video Driver
  • Memory Manager
  • Basic U/I: A Kernel Level Shell

Getting Started

Getting started with operating systems development is a bit tricky. Dr. Nick Blundell's book is a great resource to begin with, especially for bare-metal and bootloader programming.

BrokenThorn's OS Development series, although old, is really helpful. Most of the overall structure of the project was built from this resource.

If you have any issues, feel free to have discussions with the people at #osdev on freenode IRC, as well as the OSDev forums.

To get started with simple bare-metal programming, you can read Suraaj's blog.

Contribution Guidelines

Operating system development is debatably the most onerous task in programming, notably because of the complete absence of any "backend" that you can work upon. You are the complete backend. However, there is no need to be discouraged. If you want to contribute, you can look at some of the more straightforward problems that we have in the issues section.

To get started, you NEED to know how to build the OS from source. After that, it's just up to your imagination. The thing with operating systems is, you can do whatever you want. Feel free to discuss any ideas that you may have with us by opening an issue. 😃

Do not shy away from asking questions about KSOS, possible features to implement or operating systems in general on our Facebook Page.

Once you do find an issue or feature to contribute, please:

  1. Fork the repository.
  2. Create a new feature/bug branch.
  3. Follow the following commit guidelines: 1, 2.
  4. Submit a PR!

Potential Features

A lot of the work after v.1.0.0 release can now be done in C. Possible developments could include implementing:

  • more general standard input/output functions
  • file system (disk) driver
  • graphics
  • multitasking
  • user-mode

Other major work to be done:

  • Porting to UEFI OR using an existing Bootloader like GRUB

Resources

Licence

This repository is licenced under MIT Licence, see LICENCE.md.

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].