xyrisos / panix-archive Goto Github PK
View Code? Open in Web Editor NEW(ARCHIVED) Panix Operating System (ver. 2) developed at Cedarville University
Home Page: https://panix.kfeavel.com
License: GNU Affero General Public License v3.0
(ARCHIVED) Panix Operating System (ver. 2) developed at Cedarville University
Home Page: https://panix.kfeavel.com
License: GNU Affero General Public License v3.0
All of the documentation in the .cpp files and all functions without any documentation should have it migrated / added to the header files.
List of all classes where documentation is needed in headers as well as in implementation files:
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.
The colors get reversed when being pushed into a register and then read in print32.asm (register ecx)
Not sure why this is occurring.
Create namespaces for classes to reflect the directory structure.
Next task: VGA support
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
In order to allow PCI devices to interact with Panix, we need to create and assign base address registers to each device.
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();
}
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.
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.
This also relates to the shell issue since the shell can just become a keyboard and mouse handler
We need a style guide detailing casing standards, where curly braces should go, how includes should be handled, etc.
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
I liked how the cow was dead.
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.
An associated exit function should be added for when the kernel needs to quit w/o an exception. See minix kernel/utility.c (https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/03ac74ede908465cc64c671bbd209e761dc765dc/minix/kernel/utility.c)
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.
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.
In order to maintain consistency as well as streamline documentation, all block documentation comments should be moved to the header.
The graphics aren't working properly and I'm not sure where the issue is.
Linking will fail if the directory does not exist
Keyboard keys should be printed now, but are not. Something is wrong in interrupts.h / .cpp, keyboard.h / .cpp or somewhere else. (I really hope not somewhere else.)
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.
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.
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.
It's different for each operating system so we need to define our own
Drivers shouldn't do anything until activated so we need to add a bool to determine if we should handle interrupts. (Multitasking Branch)
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).
Having a wiki once edix gets far enough along would be nice
It would be better to just rewrite it in HTML + CSS + Javascript to have more control.
Like in this video.
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.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.