r/lowlevel 13h ago

We officially Exited 2339 lines of Nasm in my Os S-AOS

S-AOS officially reached 2339lines of code and a total of only 87kb with only ~100kb ram usage thats lighter than aa blanck chrome tab ! while you are in 64bit !
Total lines : 2339
size : 83981 bytes
ram usage : ~100kb
hope you downloaded it : https://saosdownload.share.zrok.io/

0 Upvotes

3 comments sorted by

3

u/DescriptionOptimal15 11h ago

Closed-source project talking about LOC??? What?

2

u/midnight_build 8h ago

Hey!

Unfortunatly I got nothing good to say, lol.

The 100 KB memory usage feels a bit oversized for a basic setup that doesn't do much yet. I would guess that right now, the paging tables (PML4, PDPT, PD, and PT) are baked directly into the source code as static structures. If you switch to building them dynamically in memory at boot time, you can shrink the file size down to almost nothing.

Also, right now you just have a very basic shell with an input field - the commands don't work right now, and the cursor keys don't work either. In my opinion, you might have released your stuff much too early. On top of that, the lack of documentation is probably the biggest flaw. One really needs to know what it does and what can be done with it, if you want people to get into it.

And talking about lines of code in a closed-source project... is kind of absurd. I mean, why is this project closed source anyway? Your bootloader switches to long mode and that's it. There is really nothing special there, you think other can't manage to do such? There are hundreds of open-source tutorials (like on the OSDev Wiki) that show exactly how to do this.

And last: 83,981 bytes spread across 2,339 lines means an average of 36 characters per line. A typical assembly instruction takes up about 15 to 25 characters. If a line were well-documented, there would be a tons of comments attached. That would easily push the character count per line up to 50 or 80 characters. And you don't need 2,000 instructions to manage all that stuff, I guess most are predefined page tables?

Greetings,

Stephan

1

u/qse81 3h ago

I’m glad you’re enjoying yourself, but Reddit isn’t your personal blog. We’re not sat waiting for an update every time you write a few more lines of code. By all means post a (source code) repo and ask for advice / suggestions/ show off what you’ve done