Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Yo-yo-ooo committed Jul 12, 2023
1 parent 0c02785 commit dab4305
Show file tree
Hide file tree
Showing 97 changed files with 1,338 additions and 1,315 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.o
*.d
*.elf
*.iso
disk.img
2 changes: 1 addition & 1 deletion CPY.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

cp ThisOS.iso /media/sf_maab_2/barebones.iso
cp MaslOS.iso /media/sf_maab_2/barebones.iso
21 changes: 9 additions & 12 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.PHONY: all
all: ThisOS.iso
all: MaslOS.iso

.PHONY: all-hdd
all-hdd: barebones.hdd

.PHONY: run
run: ThisOS.iso
qemu-system-x86_64 -M q35 -m 2G -cdrom ThisOS.iso -hda block.img -monitor stdio -boot d
run: MaslOS.iso
qemu-system-x86_64 -M q35 -m 2G -cdrom MaslOS.iso -boot d

.PHONY: run-uefi
run-uefi: ovmf-x64 ThisOS.iso
qemu-system-x86_64 -M q35 -m 2G -bios ovmf-x64/OVMF.fd -cdrom ThisOS.iso -boot d
run-uefi: ovmf-x64 MaslOS.iso
qemu-system-x86_64 -M q35 -m 2G -bios ovmf-x64/OVMF.fd -cdrom MaslOS.iso -boot d

.PHONY: run-hdd
run-hdd: barebones.hdd
Expand All @@ -32,7 +32,7 @@ limine:
kernel:
$(MAKE) -C kernel

ThisOS.iso: limine kernel
MaslOS.iso: limine kernel
rm -rf iso_root
mkdir -p iso_root
cp kernel/kernel.elf \
Expand All @@ -43,8 +43,8 @@ ThisOS.iso: limine kernel
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot limine-cd-efi.bin \
-efi-boot-part --efi-boot-image --protective-msdos-label \
iso_root -o ThisOS.iso
limine/limine-deploy ThisOS.iso
iso_root -o MaslOS.iso
limine/limine-deploy MaslOS.iso
rm -rf iso_root

barebones.hdd: limine kernel
Expand All @@ -68,13 +68,10 @@ barebones.hdd: limine kernel

.PHONY: clean
clean:
rm -rf iso_root ThisOS.iso barebones.hdd
rm -rf iso_root MaslOS.iso barebones.hdd
$(MAKE) -C kernel clean

.PHONY: distclean
distclean: clean
rm -rf limine ovmf-x64
$(MAKE) -C kernel distclean

ca:
make clean -j$(nproc) && make run -j$(nproc)
3 changes: 2 additions & 1 deletion JUST RUN OS.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
qemu-system-x86_64 -machine q35 -m 1G -cpu qemu64 -soundhw ac97 -drive file=disk.img -boot d -cdrom ThisOS.iso
./cDisk.sh
qemu-system-x86_64 -machine q35 -m 1G -cpu qemu64 -soundhw ac97 -drive file=disk.img -boot d -cdrom MaslOS.iso

3 changes: 2 additions & 1 deletion LOW_MEM_RUN.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
qemu-system-x86_64 -machine q35 -m 150M -cpu qemu64 -soundhw ac97 -drive file=disk.img -boot d -cdrom ThisOS.iso
./cDisk.sh
qemu-system-x86_64 -machine q35 -m 150M -cpu qemu64 -soundhw ac97 -drive file=disk.img -boot d -cdrom MaslOS.iso

4 changes: 3 additions & 1 deletion RUN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ make

read -p "Press Enter to run..."

qemu-system-x86_64 -machine q35 -m 1G -cpu qemu64 -soundhw ac97 -drive file=disk.img -boot d -cdrom ThisOS.iso
./cDisk.sh

qemu-system-x86_64 -machine q35 -m 1G -cpu qemu64 -soundhw ac97 -drive file=disk.img -boot d -cdrom MaslOS.iso

