

What do you think about this command prompt app design for my os
I’ve live streamed the making of it, so I dare anyone to say it’s AI ;) haha
Here is the link : https://twitch.tv/devcmar
Though the output does not probably show up on the livestream because it is running in another tty
Events with multiple listeners, an easy-to-use implementation
What do you think about the events implementation I just made and livestreamed my making of it, it is designed to be fast and simple, supporting multiple writers and multiple receivers:
here is the link to the video with the implementation https://www.twitch.tv/videos/2846679809
here is an example code I used to receive mouse event:
HANDLE CursorEvent = Open(NULL, "Events/Cursor", 0);
for(;;)
{
UINT64 Buffer;
Read(CursorEvent, &Buffer, 0, sizeof(Buffer));
Print("WM Received mouse input: x : %d\n", Buffer);
}
and here is how it gets sent:
void MouseInterruptHandler(void)
{
// Print("Mouse interrupt.\n");
UINT8 Data = Ps2ReadData();
// Print("PS/2 Mouse Interrupt DATA %x\n",(UINT32)Data);
if(PacketIndex==0 && !(Data & 8)) return; // First packet should have bit 3 set
if(PacketIndex==0 &&
(Data==0xFF || Data==0xFA || Data==0xAA)
) return;
Packet[PacketIndex]=Data;
PacketIndex++;
if(PacketIndex==3) {
INT32 dx=Packet[1],dy=(-Packet[2]);
CursorX += dx;
CursorY += dy;
Print("Mouse DX %d DY %d Buttons %x\n", dx, dy, Packet[0]);
PacketIndex=0;
UINT64 Buffer = 123;
Write(CursorEvent, &Buffer, 0, sizeof(Buffer));
}
}
I will be streaming my Os Dev journey without using any AI
here is the twitch account, hope you do well:
I'm going to create the CPU rendered compositor in front of you, with absolutely no AI usage and everything is recorded on live with replay included. hope things go well,
I hope you do well.
Please be supportive, and please do not stone me in the comments !
Basic cursor hit testing + hover animation (Mouse enter/leave events)
Code is mostly built by hand, honestly I forgot, sorry for saying 0% AI before I copy pasted a very small chunk of code that was actually AI generated (Vertex conversion to NDC coordinates or linear coordinates, not something that much, when I was still new to opengl development) but most of the thousand lines in the window manager library is actually built by hand by me as well as the kernel and most of the system.
Accidentally removed ui library and had to rewrite it, this is the progress so far
EDIT: I actually agree with the majority of the comment section, it was an error not using git for this one like on the other projects I made, I knew about git but did not use it for almost a year for this project and instead used a backup drive, but now I used it, I had other projects in github years before.
It took days to rewrite, that may justify my short absence in the community, hope u do well ;). And no, there is 0% AI generated code in the window manager library. Actually aiming to make a better version this time with layouts, svgs pictures etc let’s see how it comes out
Developping a GPU Accelerated UI for my OS That can be used inside 3D Apps
Here I’m trying to make a UI that is easy to use, and can be easily integrating into 3D apps running OpenGL and probably Vulkan in the future, any advices?
Here is the example code:
#include <Defines.h>
#include <Syscall.h>
#include <Fs.h>
#include <Wm.h>
#include <OpenGL.h>
float CursorX, CursorY;
WM_UI_CONTEXT* UiContext;
WM_UI_VIEW* MainView;
void WindowMessageHandler(HANDLE Window, void* Context, int MessageId, void* Payload)
{
switch(MessageId) {
case WM_POINTER:
{
WM_MSG_POINTER Msg = Payload;
CursorX = Msg->X;
CursorY = Msg->Y;
WmUiMoveCursor(UiContext, Msg);
Print("CURSOR X: %d Y: %d\n", (int)CursorX, (int)CursorY);
break;
}
case WM_UPDATE:
{
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, 800, 600);
glScissor(0, 0, 800, 600);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
WmUiRender(UiContext);
GlSwapBuffers();
break;
}
}
}
int main(int argc, char** argv) {
Sleep(1000);
HANDLE Context = GlCreateContext(NULL, NULL, 3, 3, 0);
if(!Context) {
Print("Failed to create GL Context.\n");
return -1;
}
WM_MESSAGE_QUEUE MessageQueue;
GlMakeCurrent(Context);
HANDLE Window = WmCreateWindow(NULL, 800, 600, 0, &MessageQueue);
if(!Window) {
Print("Failed to create window.\n");
return -1;
}
WmBindContext(Window, Context);
UiContext = WmUiCreateContext(Window, 800, 600);
MainView = WmUiCreateView(UiContext, NULL, (RECT){0, 0, 800, 600});
WM_UI_DESCRIPTION Description[] = {
{.Type=WM_DESC_TEXT, "This is a label."},
{.Type=WM_DESC_FONT_COLOR, (float[4]){1, 1, 1, 1}},
{.Type=WM_DESC_FONT_SIZE, .Value.d = 40.0},
{0}
};
WmUiCreateControl(MainView, WM_UI_LABEL, (RECT){20, 20, 300, 100}, Description);
return WmStartMessageHandler(&MessageQueue, WindowMessageHandler, NULL);
}
Map() or mmap() equivalent doing around 14mops/s with actual memory commit and custum allocator
The previous post had a miscalculation I adjusted the time for another variable by mistake now with taking consideration to how much time it took to exhaust memory it gave around 14mops/s.
Btw this is he code I used to benchmark I think it is alright:
UINT64 Tsc = _rdtsc();
Sleep(100);
UINT64 Freq = (_rdtsc()-Tsc)*10;
Tsc = _rdtsc();
UINT64 Count = 0;
Print("Starting benchmark...\n");
// for(int i = 0;i<100;i++)
// {
// CreateThread(
// test,
// NULL,
// ANY_PROCESSOR,
// 0
// );
// }
UINT64 IoCount = 0;
void* Addr = (void*)-1ULL;
for(int i = 0;;) {
for(int i = 0;i<10;i++, Count+=ReadSize, IoCount++) {
// ReadAsync(File, Buffer, 0, ReadSize);
Addr = Map(NULL, 0, 0x1000, MEMORY_READ_WRITE);
if(!Addr) goto CalculateThroughput;
// Print("READ\n");
}
UINT64 t = _rdtsc();
if(t >= Tsc + Freq) {
CalculateThroughput:
// Print("CALCULATE\n");
UINT64 Time = t - Tsc;
IoCount = (UINT64)(((double)Freq/(double)Time)*(double)IoCount);
Print("Estimated throughput: %d MOPS/s %d KOPS/s\n", IoCount/1000000, IoCount/1000);
// Print("Estimated throughput: %d KB/s %d MB/s %d KIO/s\n", Count/1000, Count/1000000, IoCount/1000);
if(!Addr) {
for(;;) Block();
}
Count = 0;
IoCount=0;
Tsc = _rdtsc();
i++;
}
}
Water Glass UI Effect in My OS
I got an Idea to approximate apple’s water glass ui effect and it seemed to work well, what do you think? It seems to replicate natural water refraction very well?
Making a Glass UI Taskbar, your thoughts on any improvements?
This is gpu accelerated, (Already fixed the image flip u can see due to OpenGL coordinate system) this is my own Operating system with my own made kernel that can use Linux drivers to get Gpu acceleration, all drivers are User Mode, image and shaders loaded from NTFS Partition, What can I improve.