Skip to content

abhaynayar/genesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genesis

Minimal OS written in Jack.

Build

Tested on Ubuntu 20.04.

Clone the repository.

git clone https://github.com/abhaynayar/genesis

For the compilation, translation and assembling of Jack programs, you need Python.

For the CPU emulator, you need pygame.

Build and run the project using:

./run.sh

What the build script does:

  • Compiles the *.jack files in kernel/ and userland/ directories.
  • Copies the VM files to the build/ directory.
  • Translates the compiled VM code to Hack assembly. build/out.asm
  • Assembles the Hack assembly code to machine code. build/out.hack
  • Runs the machine code on the CPU emulator.

Docs

Todo

Applications

  • Text Editor.
    • SHIFT key support.
    • Fix backspace quirks.
    • Hold key for multi-input.
  • Chip8 Interpreter.
  • GUI Toolkit.

Language

  • For loops.
  • Hex numbers.
  • If-else ladders.
  • Shift operations.
  • Switch statements.
  • Declare variables anywhere.
  • Code coverage.
  • Error handling.
  • Inline assembly.
  • Coding style guide.
  • Modulo operator.
  • XOR operations.

System

  • File System.
  • C++ Emulator.
  • Sound Support.
  • Network Stack.
  • Timer Interrupts.
  • Shell Text Buffer.
  • Keyboard Interrupts.
  • Hardware-based CPU emulator. (n2t-wasm)

Misc.

  • Fonts with transparent backgrounds.
  • Terminate compiler and shell script on error.
  • Check if Hack file is 64-bit before emulating.
  • Print string and newline in the same function.
  • Check if pixel is already set, if yes then don't update.
  • Output multiple files from assembler; concat them in the build script.
  • Why does XOR only work with a space? => Was not added in JackType.symbols[].