Giter Club home page Giter Club logo

oslab's Introduction

oslab

Introduction

I must Create a System, or be enslav'd by another Man's; I will not Reason and Compare: my business is to Create. —William Blake

In the early days, engineers knew everything about computing systems: mainboard, hardware, networking, compiler and so on. I still have many questions on computing systems even as a graduated student of CS.

After reading the interesting book - The Elements of Computing Systems, I was inspired to write something from scratch. This repo. records the practices on OS development.

I wrote a real-mode program that can handle an old hardware, registered my own interrupt service routine, and configured the interrupts in Intel 8259A. And it worked. Due to some reason, I can not put it here, if you are interested in how interrupt stuffs work, ping me.

Links

Assembler

NASM provides some useful features that are similar to C language. You can define macro, trace compilation with %warning, and memory model is easy understood.

;; macro of variable
%define BASE 0x7C00

;; constant
mbr_length equ 512

;; I hate LEA
mov byte [es:xx], XXXh

;; like pointer in C
mov si, msg
mov word target, 0x7E00
jmp [target] 

msg     db 'Hello World'
target  dw 0x0

;; compilation trick
size equ ($ - start)
%if size+2 > 512
    %error "[ERROR] code is too large for boot sector"
%else
    %warning Nasm version: __NASM_VER__
    %warning Current date: __DATE__ __TIME__
    %warning Current bits mode: __BITS__
%endif

Editor

Visual Studio Code is good for me with useful extensions:

With these extensions, integrated terminal and the following nmake.sh(or nmake.bat), I could just focus on editor and coding.

Emulator

  • VirtualBox: best performance and fully support for running os.
  • DOSBox or DOSEmu: useful for dos program, you can debug your *.COM file with debug.exe
  • QEMU
  • Bochs: It's useful for debugging. However, you shouldn't expect the performance.

Build & Run

Use nmake.sh

cd bootloader
./nmake.sh gos

After building, the emulator will start automatically.

Makefile

Recently I was working with nmake.sh, later I will improve the Makefile.

cd bootloader
make name=gos
cd bin

Screenshot

Gauss calculation


Hope these will help you.

oslab's People

Contributors

icecoobe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

oslab's Issues

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.