Handmade Network»saalty

Recent Activity

Hey guys, havent posted in here for a while.
I made my first dynamic x86 instruction encoder in C, which I will use for my code generation backend of my GLSL compiler, in order to directly output x86 machine code. (I am excited for the software rendered GLSL shaders!).
The disassembly is from ndisasm, and when running the machine code it returns 2468 in RAX (I run the machine code as a C function.)
The currently supported instructions are ADD, SUB, ADC, SBB, XOR, AND, OR, CMP, MOV, and RET. There is full 64-bit support. All general purpose registers and immediate values are supported. Memory addresses are not supported right now, but I will add them soon.

Now my C parser is a GLSL parser and can fully parse this shadertoy shader without modifications to the shader code!
Also have a pretty complete preprocessor now which I had to do from scratch, so that took most of the work, and added a shit-ton of other things which I dont even remember now.
Worked my ass off for this new update, ~15 hours straight of work on this. The previous screenshot it was ~800 loc, now its ~2600 just from today
Also, havent showed it off yet but I also have structs and member accesses supported
Next step is to get it to execute
This is not my shader, the shader can be found here

Hello! I am back after long hibernation from burnout (if you still remember me). Here is a C parser (AST tree is printed) that I made completely from scratch in about 2 days, will turn this into a GLSL version 330 parser and executor.
It has operator precedence too that is exactly like C's, which I am proud of as I have never done it before and have had fun learning it. It also has a nice error system, that shows exact character and line where the error happened.
The coolest thing about it though is that it is made in freestanding C, so that I can use it in my OS!

Got my own spinning shaded donut implementation (poorly formatted but it is a donut) running in my own programming language in my own OS and kernel and bootloader on real hardware, and my NVMe driver is now many times faster. I feel this is my greatest project ever! If anyone wants src: https://github.com/waternine9/untitled-os
This is the new TheOS, so &theos

Running my own programming language in my own OS/kernel! The output is the numbers after "Running BF file...", creating a "number triangle".
The program is stored as a file through my filesystem &theos

After an absolutely painful 9 hours of debugging non stop and a couple hundred reboots, my NVMe driver... WORKS ON REAL HARDWARE!

I made a little FAT-Based filesystem driver for my OS using my NVMe driver as a backend. It even has a recursive remove command!

Finally finished my NVMe driver! Here you can see it reads a bunch of hello world from a disk

My C/C++ GUI library is almost done, added actual client-side rendering and saving/loading GUIs. And when the split goes from vertical to horizontal, that's done automagically!
The video showcases how the widgets can be used dynamically to change how the output image looks in the viewport.

I made my first ever freestanding GUI constructor thing which I call FreeGUI, which I am making for my circuit simulator for my CPU, and possibly will use it in my OS
For now, it lets me just edit the binary tree of the GUI (the GUI is a binary tree basically), but there is some cool things I can do, like rotate binary tree nodes and their children as well, select which depth to edit of the binary tree, change the scaling of nodes, etc.
At the end I demonstrate the editing of the interpolation values (scaling).
The way it works: Every node in the GUI stores 1. the axis to split the node (horizontal or vertical) 2. the interpolation value along that axis to place the split. I can edit this interpolation value to change the scaling of children nodes, or change the axis to rotate the nodes, and easily create nodes.
Every node also stores a pointer to whatever attributes it has.

My 8bit CPU now can run programs up to 256 bytes (8 bit instruction pointer), and now has 16 4bit registers that I can execute mov's between and increment/decrement them! The picture below shows my CPU in its current state, with the colors resembling different currents in the wires. The bytecode for incrementing the first register is c1 (load first register into arithmetic storage), 83 (increment and load back into reg storage), and finally 40 which is basically halt

I made an 8bit CPU from scratch as a side project in a circuit simulator, supports two instructions for now. The picture below is how it looks, and so far the instructions are: step the instruction pointer, or not. Really really proud of myself for learning this much. Isn't glamorous, but I am learning

Hello, this update is an exciting one for me, because I decided to start making my OS proprietary and closed source, hoping to someday make some money off my hard work. I think this decision will motivate me to go above and beyond with my OS, and it will help me fund a lot of stuff if it ever makes money. Will be ~1 dollar CAD, if not a little more. To be honest, I don't know if you guys approve of this lol.

