Skip to content
C4Phone edited this page Dec 12, 2015 · 45 revisions

Dress code

Formal attire

Before launching OS

Written in C++

In fact, C++14 or C++1y

1. Maybe type

  • May reminds you of Swift's ! operator (auto unboxing)
  • If you are not sure what type it is, then it is Maybe Type.
  • Auto unboxing (through operator + overload), existence check
  • Sample Usage:
Maybe<Int> value = hashTable(key);//no need to check if exists or not
  • >> overload for lambda (DETAILS HERE)

2. Fops abstraction

  • With only 2 abstract function: read() and write()
  • File descriptor IS the implementation of fops
  • open() is constructor and close() is destructor
  • C++ constructor cannot fail? Wrap it in Maybe type
  • Driver knows nothing about the file system

3. Automatic resource release

  • AutoSpinLock and unique_ptr
AutoSpinLock
  • Through using constructor & destructor, when the lock is out of scope, it will be auto released.
  • Sample Usage:
    AutoSpinLock lock(&mouse_draw_lock);//done, that's all!

#####unique_ptr

  • Ported from boost library
  • Everything malloc() will be automatically free()
  • So,it is GC

4. Code reuse through templates

Kernel level dynamic memory allocation

Using slabs with template metaprogramming

User level dynamic memory allocation

Implemented sbrk

Ported C library

  • whole C std, ready for use

Read and write hard drive

  • We implemented DMA driver instead of PIO for maximum efficiency

Play music

  • Driver for Sound Blaster 16.

Real mode support

  • It enables our OS to access VBE and switch to HD GUI mode.

Mouse support

  • Left/Right/Double Click, Move support
  • We have a live stream for the process Rendering mouse in our OS LIVE
  • And we hit the Top 1 and get Featured! WOW

I/O wait queues

Some POSIX syscalls

lseek, lstat, sbrk

After launching OS

GUI

  • Duang!~~~
  • With Desktop, Window System, Mouse and DrawNikita&DrawTAs
  • HD Display Support
  • Font Display Support

Lisp

(Commented out)

Is this already implemented?