Hi,
jwzumwalt wrote:I am a retired software engineer dating back to cpm & S-100.
I recently created a dedicated FreeDos computer to get acquainted again
in simple OS design.
A VM would also work for this. That said, I'd suggest you to try more OSes. For example: Haiku, KolibriOS, Sortix, ToaruOS, etc.
I am considering writing my own OS primarily for personal reasons and would
like a reality check prior to taking on the endeavor. I enjoy graphics programming
more than any other.
That's cool. OS development is a quite fun journey. Note however that it will be probably hard for your OS to have 3D capabilities anytime soon.
What most interests me is any bench-marked testing that may have been done
for Vesa1-3 ASM high res graphics compared to the mainstream platforms?
I would consider my effort a success if I could get 2x benchmarks; of course 3-5x
would be better.
I don't think any benchmark like that exists. I also doubt that a CPU renderer written in assembly would be 2x faster than a GPU renderer (see also
this). That said, I would actually like if CPUs were faster than GPUs, thus rendering GPUs useless. Programming computation-intensive tasks would be probably much simpler. For example, I would like it if shaders were simple callback functions written in the same language as the main application and I would like it if you didn't need to worry about moving data from the CPU to the GPU and back.
As a side note, I'd suggest you to avoid using coloured text (on any forum, not just this one). Not everyone uses the same theme and your text might not be always exactly readable.
The basic design would be a "Superdos"...
Not sure it would be a good idea to base your modern OS design on DOS. For example, you need to hop through many hurdles just to get multitasking and paging in DOS. Or networking. Or modern graphics and audio capabilities.
1) graphics speed having highest consideration
If you are aiming to play games, then probably fast graphics would be a top priority (along with fast physics). However, the OS is usually not responsible for most of the performance (or lack of it). Performance primarily depends on what algorithms are used by the user programs themselves, how they are coded/implemented and how the code/implementation is optimised by the compiler. That said, IPC and IO performance very much depends on the OS itself.
2) approx 4 "standard" 16m color graphic modes (as close as VESA1-3 allows)
~800x600, 1024x768, 1280x720, 1600x1200 (simple 8:8:8 is appealing)
Why limit yourself to a couple of video modes? Just make your rendering code handle every possible RGB ordering, every possible bit depth and every possible resolution. Then, you will be able to add support for more modes easily.
3) software support for simple font, menu and graphic primitives (ASM core)
What about a complete widget toolkit? It doesn't have to be GTK or Qt, but something similar in capabilities to Tk would be probably enough.
4) approx 3 standard ANSI color text modes ~25x80, 33x80, 43x132
Text modes don't support Unicode or formatting (bold, italics, underline). Text mode fonts also aren't scalable and are, by default, ugly.
5) 1 or 2 monitor support
If you'll support two monitors, in addition to a single one, why limit to that? Support for N monitors is as easy as support for 2 monitors.
However, that said, you will probably need native graphics drivers in order to support multiple monitors.
6) 64bit protected mode, very simple task switching - perhaps a limit of 32 threads
Again, don't limit to 32 threads. And for task switching, you will need a real scheduler, preferably a priority-based one. Don't do cooperative task-switching (I'd assume that's what you mean by "simple").
My primary design goal is to have a VERY fast graphics platform without being held
back like the X-window, SDL, Directx, MS-window complexity
X11, SDL, DirectX, OpenGL, WPF and other interfaces are indeed quite complex. But this complexity doesn't actually slow you down as much as you probably think. At worst, memory usage is bigger than necessary because all of that complexity has to be implemented. Also, there may be more bugs.
I have a good feel for the Linux X-window and SDL overhead but very little experience
with DirectX. I believe that even the simplest attempt at graphics should easily whip MS bloat.
I disagree. As long as GPUs are faster than CPUs concerning graphics (and other highly parallelisable tasks), a simple CPU attempt will be probably 10x slower than a similar GPU one.
To find out for yourself, try writing a CPU renderer for Linux, using SDL (or X11) as the backend (their overhead is
not at all significant). Try taking advantage of the fact that your code, your shaders and your data are all in main memory (as opposed to sending shaders and data to GPU memory). For example, like I suggested above, implement shaders as simple callback functions. Try also doing a thread pool, as opposed to spawning short-lived threads all the time. Maybe also try to think of other optimisations. I'd be genuinely interested in the results. If you can rasterise a relatively complex scene at 1920x1080@30fps with a relatively fast x86 CPU, it will be probably acceptable (although surely not as fast as if you used even a slow old GPU). But this alone would be a nice project to keep you busy during at least the first half of the summer (or winter, depending on the hemisphere you live).
In fact, it would be an interesting project for me too. I started writing a CPU rasteriser a couple of months ago, but never got around to finish even the basics. I will probably try again after the exams. We two can probably compete for maximum performance, what do you think?
Tools:
asm: FASM
c: MINGW until OS will support its own C compiler
Last but not least, I'd suggest you do development on a Linux machine, as most of the development tools in use today were written for Unix-like OSes, then ported over to Windows. That is, you should probably use gcc or clang as your C compiler. As for the assembler, FASM or NASM are good choices. Or you may simply use the GNU assembler to have less dependencies for building (if and only if you can stand its AT&T syntax).
Hope this helps!
Regards,
glauxosdever