Giter VIP home page Giter VIP logo

comp421lab2's Introduction

COMP421 Lab2 - Yalnix Kernel Xiaoyu Chen (xc12) and Jiafang Jiang (jj26)

  • All implementations of the yalnix kernel locate in yalnix.c, except for the idle program which locates in idle.c.

Data Structure

Struct cei (Child Exit Info): Each struct contains pid and exit status of one exited child process, and the pointer to the next cei (NULL if none), which enables each parent process to record all cei's in a FIFO linked list. Note that only when a child process exits will it add its corresponding cei to its parent's linked list.

Struct pcb (Process Control Block): Each process has one until it exits. It contains all necessary bookkeeping variables, whose names themselves are self-explanatory enough. Still, two of them needs some more explanation. 'time_to_switch' is meaningful for two kinds of processes. For the currently running process, it represents the time that the process needs to be context switched if it has not already done so through kernel calls during two clock clicks. In other words, when a process is context switched to, its time_to_switch will be set to current system 'time' plus 2. The other kind of process is delayed process. When a process calls Delay, Its 'time_to_switch' will be set to current system 'time' plus the amount of clock clicks it wants to delay. The other variable 'next' also has different meanings in different circumstances. When a process is in ready queue, its 'next' points to the the next ready process in ready queue (NULL if none). Similarly, when a process is in other queues, its 'next' points to the next process in that specific queue.

Struct line: Struct line represents an input line of user from a specific terminal that has not been read by any programs. So each terminal has its own queue of lines. 'buf' contains the actual line of inputs. 'cur' is the current cursor on the line. 'len' is the length of the line. 'next' makes the queue as a linked list.


comp421lab2's People

Contributors

pajamacat avatar

Watchers

James Cloos 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.