Hello,
I really like the idea of BareMetal OS and I follow its development for quiet a while now.
The main problem I see is the lack of a high performance IO API.
In an operating system that uses only a single thread per execution unit blocking a whole core
to do a basic file read/write is a huge problem when writting some high performance code. Imagine
a server that has more assests to serve than the main memory can hold.
That's why I spend some time thinking on how to implement an IO API that achieves these goals.
The main idea is to have an event driven system which cooperates quiet well with the job queue of
BMOS because it already has the main loop. Moreover a focus is on never blocking therefore data
being accessed should always be locked in memory.
I've written a simple pseudo c code to present the idea:
The presented version includes a buffer cache but a version without it could be made by adding
a simple target address pointer to some functions. This would mean the user would be responsible
for allocating the main memory. Maybe something between that would be right like a default cache
which can be deactivated ?
Another idea I had would reduce the number of system calls:
Every request like read a file, start a timer, send data over a socket gets pushed on a stack
and the next io_poll() call would fire them in the same order. If it helps performance ofc.
An additional version which directly fires for priority requests could be added e.g. io_read and
io_pread()
I'd really appreciate your thoughts on my ideas.
Christoph