Binary file removed ThisOS.iso
Binary file not shown.
Binary file removed block.img
Binary file not shown.
7 changes: 7 additions & 0 deletions cDisk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ ! -f ./disk.img ]; then
echo "<Creating disk.img>"
fallocate -l 5242880 disk.img
fi

Binary file removed disk.img
Binary file not shown.
Binary file added images/boot.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/crash window.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/crash.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/desktop background.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/desktop.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/doom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/empty.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/explorer test 1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/explorer yes.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/filesystem test.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/heap statistics.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/image-component.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/importing cs file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/importing text file.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/login test.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/maab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/new kernel panic.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/notepad yes.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pong 2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pongus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/raycaster demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/resize.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/resizing code.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/stack trace.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/terminal test 1.PNG
1 change: 1 addition & 0 deletions images/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added images/yes.PNG
4 changes: 0 additions & 4 deletions kernel/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ $(KERNEL): $(OBJ)
@ echo !==== COMPILING $^
nasm $(NASMFLAGS) $^ -f elf64 -o $@

%interrupts/syscall_asm.o: %interrupts/syscall.asm
@ echo !==== COMPILING $^
@ echo !==== COMPILING $^
nasm $(NASMFLAGS) $^ -f elf64 -o $@

%interrupts/interrupts.o: %interrupts/interrupts.cpp
@ echo !==== COMPILING $^
Expand Down
Binary file modified kernel/kernel.elf
Binary file not shown.
2 changes: 1 addition & 1 deletion kernel/kernel/____Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

OSNAME = ThisOS
OSNAME = MaslOS

GNUEFI = ../gnu-efi
OVMFDIR = ../ovmfbin
Expand Down
7 changes: 2 additions & 5 deletions kernel/kernel/src/OSDATA/osdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../kernelStuff/stuff/kernelUtil.h"
//#include "../customClasses/list.h"

#include "../kernelStuff/other_IO/ahci/ahci.h"

#include "../WindowStuff/WindowManager/windowManager.h"

//#include "../WindowStuff/Window/window.h"
Expand Down Expand Up @@ -62,10 +62,7 @@ struct OSData

uint32_t wantedFps = 60;
AC97::AC97Driver* ac97Driver = NULL;
AHCI::Port *tmp_port = NULL;
int tmp_wx;
int tmp_wy;
unsigned char tmp_hour = NULL;

};


