Coder Social home page Coder Social logo

xyrisos / panix-archive Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 9.01 MB

(ARCHIVED) Panix Operating System (ver. 2) developed at Cedarville University

Home Page: https://panix.kfeavel.com

License: GNU Affero General Public License v3.0

Assembly 2.19% Makefile 2.44% C++ 95.37%

panix-archive's People

Contributors

jamesaorson avatar kfeavel avatar micahswitzer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

panix-archive's Issues

Documentation TODO List

List of all classes where documentation is needed in headers as well as in implementation files:

  • Drivers
    • Driver Manager (Only Implementation)
    • PCI (Headers & Implementation)
    • Mouse (Headers & Implementation)
    • Mouse Event Handler (Headers & Implementation)
    • Keyboard (Headers & Implementation - Easy Start)
    • Keyboard Event Handler (Headers & Implementation - Easy Start)
  • LibC
    • All Libc functions (Only Implementation)
  • CPU
    • Global Descriptor Table (Headers & Implementation)
    • Interrupt Handler & Manager (Headers & Implementation)
    • Ports (Headers & Implementation - Needs Serious Help)

Because we're following a tutorial series, documentation will for the most part actually be pretty easy. We just have to read the code and watch the videos and as each function is explained we re-explain it along with any changes we've made. Keep in mind that all documentation for header functions and classes should follow the Doxygen outline (A VSCode extension is available that makes this easy) and all explanations in the implementation files (.cpp & .c) should be explained with // and not /**/ unless the explanation begins before a function.

32 bit real mode color support

The colors get reversed when being pushed into a register and then read in print32.asm (register ecx)
Not sure why this is occurring.

Add namespaces

Create namespaces for classes to reflect the directory structure.

Sleep Function using PIT

Panix has had a PIT for a while now, so it would be nice to implement a sleep function, but the problem is that in order to do so we basically have to sleep the entire OS or have IPC implemented. Either way, the code to do so is pretty well laid out here:
https://wiki.osdev.org/PIT

Add Shutdown & Reboot Functionality

Shutdown needs to be called via inline assembly while in real-mode (no user process):

shutdown:
  mov ax, 0x1000
  mov ax, ss
  mov sp, 0xf000
  mov ax, 0x5307
  mov bx, 0x0001
  mov cx, 0x0003
  int 0x15
 
  ret  ;if interrupt doesnt work

Reboot is easier. It can be called via the following code from OSDev Wiki:

void reboot()
{
    uint8_t good = 0x02;
    while (good & 0x02)
        good = inb(0x64);
    outb(0x64, 0xFE);
    halt();
}

Getting "undefined reference to `__stack_chk_fail'" when building on Linux

When building on Linux without a cross-compiler I get these errors:

ld: src/drivers/keyboard/keyboard.o: in function `drivers::Keyboard::callback(registers_t)':
/home/micah/src/Panix/src/drivers/keyboard/keyboard.cpp:89: undefined reference to `__stack_chk_fail'
ld: src/cpu/timer/timer.o: in function `cpu::Timer::printTick()':
/home/micah/src/Panix/src/cpu/timer/timer.cpp:42: undefined reference to `__stack_chk_fail'
make: *** [Makefile:37: src/kernel/kernel.bin] Error 1

It appears that libssp isn't getting linked when building. See this StackOverflow post for a potential solution.

printf needs new name for kernel space

We need to rename all mentions of printf (files and all) to either printk or kprint in order to specify that this is a kernel level printing function. This will be especially important once we move into userspace programs.

Add style guide

We need a style guide detailing casing standards, where curly braces should go, how includes should be handled, etc.

Move to OOP

Move everything to classes. If something does not make sense as an object to instantiate, simply make the methods and variables static so nothing must be created, only referenced

Interrupt Handler Needs Refactoring

There is a bug somewhere related to interrupt handler code that is causing the kernel to seemingly crash once an interrupt occurs. This issue is more visible in QEMU than it is in Virtualbox. (i.e. entire screen flashing v. EDIX name flashing.

Commenting out the interrupts.Activate(); line in kernel.cpp will bypass the issue, but will disable the entire interrupt system, which is necessary.

Add QEMU debugging support

In order to better debug the kernel, linking gdb to QEMU would make it easier to see exactly what is going on. Additionally, Netbeans could be configured to run with debugging options.

Class / file headers need standardization

Some files have the Xcode file header / information instead of the Netbeans header / information which is what will be used in the future. This needs to be standardized.

Switch to Grub

Switch to Grub, use it to literally remove almost every single bit of assembly, and allow Grub to define stack and memory bounds for us.

Create detailed exception descriptions when panicking

Make an array of basic descriptions to print when panicking for each interrupt. Also need to look into whether or not it's possible to recover from something like a divide by 0, or if we just have to halt and reboot. Either way we need to stop the looping text.

Concept of a "Process" Class

One of the solutions to some of our process issues might be to create a process class that simple has an initialize function that's called when the process begins and then from there the process object can take care of itself. A concept that's similar to this that has already been implemented into panix are the interrupt handlers. Just a thought, but we need something to make the process of launching a new process easier.

Add isActivated to drivers

Drivers shouldn't do anything until activated so we need to add a bool to determine if we should handle interrupts. (Multitasking Branch)

Source needs to be organized into subfolders

All of the source code for the kernel should be placed into a kernel director with appropriate subdirectories for each different type of class. (i.e. terminal / printing should have its own folder).

Define Microkernel plan

As stated here, we need to consider this:

As a microkernel must allow building arbitrary operating system services on top, it must provide some core functionality. At a minimum, this includes:

- some mechanisms for dealing with address spaces, required for managing memory protection
- some execution abstraction to manage CPU allocation, typically threads or scheduler activations
- inter-process communication, required to invoke servers running in their own address spaces

This will eventually include moving all of our drivers and libraries out of the kernel.

Shell Functions Need Serious Restructure

The way that functions are handled by the shell is really awful. We basically have no way to handle important operations like printing time or doing anything hardware related because we don't have access to any drivers and the driver manager doesn't allow us to grab them from the array. We need to reconsider where the shell goes and how it interfaces with the rest of the OS.

Porting A Pre-Made C Library

There are many pre-made c libraries that can be ported into our own OS. Musl is one that is known to be portable as it was used in Ghost, which is another hobby OS which has been ported successfully.

OSDev Wiki Has an article on this.
Ghost OS is open source and has their C library source code here.

Keyboard Driver Refactor Issues

In the main branch we have the keyboard driver have a callback for when a key is pressed. We have something similar in the switch-to-grub branch but it isn't quite as elegant nor does it allow for a terminal shell since the input never leaves the driver. We don't have a line buffer or anything. We need to update the keyboard driver to something similar.

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.