
KolibriOS – operating system written entirely in assembly language - xvilka
https://kolibrios.org
======
mysterydip
I don't mean this as a slight because I love the project and other light fast
OSes... but with modern compilers, what does assembly get you over just using
C or another language and having it handle the translation? I was under the
impression compilers nowadays have lots of optimizations that would take a lot
of work for a human to do by hand, as well as creating less
readable/maintainable code.

~~~
jbk
> but with modern compilers, what does assembly get you over just using C or
> another language [...] I was under the impression compilers nowadays have
> lots of optimizations that would take a lot of work for a human to do by
> hand

dav1d, the open source AV1 decoder, has now more asm than C code. It's one of
the most recent open source projects with significant asm work ongoing.

The asm version outperforms the C version (full optimizations enabled) by 4,5x
on AVX2.

We have similar results in SSSE3 (3,5x) and ARM64 (4x).

We're not talking about a few percents, we're talking about multiple times
faster.

And AV1 is a standard, so there are no algo shortcuts that can be made: it is
either compliant or it is not.

Sure, in most cases, it is not needed to write asm; but there are cases,
notably for multimedia, where writing asm by hand is a lot faster, and that
includes codecs and game engines.

~~~
wiz21c
Well, video decoding is very adapted to ASM, I'd say. You can use
vectorisation, you can optimize pipelined executions, etc. Things were
compiler may not be so good (my experience is a bit dated). You also optimize
a few tight loops, so you can really invest time in them with good ROI.

I'm not sure that operating systems are so suited to ASM optimization (in the
sense that you may not reap so many benefits). Maybe one could optimize for
size (so you can make super tiny OS) ?

~~~
JohnBooty

        Maybe one could optimize for size (so you can make super tiny OS) ?
    

Yes, and remember... optimizing for code size _is_ optimizing for speed. =)

Smaller code and data = more CPU cache hits, which are orders of magnitude
faster than fetching from RAM. So even if "all" you do is make code smaller,
you can get more speed...

~~~
fractalb
> Yes, and remember... optimizing for code size is optimizing for speed. =)

Not always. I think loop-unrolling is a common perf-optimisation technique.
Even if the perf-gain is positive in this case, I highly suspect that it
doesn't outweigh the cost of maintaining asm code(vs C/other higher level
code).

edit: formatting

~~~
davedx
Yep. I remember loop unrolling the skeletal animation code in libgdx way back
resulted in a significant performance increase. And that was in Java