Expand Down
2 changes: 1 addition & 1 deletion kernel/kernel/src/Rendering/BasicRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void BasicRenderer::ClearDotted(uint32_t col)
void BasicRenderer::Cls()
{
BasicRenderer::Clear(0);
BasicRenderer::Println("(OLD) SkylineSystem v0.35", Colors.green);
BasicRenderer::Println("(OLD) System v0.35", Colors.green);
BasicRenderer::Println("-------------------", Colors.green);
BasicRenderer::Println();
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/kernel/src/Rendering/testoDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void PrepBootScreen()
GlobalRenderer->CursorPosition.y = menuBarPosY - 30;
GlobalRenderer->CursorPosition.x = GlobalRenderer->framebuffer->Width / 2 -
12 * 8 / 2;
GlobalRenderer->Println("SkylineSystem BOOT", Colors.yellow);
GlobalRenderer->Println("MASL OS BOOT", Colors.yellow);

GlobalRenderer->Clear(
menuBarPosX - menuborderSize, menuBarPosY - menuborderSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#include "guiStuff/components/textField/textFieldComponent.h"
#include "../../../memory/heap.h"
#include "../../../cmdParsing/cstrTools.h"
#include "../../../kernelStuff/other_IO/serial/serial.h"

GuiInstance::GuiInstance(Window* window)
{
waitTask = NULL;
waitTask2 = NULL;
waitingForTask = false;
OnWaitTaskDoneCallback = NULL;
OnWaitTaskDoneHelp = NULL;
Expand Down Expand Up @@ -86,8 +88,16 @@ void GuiInstance::Render()
if (screen == NULL)
return;

if (waitTask == NULL && !waitingForTask && waitTask2 != NULL)
{
//Serial::Writeln("Switching to Task2");
waitTask = waitTask2;
waitTask2 = NULL;
}

if (waitTask != NULL)
{
DoTask(waitTask);
if (waitTask->GetDone())
{
if (OnWaitTaskDoneCallback != NULL)
Expand All @@ -113,13 +123,15 @@ void GuiInstance::Render()
&bruhus
);
window->resizeable = oldResizeable;
window->closeable = true;
}
else
{
if (waitingForTask)
return;
waitingForTask = true;
window->renderer->ClearDotted(Colors.black);
window->closeable = false;
oldResizeable = window->resizeable;
window->resizeable = false;
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class GuiInstance : public DefaultInstance
List<GuiComponentStuff::BaseComponent*>* allComponents;

Task* waitTask;
Task* waitTask2;
bool waitingForTask;
bool oldResizeable;
void* OnWaitTaskDoneHelp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void TerminalInstance::Cls()
{
NewTerminalInstance* tempInst = (NewTerminalInstance*)newTermInstance;
tempInst->Clear();
tempInst->Println("SkylineSystem v0.55", Colors.green);
tempInst->Println("System v0.55", Colors.green);
tempInst->Println("-------------", Colors.green);
tempInst->Println();
tempInst->Render();
Expand Down
4 changes: 3 additions & 1 deletion kernel/kernel/src/WindowStuff/Window/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Window::Window(DefaultInstance* instance, Size size, Position position, const ch
OnResizeHelp = NULL;
OnPartRenderHelp = NULL;
RenderWhenHidden = false;
closeable = true;
this->instance = instance;
this->position = position;
this->size = size;
Expand Down Expand Up @@ -115,7 +116,8 @@ WindowActionEnum Window::GetCurrentAction()
int64_t x = position.x + size.width;
int64_t y = position.y - 22;

if (MousePosition.x >= x - 20 && MousePosition.x <= x && MousePosition.y >= y && MousePosition.y <= y + 20)
if (MousePosition.x >= x - 20 && MousePosition.x <= x && MousePosition.y >= y && MousePosition.y <= y + 20
&& closeable)
return WindowActionEnum::CLOSE;
x -= 20;

Expand Down
1 change: 1 addition & 0 deletions kernel/kernel/src/WindowStuff/Window/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Window
// uint32_t cpuUsagePercent;
bool showTitleBar, showBorder, moveable, hidden, resizeable;
bool oldHidden;
bool closeable;

bool moveToFront;
const char* title;
Expand Down
28 changes: 27 additions & 1 deletion kernel/kernel/src/WindowStuff/WindowManager/windowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ if (window != NULL)
AddToStack();
//osData.debugTerminalWindow->Log(" : ################", Colors.black);
osData.debugTerminalWindow->renderer->CursorPosition.x = 0;
osData.debugTerminalWindow->renderer->CursorPosition.y -= 16 * 15;
osData.debugTerminalWindow->renderer->CursorPosition.y -= 16 * 17;

AddToStack();
osData.debugTerminalWindow->renderer->Clear(
Expand Down Expand Up @@ -1052,6 +1052,32 @@ if (window != NULL)
osData.debugTerminalWindow->Log("<NO AC97>", Colors.yellow);
RemoveFromStack();

AddToStack();
osData.debugTerminalWindow->renderer->Clear(
osData.debugTerminalWindow->renderer->CursorPosition.x,
osData.debugTerminalWindow->renderer->CursorPosition.y,
osData.debugTerminalWindow->renderer->CursorPosition.x + 240,
osData.debugTerminalWindow->renderer->CursorPosition.y + 16,
Colors.black);
if (osData.ac97Driver != NULL)
osData.debugTerminalWindow->Log("AC97 DO CHECK: {}", to_string(osData.ac97Driver->doCheck), Colors.yellow);
else
osData.debugTerminalWindow->Log("<NO AC97>", Colors.yellow);
RemoveFromStack();

AddToStack();
osData.debugTerminalWindow->renderer->Clear(
osData.debugTerminalWindow->renderer->CursorPosition.x,
osData.debugTerminalWindow->renderer->CursorPosition.y,
osData.debugTerminalWindow->renderer->CursorPosition.x + 240,
osData.debugTerminalWindow->renderer->CursorPosition.y + 16,
Colors.black);
if (osData.ac97Driver != NULL)
osData.debugTerminalWindow->Log("AC97 DATA SRCS: {}", to_string(osData.ac97Driver->audioDestination->sources->getCount()), Colors.yellow);
else
osData.debugTerminalWindow->Log("<NO AC97>", Colors.yellow);
RemoveFromStack();


RemoveFromStack();

Expand Down
32 changes: 27 additions & 5 deletions kernel/kernel/src/audio/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ namespace Audio
return 0;

long sR1 = sampleRate;
if (sR1 == 0)
return 0;
long sR2 = other->sampleRate;
if (sR1 == 0 || sR2 == 0)
return 0;

//float sR3 = sR1 / (float)sR2; // x Samples of other to 1 sample of this
long asC2 = ((sC2 * sR1) / sR2); // amount of samples of other to mix into this
//Panic("YO {}", to_string(sC2 * sR1), true);
long commonSC = min(sC1, asC2); // amount of samples to mix
if (commonSC <= 0)
return 0;
return sC2;

long osC2 = ((commonSC * sR2) / sR1); // amount of samples of this to mix into other
long osC2 = ((commonSC * sR2 + (sR1 / 2)) / sR1); // amount of samples of this to mix into other


int cC1 = channelCount;
Expand Down Expand Up @@ -228,7 +228,13 @@ namespace Audio
{
from->readyToSend = false;
from->samplesSent = 0;
from->buffer->ClearBuffer(); //maybe remove later?
from->buffer->sampleCount = 0;
// from->buffer->ClearBuffer(); //maybe remove later?

if (from->OnFinish != NULL)
{
from->OnFinish(from->OnFinishHelp, this);
}

// Serial::Writeln();
// Serial::Writeln("FROM SAMPLES SENT: {}", to_string(from->samplesSent));
Expand Down Expand Up @@ -284,9 +290,12 @@ namespace Audio

BasicAudioSource::BasicAudioSource(AudioBuffer* buffer)
{
this->destinations = new List<void*>();
this->buffer = buffer;
this->readyToSend = false;
this->samplesSent = 0;
OnFinish = NULL;
OnFinishHelp = NULL;
}
void BasicAudioSource::ConnectTo(BasicAudioDestination* dest)
{
Expand All @@ -295,6 +304,7 @@ namespace Audio
if (dest->sources == NULL)
return;
dest->sources->add(this);
destinations->add((void*)dest);
}
void BasicAudioSource::DisconnectFrom(BasicAudioDestination* dest)
{
Expand All @@ -309,6 +319,18 @@ namespace Audio
}
void BasicAudioSource::Free()
{
if (destinations != NULL)
{
for (int i = 0; i < destinations->getCount(); i++)
{
BasicAudioDestination* dest = (BasicAudioDestination*)destinations->elementAt(i);
if (dest != NULL)
DisconnectFrom(dest);
}
destinations->free();
_Free(destinations);
}
destinations = NULL;
if (buffer != NULL)
buffer->Free();
buffer = NULL;
Expand Down
3 changes: 3 additions & 0 deletions kernel/kernel/src/audio/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ namespace Audio
class BasicAudioSource
{
public:
List<void*>* destinations;
AudioBuffer* buffer;
int samplesSent;
bool readyToSend;
void* OnFinishHelp;
void (*OnFinish)(void* bruh, BasicAudioDestination* dest);

BasicAudioSource(AudioBuffer* buffer);
void ConnectTo(BasicAudioDestination* dest);
Expand Down
Loading

0 comments on commit dab4305

Please sign in to comment.