Anyways, in this update I wanted to show off my new fast input system (with a lot of latency just because of drawing), that uses 2 queues, one for the kernel's input queue, and the OS's input queue which works by polling the kernel's input queue. This way the keyboard driver is very protected. I use WASD keys to move the square.

You can also briefly see that at startup, there is log messages showing the start messages of my new services (background tasks). The services available are just the window manager (the service actually rendering), and the keyboard service (you can guess what this does).

My 64-bit kernel and OS now has beautiful logging inspired by Linux, 64-bit software context switching, a simple round-robin scheduler, and MULTIPLE PROCESSES!
There is also a privilege system where different processes can have different privileges for syscalls.

The video shows 2 processes sending logs.

Next up? ELF loading.

My 64-bit kernel now has a drawing library exposed for my OS, which allows for rendering many shapes and any amount of them with one draw call! (internally the draw call is int 0x80 with some params)

Took 4 days of busy debugging. Also, my OS is microkernel-based. What do you guys think of this design decision?

I just render one line here, but you can render many more lines with one draw call (just to get the point across 😄)

After an agonizing and tough 15 hours of total debugging... My kernel has reached it's end goal (or maybe this is just the beginning)... I have entered 64-bit userland!

The screenshot is of userspace code moving 0x1234 to the EAX register! This means that I can soon get user programs running.

(also sorry for posting so much, I have so many things to showcase)

Also made a 2D game with it! Has very good fully-raycasted physics, which is fast because my tile storage is natively a quad tree.

I have yet another side project: I made a terraria-style mass tile renderer completely from scratch that can render and store 4 million of individually textured tiles with arbitrary position with many holes in them at 30 FPS, all at 31 mb of ram used (including 2000x2000 textures and framebuffer), in software (half of the frame time is software bilinear texture filtering).

The black tiles you see in the video is the holes in the world.

So I have implemented a higher-half kernel mapping for my 64-bit OS, and also a 64-bit IDT (Interrupt Descriptor Table)! Took painful amount of hours to debug but now I have done it.
In the video, I demonstrate a sort of "clock" using the timer interrupt, combined with my sexy new microphone.

Finally! 64-bit 4-level paging in my OS, here I identity mapped the first 400 mb, activated paging, then wrote the letter A to the screen.
https://github.com/waternine9/Paging64/tree/main

I ported an NES emulator to run Super Mario Bros on bare metal using my own custom bootloader and kernel

I ported a popular NTSC filter to work on bare metal using my VBE-driven kernel

I just got my handmade RNN (Recursive Neural Network) that uses BPTT (BackProp Through Time) to train and the Adam optimizer, fully working, and it can remember! I am very excited to replace my old RNN impl in my Brainfuck optimizer to this one, to hopefully get amazing results.

In this case (in the screenshot), it detects if a sequence of inputs, over time, are alternating or not (1 if it is repeating, 0 if it is not)

I made a purely AI-based optimizer that optimizes brainfuck. Leave suggestions for code to optimize in #project-discussion

I made a no-bullshit package manager for C and C++, called cpak. It doubles as a package manager and build system, and you can install, use, and build with a package in 3 commands.
I also had to make the online package repository for it, which stores a file inside each package that says where the necessary build files are. cpak automatically and robustly adds all dependencies to the build command.
For example, installing and building with raylib is simply

  1. cpak install raylib
  2. cpak use raylib (this makes the current working directory able to use raylib)
  3. cpak build my_raylib_project.c -o my_raylib_exe.exe

I implemented websockets in Scratch (with a nice API).

SendTestTo decides which client to send the TestValue to

I am switching through different client windows while testing this, MyID tells what client I am currently in

My pool game is now officially 3D! It also has 3d rotations on the balls. Try it out here (to be able to shoot the cue ball, you need another person in the same lobby as you) https://poolx.saalty.repl.co/

My multiplayer, pure JS pool game looks MUCH better now and with MUCH better physics and with actual aiming guide this time! Try it out here if you want: https://poolx.saalty.repl.co/
The server also runs directly on my PC now, which means everything is so responsive!
Tons of bugs fixed as well

I made a pool (Billiards) multiplayer game with pure javascript. If you want, you can check it out here (while the server is still running): https://poolx.saalty.repl.co
Had to make a little physics engine for it as well, and figure out the multiplayer stuff.

Finished the VGA graphics driver for TheOS, and it should work for any graphics card

