GithubHelp home page GithubHelp logo

halfer53 / winix Goto Github PK

View Code? Open in Web Editor NEW
940.0 14.0 46.0 13.39 MB

A UNIX-style Operating System for the Waikato RISC Architecture Microprocessor (WRAMP)

License: GNU General Public License v3.0

Makefile 1.02% C 96.03% Assembly 1.15% Python 1.80%
operating-system filesystem unix-like kernel c unix linux os

winix's Introduction

WINIX OS

C/C++ CI License: GPL v3 CodeFactor

Winix is a minimal, hobbyistic, educational and UNIX-style Operating System for the Waikato RISC Architecture Microprocessor (WRAMP).

Inspired by the Minix1 operating system, Winix includes a full-featured kernel with features such as process and memory management, in-memory file system, exception control, and a user space bourne shell with interactive command line. And, for a bit of fun, you can even play the classic game of snake by simply typing snake in the command line.

Demo

Playing Snake

play snake

Using Pipe in shell

shell pipe

Features

  • Kernel Memory Management: virtual memory, page mapping
  • Process Management: Kernel thread, process creation
  • Exception control and interrupt handler
  • In-memory file system that supports most of the POSIX api
  • A Bourne shell supporting multiple pipes and redirection
  • User memory management: malloc() free()
  • User coroutine with ucontext.h support
  • Stacktrace dump, segfault analysis

Supported Commands

Unit Test

tests

How to Run

Download the latest Rexsimulator from Here

N.B. mono is required to run in Linux/MacOS environment, Download Instruction

Download the latest WINIX binary winix.srec from Here

Run Rexsimulator.exe

Click Quick Load, select winix.srec

Loading Winix

load winix

How to Compile

N.B. Linux environment is required for compilation

Prerequisite

Debian / Ubuntu

sudo apt-get install xutils-dev gcc

Clone and Compile

git clone https://github.com/halfer53/winix.git
cd winix
make -j$((`nproc`+2))

Debug tips

Debug Makefile

Similar to linux kbuild, Winix supports verbose option, you can debug Makefile by setting verbose to 1

make V=1

Debug Kernel

kprintf(): is your friend.

trace: type trace in shell to print all the syscalls in serial port 2

Supported System Call

Credits

Paul Monigatti

winix's People

Contributors

halfer53 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

winix's Issues

Note about kernel mocking

Variables to mock

  • RexSp1
  • RexSp2
  • TEXT_BEGIN, etc
  • mm.c
    • PAGE_TO_PADDR
    • PAGE_TO_PADDR
    • ram table
  • get_physical_addr
  • get_virtual_addr

Fix concurrency bug

if(is_debugging_ipc()){
                KDEBUG(("IPC: SEND to %d from %d blocked\n",
                            dest, src->proc_nr));
            }
            // Otherwise, block current process and add it to
            // head of sending queue of the destination.
            src->state |= STATE_SENDING;
            src->next_sender = pDest->sender_q;
            pDest->sender_q = src;

This part could trigger undefined behavior if the sender is already receiving

copy string using memcpy instead of strlcpy

if(count > 0 && state->bptr > state->read_ptr){
        *state->bptr = '\0';
        strlcpy(data, state->read_ptr, count);
        buffer_count -= count;
        state->read_ptr += count;
        // KDEBUG(("count %d buffer %d, ptr %x %x\n", count, buffer_count, state->bptr, state->read_ptr));
        return count;
    }

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.