Git Product home page Git Product logo

os's Introduction

OS & Lisp

每位程序员都有自己的 “操作系统”(os) 和 “语言”(lisp) 梦!

简介

实现一个简单的操作系统,只需此操作系统支持 Lisp 语言。

开机动画:

开机后启动 Lisp 解释器:

Lisp 可自举(第一版已实现,即 lisp_c分支):

运行

环境

只针对 i386 架构,需要交叉编译器、模拟器环境。

下面以 Mac 为例:

  • 安装模拟器 --> brew install qemu

  • 安装汇编编译器 --> brew install nasm

  • 安装交叉编译器

    brew tap nativeos/i386-elf-toolchain
    
    brew install i386-elf-binutils i386-elf-gcc i386-elf-gdb
执行

make run

一些说明

分支:

  • lisp_c ,此分支使用 C 实现 Lisp,最终 Lisp 已能自举。但是,在执行 Lisp 表达式过程中若出现多于一次的 GC 就极有可能出错(GC 的问题)
  • lisp_asm ,此分支使用汇编实现 Lisp,解决 lisp_c 中 GC 存在的问题,目前 Lisp 还不能自举(还差一小步)

启动流程:

内容:

  • 第 0 扇区
  • GDT IDT
  • CPU 与 IO 通信:MMIO PMIO
  • 定时器的原生实现
  • 内存管理 -- 分离空闲链表
  • “序对池” 实现
  • 序对池的垃圾回收 GC —— 停止复制算法
    • 存活对象 —— root 表
    • 如何更新“老”指针
  • 字符串常量池实现 —— 哈希表
  • 一种错误机制 —— 汇编想怎么跳就怎么跳
  • 字符动画

目标

  • OS's BootLoader
  • OS’s Kernel ---- screen | interrupt (keyboard timer) | memory management | boot animation
  • Lisp ---- lisp interpreter
  • Lisp ---- enable lisp bootstrapping
  • Lisp ---- optimize lisp (separation of parsing and execution)
  • Lisp ---- in order to solve the problems of GC, use assembly to implement Lisp interpreter
  • Lisp ---- lisp compiler

参考

os's People

Contributors

inotwant avatar

Watchers

 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.