Making a VGA driver for &theos, first step done, turning screen on/off (here it is done repeatedly)

This triangle was rendered completely bare-bones, my own OS, my own GLSL compiler WHICH directly compiles to x86 machine code (was a pain, but using LLVM would be a shame to this project), and my own video driver of course.

This means there is 0 abstraction, my GLSL shaders now run directly on the CPU. Went from 10 to 40 fps for this one.

And yes, this is SWGL.

This is my OpenGL 3.3 implementation running in my operating system, rendering some text.

Triangles also render with antialiasing now. It's also entirely memory safe now.

https://github.com/waternine9/swgl My Software OpenGL 3.3 implementation is now... COMPLETELY FREESTANDING!!! That includes the GLSL interpreter and everything. Feel free to use it in your operating systems 😉

The main challenge was converting 3000 lines of C++ code to C code, all in 1 day. And it's public domain.

The software OpenGL 3.3 implementation now has homogenous coordinate triangle clipping, matrices in shader code, and a lot more which allows me to do this! Oh, and did I mention it's public domain? https://github.com/waternine9/swgl

The software GL implementation can now fully run the Hello Triangle example from LearnOpenGL (github for it is https://github.com/waternine9/swgl)

I made a software OpenGL 3.3 implementation completely from scratch, even made a GLSL compiler for it (the shaders you see are compiled by it, and used in the pipeline!)

My shading language, BFSL, is finally released on github! I feel it has reached a state where it's usable by the general public! https://github.com/waternine9/bfsl
It is public domain, because I want to let anyone use it freely, without worrying about all these licenses.
I also wrote some tutorials in the readme.md file that should help people get started.

Implemented SSAO in my own CPU-only shading language. This example runs 30 FPS (that includes rasterization, shading lang runs closer to 45 fps here)
My shading language takes in render output from my software rasterizer and shades it, applies textures, etc. I'll post the shader code for it in a thread.

Made a shading language and an interpreter for it

Made a triangle rasterizer... in my own from-scratch compiled language, BF!
If you want to send me some programs I can try out, documentation for the lang can be found here: https://github.com/waternine9/bflang

Got my completely from scratch language, BF, compiling to binary and running (the compiler only spits out fully NASM compatible assembly as well!), ironed out a ton of bugs and added while and for loops! Check out this example! (you will have to click on the images to see them better).
I know that the syntax is very similar to C, but that's just for this example.

Got if statements and a full type/struct system compiling in my language! The generated code has a few tiny flaws but overall I'd say it does a good job.

(you have to click on the images to see the full image for some reason)

Improved the compiler by a ton! I welcome you guys to roast the generated assembly code

Made a shitass compiler for my language in my OS because who the fuck can stop me

Finally, on real hardware

Moved &theos to use C++ instead of C, and planning it, from now on, to be fully terminal-based. Because GUIs are bloat, they disgust me.

So far it has a working command system and echo with pretty advanced arguments. Newer things printed = the higher they are. The "ERR: Command Not Found"s are when I misspelled echo.

I like this new look as well. But I want to hear your opinions on it. (Haven't pushed it to the git repo yet.) Oh, and it actually runs on real hardware now. Finally.

Got my own programming language running in my own OS, because I am badass.

Made a programming language from scratch in pure C without LLVM or ANY external tools. For now, the result of the last line of the main function is the exit code as you will see in the video, however I will add a return statement and a print statement.

This language was purely made for me to plug it into my OS so that you could program... in my OS.

Has pretty much identical-to-C syntax and supports function calling, complex expression evaluation, having a function call be an argument to another function call, all that stuff. The interpreter itself is ~500 lines of C code so it is blazing fast. https://github.com/waternine9/bflang

Wanted to test my OS, so being a graphics guy I made a pathtracer in it.

Added full multicore support to BananaOS! Now has a priority-based scheduler, support for up to 255 cores, and that means I can open a shit ton of windows on purely CPU! (ALTERNATE PROCESSORS is how many CPU cores are being used, other than the main one)

Added a file manager to my OS, and a fresh new design!

Also the OS is now named literally The OS

FAT32 has been conquered and implemented in my OS. I never felt happier than when I finally got the files saving on the disc.
(it is not 100% fat32 because I skipped over a lot of stuff but I got the file allocation table working, etc).

Runs at 60-144hz purely on CPU
Also, big thanks to ske, who has been great support by implementing pci and helping me with the filesystem a little and some other stuff.
https://github.com/waternine9/BananaOS

I made a little fluid simulator from scratch in C++

Added windows to my OS, along with a pretty complete API for the windows! File system is next! This is running in QEMU. (the icons in the taskbar are upside down, I know.) Essence, I am coming for you

Watch the entire video to see the new features!

https://github.com/waternine9/BananaOS

Banana OS got a hell of an update!
The video is the OS running in QEMU

  • Cached rendering: Allows high resolutions like the one in the video (1920x1080)
  • Antialiased fonts: Allows any antialiased font to be used in the OS! The font used in the video is Monaco.
  • Transparency
  • Batch scripting: If you watch the entire video, you will see 3 commands being used
  • Fixed ATA driver, works better now
  • Added PS/2 Keyboard driver, fixed PS/2 Mouse driver

Thanks NeGate for giving me the cached rendering idea
https://github.com/waternine9/BananaOS

Upgraded my OS by a lot.

  • New ATA disk driver
  • New terminal (LMB adds 'D' and RMB adds '\n' for now)
  • Background image loaded using the ATA disk driver
  • New digital clock at the top of the screen
  • PCI (by ske)
    https://github.com/waternine9/BananaOS
    (the codebase is messy right now)

Added PS/2 mouse for my operating system, a new font, and a whole bunch of drivers, this is the same operating system which I posted 2 days ago. It's wild how time flies eh?

Got text drawing working with proper VESA VBE graphics on my Operating System. Had to make the font myself sadly.

I am posting quite a bit in this channel, but I just wanted to show my brand new, basically from scratch OpenGL renderer which took way too long to debug which gives much better lighting and rendering capabilities (like shadows) to my from-scratch physics engine, since I felt like raylib abstracted too much stuff (sorry raysan, no more raylib for me 😢). Also made the helicopter demo nicer with variable propeller speed.

Again, lift is generated only through my from-scratch aerodynamics engine, I don't just add a simple vector to the helicopter velocity.

Got aerodynamics and propellers working with my from-scratch rigidbody engine, so I chose to make a working helicopter and propeller plane! They actually use my aerodynamics engine to produce lift since they spin very fast with an angle of attack, I am not artificially adding lift.
in the helicopter clip, the blades are moving at about the same rate as the fps so they look slower but they're very fast in actuality

Made a new rigidbody engine, this time with a car with working, rotating wheels and a little cannon to shoot at balls. No, not balls, balls. Again thanks raysan for raylib, I am using it here for rendering.

My complete rewrite of my previous engine, this one features a constraint solver! I am super proud of myself with this one so I wanted to share it with you guys :)

My (from scratch, C++) rigidbody (and softbody) engine to be used in my Kerbal Space Program clone, aerodynamic drag coming soon. Oh, and it uses raylib for rendering. Thanks raysan. Uses octree acceleration and is deterministic and stable. It's been running idle for 1 hour and no clipping, no bugs

I made a raycaster in assembly without an OS in 570 bytes with @ske including the map, and it was one big journey to get this working. x86 assembly, runs bare metal.

I made an image compressor from scratch in C++ for fun (used to render videos on my OS soon). The lower quality picture is my Compressed result which is 5% in size approximately. (picture from the King's Crook game)

https://www.youtube.com/watch?v=XrzKIIOSfS4 A C++ software rasterizer made fully from scratch by yours truly, I am very proud of this one. Also comes with complete shadow mapping and animation (made this like 6 months ago but I still want to share it since it's handmade :))

And got it running bare metal with a command line on my actual computer, how romantic!

happy valentine's day. And this is a user made program which is runned in my first OS (and I am pretty proud of it)

Pretty proud of this jellyfish softbody simulation I made with my own software renderer and my own physics engine, everything is from scratch. Runs at like 30 FPS https://www.youtube.com/watch?v=8J-hJKUi6nQ

Here's another one of my projects, my full x86 16-bit operating system which I made fully in assembly with disc I/O which runs on bare metal and can run user-made machine code inputted into the hex dump

Made a raytracer in under ~700 bytes (in the disc image) fully in x86 assembly in 32 bit protected mode using the FPU which runs on bare metal with support for VESA/VBE graphics modes since this will evolve into a pathtracer. Renders a green sphere for now. (takes 5 seconds for render)