Typing on keyboard in a textbox (still in development) 😅
▲ 27 r/osdev

Typing on keyboard in a textbox (still in development) 😅

u/devcmar — 3 days ago
▲ 16 r/osdevel+1 crossposts

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

u/devcmar — 3 days ago
▲ 6 r/osdev

Files app update with drop shadow in my Os: What do you think about the design

I used no AI in making this files app, how do you think it looks.
Obviously I probably need shadow behind windows that would probably make it look dope.

u/devcmar — 4 days ago
▲ 1 r/osdev

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));
    }


}
u/devcmar — 5 days ago
▲ 30 r/osdevel+1 crossposts

I will be streaming my Os Dev journey without using any AI

here is the twitch account, hope you do well:

https://www.twitch.tv/devcmar

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 !

u/devcmar — 5 days ago
▲ 20 r/osdevel+1 crossposts

Simple file viewer in my os with blur behind window (0% AI)

There are some bugs that I should fix, like caching a file entry twice and some latency probably caused by low thread priority but here is the progress whatsoever, hope you do well :)

u/devcmar — 6 days ago
▲ 2 r/osdev

Compositor Blur Behind Window Effect with Sub-Region blur (Most of it Not AI)

u/devcmar — 6 days ago
▲ 15 r/osdev

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.

u/devcmar — 10 days ago
▲ 11 r/osdev

Added image and SVG Rendering

Hello, hope u do well, sorry for the mistakes of the post before, how do u find this progress?

u/devcmar — 10 days ago
▲ 19 r/osdev

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

u/devcmar — 11 days ago
▲ 0 r/osdev

Update: Making a Gpu Accelerated UI for my Os

I’ve added a button and hover animation to the button,

u/devcmar — 19 days ago
▲ 37 r/osdev

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);
}
u/devcmar — 20 days ago
▲ 36 r/osdev

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++;
                }
            }
u/devcmar — 26 days ago
▲ 23 r/osdev

Benchmarking NVMe in Bare metal using my OS (100% not AI) Reading from C drive

u/devcmar — 27 days ago
▲ 104 r/osdev

Writing a file in NTFS

Here I got to test my NTFS Driver to write a file and check on linux if anything changed, what do you think?

u/devcmar — 28 days ago
▲ 4 r/osdev

Fonts running in my Os using harfbuzz + freetype

I always wanted to integrate harfbuzz to get good shaping, now I succeded and here is the result with Open Sans Font, I also had to build an entire libc compatibility layer for it to link with my window manager :)

u/devcmar — 28 days ago
▲ 3 r/osdev

Liquid glass effect retry

My previous implementation did not seem that good so what do you think about this one and Thanks for feedback!

u/devcmar — 1 month ago
▲ 46 r/LiquidGlassDesign+3 crossposts

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?

u/devcmar — 1 month ago
▲ 51 r/GraphicsProgramming+2 crossposts

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.

u/devcmar — 1 month ago