GithubHelp home page GithubHelp logo

tml / axle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codyd51/axle

0.0 3.0 0.0 7.67 MB

a UNIX-like kernel + userspace

Makefile 0.40% Assembly 3.44% C 91.73% Shell 0.29% Objective-C 3.03% C++ 1.12%

axle's Introduction

axle OS

axle is a small UNIX-like hobby operating system. Everything used within axle is implemented from the ground up, aside from the bootloader, for which we use GRUB. axle is a multiboot compliant kernel. axle runs C on 'bare metal' in freestanding mode, meaning even the C standard library is not included. A subset of the C standard library is implemented within axle's kernel, and a userspace version is planned. axle is mainly interfaced through a shell.

The initial entry point must be done in ASM, as we have to do some special tasks such as setting up the GRUB header, pushing our stack, and calling our C entry point. This means that the first code run is in boot.s, but the 'real' entry point is in kernel.c.

Features

  • MLFQ scheduler
  • Monolithic kernel
  • PS/2 keyboard/mouse drivers
  • PIT/RTC drivers
  • Various graphics modes/resolutions
  • Graphics library
  • Window manager
  • Text renderer
  • Paging
  • Multicolored, scrolling shell with history
  • Kernel-space standard library
  • User mode (ring3)
  • Syscalls
  • PCI enumeration

Overview

axle is designed so everything is preemptible, including the kernel itself. Tasks are scheduled according to an MLFQ policy, although a round-robin implementation is also provided if the user requires low-latency between tasks. To prevent starvation in MLFQ mode, a priority booster is also included which drops every task into the highest priority queue at regular intervals. The scheduler quantum, boost quantum, queue counts and queue sizes are all configurable, as many constants within axle's kernel are.

axle's kernel begins by boostrapping essential facilities, such as descriptor tables, paging, the PIT driver (a neccesary component of many other mechanisms), multitasking, and more. A shell process is then launched, which supports many commands for interfacing with axle. Additionally, the shell supports backspacing over commands and automatically records all history (both input and output) to support scrolling back through previous messages.

Among axle's built-in demonstrations is rexle, a pseudo-3D renderer which utilizes raycasting. Rexle paints walls with textures loaded from axle's filesystem, represented as BMPs. BMPs can also be rendered in axle's desktop environment, so that provides a background and image viewer.

axle also includes a JIT compiler which is capable of executing assembly as it is entered. (At the present moment it accepts opcodes directly, though the translation from assembly to opcodes is not a domain-specific problem, and you can feel free to use your favorite assembler to do so).

Graphics

While axle is mainly used through a terminal, VGA and higher-resolution VESA drivers are available, along with a graphics library which can be used with both modes. A window manager and associated API is also provided. VGA mode supports 256 colors and VESA supports full RGB.

##VGA graphics

Circles Rectangles Triangles
Circles Rectangles Triangles
Julia set Mandelbrot set
Julia set Mandelbrot set

##Window manager

While in previous versions of axle the window manager refresh rate was implemented as a callback from the PIT, as axle is now capable of multitasking this is no longer necessary. The window manager spawns its own process and refreshes its contents whenever necessary. Upon a refresh, the window manager traverses its heirarchy and draws its contents from the bottom up, writes to a temporary buffer, and decides whether to transfer this buffer to real video memory. The window manager attempts to minimize modifying video memory, and only does so if there has been a change from the current frame. Additionally, the buffer itself is not modified if no UI elements have notified the manager that they need to be redrawn.

axle's window manager exposes an API for creating and managing UI elements such as windows, views, labels, BMPs, and more. In VESA mode, full RGB is supported.

axle includes a text renderer and default 8x8 bitmap font, though any font in this format could be trivially loaded from axle's filesystem.

This image shows axle's window manager as it was in an earlier version, before configurable fonts and bitmap rendering.

Running

Unless your platform natively outputs 32-bit x86 binaries, you will need a cross compiler to build axle. This link provides detailed instructions on how to cross-compile GCC to build suitable binaries. Alternatively, a precompiled toolchain can be downloaded here. axle uses QEMU as its standard emulator, though any other could be used, such as Bochs. To modify this and other build parameters, see the Makefile. To run and test axle on OS X, run ./install.sh to attempt to build the toolchain, then make run to start the emulator.

Roadmap

  • Keyboard driver
  • Hardware interrupts
  • Snake!
  • Software interrupts
  • Paging
  • Organize files
  • Syscalls
  • Multitasking
  • User mode
  • VESA
  • Automatic resolution detection
  • GFX library
  • Window manager
  • Shutdown/reboot commands
  • Modifiable filesystem
  • Load external binaries
  • Thread API
  • Polygon support
  • UI toolkit
  • MLFQ scheduling
  • Variable scheduling modes
  • PCI enumeration
  • E1000 network driver

License

MIT license. axle is provided free of charge for use or learning purposes. If you create a derivative work based on axle, please provide attribution to the original project.

axle's People

Contributors

c0deh4cker avatar codyd51 avatar filiphsps avatar haifisch avatar mstg avatar thomasfinch avatar uroboro avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.