------
IvanK_net
To try KolibriOS without installing anything, you can emulate it in your web
browser here: [https://copy.sh/v86/](https://copy.sh/v86/) .

~~~
tomcam
This is amazing. A lot of it works on my iPad.

------
longtermd
Exciting! Please be much more specific on your webpage "much faster" (so...
2X, or 10X, ... or just 10%)? Also for "requires only few MB". What are "few
MB" for you? 1? 10? 100? :) Please be specific with all your claims and
measure everything, to be more credible and useful.

~~~
wumms
Live CD is ~65MB (the website says the core fits on a 1.44MB floppy). It boots
in less than one second (VirtualBox using defaults for "unknown OS"). Mouse
and keyboard are working but are not fit for real use.

"If you really want guest addons for KolibriOS to be available, you may offer
your help in porting them"
[http://wiki.kolibrios.org/wiki/Setting_up_VirtualBox](http://wiki.kolibrios.org/wiki/Setting_up_VirtualBox)

~~~
diggan
65MB seems big if compared to Tiny Core Linux for example, which is 11MB:
[http://tinycorelinux.net/](http://tinycorelinux.net/) Maybe it's packing more
features than Tiny Core Linux though, unsure.

~~~
epse
It packs a bunch of games on that 65MB for starters, so not surprising

------
omginternets
What niche is this supposed to occupy? I can't seem to find any information on
when/why KolibriOS would be a good choice over more traditional OSes.

Stated differently: is this a useful thing, or is it an exercise in "how far
can we push a pure-assembly project"? The latter would of course be fine, but
I'm quite curious to know which it is.

~~~
malinens
how about the tiny niche called fun which increasingly is harder to find
around? (:

~~~
omginternets
> Stated differently: is this a useful thing, or is it an exercise in "how far
> can we push a pure-assembly project"? The latter would of course be fine,
> but I'm quite curious to know which it is.

;)

------
MaxBarraclough
Yes, it runs DOOM. A good milestone for these sorts of OSs.
[http://wiki.kolibrios.org/wiki/Doom](http://wiki.kolibrios.org/wiki/Doom)

------
palant
It's really fast, and it has a nice retro touch to it. But claiming that is
has a web browser is clearly an exaggeration. It's a text-based browser, and
for some websites it cannot even display the text (crashes). So as a consumer
operating system it isn't really good for anything. Unless you want to play
retro games all day long of course.

The website also claims that the operating system has a "word processor." A
more appropriate term for it would be "text editor," it appears to be less
functional than Notepad on Windows.

------
andai
I wonder to what degree software written in assembly is faster precisely
because it's harder to write. The result is that you end up with a lot less of
it.

Everything's fast in the early stages, when there's not so much of it yet.

------
xvilka
See also the sources in their Subversion repository[1] and their discussion
board[2].

[1] [http://websvn.kolibrios.org/](http://websvn.kolibrios.org/)

[2] [https://board.kolibrios.org/](https://board.kolibrios.org/)

~~~
themodelplumber
Seems to be heavily...Russian? Ukrainian? Not that I mind, but I wish there
was a universal language for code comments :-)

~~~
saagarjha
As a native English speaker, I think the situation leans fairly in my favor
already.

~~~
themodelplumber
As a frequent coment typo maker I'm conflicted about others reading my
comment's in general

~~~
michaelg7x
Bien joué ;)

------
znpy
I remember trying MenuetOS about 12-13 years ago and being surprised by how
much stuff they were able to deliver in so little space.

At the time the whole system booted off a floppy disk in a split second
(despite the slow read rates and seek time of floppy disks!)

------
barbs
How does this differ from the project it forked from (MenuetOS)?

~~~
snvzz
The most important difference is that kolibrios is a team effort, and open
source.

Menuetos abandoned its 32bit version (the one that was open) to focus on
64bit, which is not, and even has a clause in the license that prohibits
disassembly.

~~~
hackerbabz
What is the commercial value of an artisinal OS like this?

~~~
apiguy
Likely low powered computing scenarios. Think set-top boxes, kiosks, cash
registers, etc. Anywhere you want to use very cheap hardware basically.

~~~
exikyut
Very cheap _x86_ hardware, to be specific.

I'm not sure if it's actually more expensive to find VIA et al based systems
for cheaper than NUCs?

~~~
snvzz
I don't know if VIA still does any of that.

But there's Vortex86.

------
projektfu
I didn’t like the event model in Kolibri so I gave up on it after poking
around programming for a while. There are a couple interesting games. I like
the Lawnmower game that’s like a house painting game I once typed in for the
C64.

~~~
72deluxe
Out of interest, what was wrong with the event model?

~~~
projektfu
I wish I could remember exactly. Too much preprocessing of input? Inflexible
calling of the program by the OS? Not sure but it was either live with it or
rewrite everything to change it.

------
tr33house
This is an amazing engineering effort. All the best!!

------
squarefoot
Well done, now port it to ARM!:)

Seriously, if there's a platform to which a so tightly packed OS could be
immensely beneficial, are all those small Linux-capable ARM boards that cost
like two beers. Even the most hardware limited ones (256 MB RAM, 32bit single
core, etc.) that still can run a complete Linux environment in some contexts
would literally scream when served something that fast and tight.

~~~
xet7
For ARM RasPi1-3, RasPi Zero etc there is Risc OS
[https://www.riscosopen.org](https://www.riscosopen.org)

From
[https://www.raspberrypi.org/forums/viewtopic.php?f=55&t=2209...](https://www.raspberrypi.org/forums/viewtopic.php?f=55&t=22093)
:

What is RISC OS?

RISC OS is a new and different OS for the Pi. It isn't Linux, it isn't Unix,
it isn't based on any other OS. It's the first ARM OS, begun in 1987 by the
team who designed the original ARM processor. It's also a descendant of the OS
used on the early 1980s BBC Micro... those who remember the BBC Micro might
find some of its commands familiar. BBC BASIC is only a few keypresses away.

What's interesting about RISC OS?

It's small. It's fast. RISC OS is a full desktop OS, where the core system
including windowing system and a few apps fits inside 6MB. It was developed at
a time when the fastest desktop computer was an 8MHz ARM2 with 512KB of RAM.
That means it's fast and responsive on modern hardware. The memory taken by
apps is usually counted in the kilobytes. A 700MHz 256MB Raspberry Pi is
luxury - what to do with all that memory?

RISC OS is also a lot simpler than modern OSes such as Linux. The pace of
development has been a little slower than other OSes, which means there are
fewer layers getting between you and the system. It's much easier to get stuck
in and change things. It's also easier to understand. As a formerly closed-
source OS, most of the interfaces are documented in a series of books called
the Programmers' Reference Manuals (PRMs) which are included on the RISC OS Pi
distro. That means you can change a lot of things without having to work on
the OS code itself (which is available if you want it). It's very modular, so
you can mix and match components, and the communications between modules are
carefully documented.

RISC OS gets out of the way. It's a 'co-operatively multi-tasked' OS. While
that means one misbehaving application can stall the system until you kill it,
it also means you easily write apps that take over the whole machine - for
example controlling hardware where you need predictable timing. RISC OS is a
single-user OS, which means there's very little security - not great for
internet banking, but very handy when you want to dig around and program the
internals of the OS.

As a full desktop OS, there's also plenty of traditional desktop software
available like drawing programs and desktop publishers. Features you've come
to expect on a desktop like scalable fonts and printing are supported. RISC OS
was big in UK education in the 1990s, and there's a large back catalogue of
educational software.

------
lebuffon
Sometimes I get the sense that people think CPU is short for "C" Processing
Unit.

:)

------
alexandercrohde
Not to be a buzzkill, but I'd like the exact opposite. An operating system
with no asm, no C. Processors are over 1,000x what they were when I was young,
I wish I could trade some of that 1000x for fewer security holes.

~~~
plumbus420
I know back in the day there were talks of having Linux (or some other OS?)
being re-written in Java, but it never panned out. At least that's what my
professor told me, but I can't seem to find any info about it.

But there is an OS being written in Rust. [https://www.redox-
os.org/](https://www.redox-os.org/)

------
anthk
Does it have a Gopher client?

------
datajack
Malwarebytes Premium is blocking the download(s) and access to
board.kolibrios.org. Unable to download any images.

------
anta40
The downside of being written completely in assembly language: what if someone
wanted to port Kolibri to, say, ARM CPU?

Hmm...

------
mrzool
Is it Unix? Does it ship with a standard shell? Would I be able to build and
install standard packages on it?

~~~
kwhitefoot
No it isn't and the shell is quite limited it seems although it does look like
it could be extended.

If this could run Bash, rclone, and whatever Ethernet hardware I have in my
old laptops I think it would be really useful.

I wonder how much effort would be needed to port the GNU Core Utilities?
Probably well outside my comfort zone.

Still it should be worth a look!

------
0xTJ
I've tried writing an OS purely in assembly before, but gave up while writing
the virtual file system.

------
aforty
*written almost entirely in assembly language, he says so himself in the video.

------
stefanve
reminds me of menuet OS [http://menuetos.net/](http://menuetos.net/)

~~~
boudin
It's a fork of menuetos actually

------
mixmastamyk
Reminds me of minuet, wonder how it compares.

~~~
prox
It says it is a fork of minuet (2004)

------
tau255
Is there a way to boot it from systemd-boot?

------
stef-13013
Nice proof of concept, really. The challenge is quite interesting... But in
the real world, it won't fit at all.

------
infamousebrave
Does this OS have linux shell?

------
infamousebrave
Does this OS have Linux Shell?

~~~
palant
No. It has a shell albeit a pretty limited one - it's pretty rudimentary, like
pretty much all the applications available.

------
pyuser583
Why? What’s the point?

~~~
mmariani
Read the second paragraph on the posted link.

“Have you ever dreamed of a system that boots in less than 10 seconds from
power-on to working GUI, on $100 PC?”

~~~
unnouinceput
Have you seen Windows 10 IOT booting in less then 5 seconds on a $50 Raspberry
Pi? Because I do.

------
bprajapa
Title seams kinda of skeptical, I'll believe it when I see the source code.

~~~
konart
Go ahead [http://websvn.kolibrios.org/](http://websvn.kolibrios.org/)

