News for hackers. Stuff that matters.
Re:KolibriOS – operating system written entirely in assembly... by snvzz on Thursday April 16, 2020 @01:51PM (#22891809)
I got my asm one down to 268 without even trying.

It prints (via write syscall) "hello world.\n" and then calls exit(0).

Assembled with fasm, linked with ld -n, then stripped.

Re:KolibriOS – operating system written entirely in assembly... by SomeoneFromCA on Thursday April 16, 2020 @05:14PM (#22893649)
Ok fine, I've used the tool called sstrip from a suite called ELFKickers. Now my hello_world.cpp (yes, c++) is 380 bytes long. I could not make it any shorter, so yeah, it is 120 bytes (50%) bigger than yours.
Re:KolibriOS – operating system written entirely in assembly... by snvzz on Friday April 17, 2020 @01:21AM (#22896452)
Regarding sstrip, I am familiar with it. Be careful that you know what it actually does.
Re:KolibriOS – operating system written entirely in assembly... by SomeoneFromCA on Friday April 17, 2020 @09:53AM (#22898974)
So, not order of magnitude then?
Re:KolibriOS – operating system written entirely in assembly... by snvzz on Friday April 17, 2020 @12:17PM (#22900301)
Yes, just look into how much effort you had to put vs my five minutes attempt.

The difference is between just using asm, or going out of the way to try to coerce a C toolchain to minimize the bloat.

Re:KolibriOS – operating system written entirely in assembly... by SomeoneFromCA on Friday April 17, 2020 @01:18PM (#22900935)
Yea, large effort (objcopy, strip, sstrip), that I need to do only once, after that I already know how to do this an can just put it in a shell script. Now, I would like to know how quickly you'll be able to write a quicksort implementaion, that would outperform my C code, while being at least 25% smaller . Yeah, and how big your binary will become, once you link libc or opengl or whatever to make it able to do actual work.