Page 9 of 12

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Nov 17, 2015 7:04 pm
by tsdnz
After looking for more performance ( A lot of looking )..... I realised I was changing code just before a SYSRETQ call that used the changed code.
This caused a huge delay!!!!
I found where the cycles were going. Awesome!
Same user code as before, but the Kernel only changes the SYSRETQ entry code once.

If no context switching is required the Kernel can process just over 9 million queued messages per second per core.
From just over 2 million to just over 9.2 million, well worth tracking it down.
Great, averaging 202 cycles from user code to kernel to message queue, off message queue, a few checks, the back into user space.
Now I am happy, time to more on to the next step....
tsdnz wrote:Today tested the message queue, similar to Windows PostMessage.

With a 1.9 GHz machine
  • If no context switching is required the Kernel can process just over 2 million queued message per second per core.
  • If a context switch is required the Kernel can process just over 1 million queued message per second per core.
Used SysRetQ instead of IRETQ to enter ring 3, gaining around more speed.

Here is the User Program.

Code: Select all

volatile QWORD Me = 0x0;

void TestReentry()
{
	auto t = (volatile QWORD*)Util.GetVirtualAddress_2m(100, 0, 0, 0);
	*t = Me;

	Me++;

	Cloud::SysCall_Queue(Cloud::tSysCall_Yeild_Option::YeildAlways, Cloud::tSysCall_Queue_Where::Append, TestReentry);
};

void StartUserCode(void)
{
	auto t = (volatile QWORD*)Util.GetVirtualAddress_2m(100, 0, 0, 0);

	Me = 0x0;
	*t = 0x44;

	Cloud::SysCall_Queue(Cloud::tSysCall_Yeild_Option::YeildAlways, Cloud::tSysCall_Queue_Where::Append, TestReentry);
}

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Fri Nov 27, 2015 7:10 pm
by SpyderTL
I finally got my ICH AC97 audio device working in VirtualBox. That makes 3 audio cards that I have working, at least in VirtualBox. I've tried HDAudio on real hardware and it just locks up, at the moment. I'll have to work on that later.

That only leaves the Ensoniq ES 1371 that I'm having a hard time figuring out, in VMWare.

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Sat Nov 28, 2015 10:15 am
by onlyonemac
SpyderTL wrote:That only leaves the Ensoniq ES 1371 that I'm having a hard time figuring out, in VMWare.
lol who needs that?

I just passed over 5 new test cases in one afternoon! Not bad, especially considering that a lot of the functions that I wrote this morning are essential core functions. I also found a few bugs in yesterday's code, and once I had fixed those I passed like, 3 fairly complex test cases in one streak without a single bugfix (just goes to show how one buggy function can ruin a whole pile of good functions).

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Sun Nov 29, 2015 10:55 am
by onlyonemac
Finally got a bitmap memory allocator working. Took all morning and most of the afternoon. Had so many stupid bugs. Think I need to take a break from osdev for a few days now :-) .

Oh well, college will always make a nice break :-/ .

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 07, 2016 3:30 am
by Ycep
I'm suprised what beast of computer have Max - 2800x1800 resolution using SUPER EXPENSIVE MAC!!!
Mac Mini in my country costs 1500 euros...
While iMac 21,5 inch costs about 2500 euros...

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 07, 2016 9:15 am
by SWGDev
lukaandjelkovic wrote:I'm still an beginner for OS programming, but my happiest moment in my OS history (from December 2015/January 2016) was : my C++ Kernel executing.
Before that i just had bootloader coded in assembly.
After that i was pretty happy about my working keyboard driver, then my NIGUI (Non-interactive-graphical-user-interface) working.
I would scream that loud so everyone in my flat would hear me if my floppy driver suddenly get working.
Just suprised what beast of computer have Max - 2800x1800 resolution using SUPER EXPENSIVE MAC!!!
Mac Mini in my country costs 1500 euros...
While iMac 21,5 inch costs about 2500 euros...
Still an achievement! :)
BTW, prices are ridiculous. Even in my country mac mini (cheapest one) costs about 600 bucks. Well... Not from Apple Store or authorized re-seller, but still...

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Wed Jun 08, 2016 5:29 pm
by mmk
My best moment was when I got a (really) basic ELF loader working (some bugs to fix and features to add) and so I could load
a kernel module ELF executable from an initramfs and have it print "Hello module world"

Image

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Wed Jun 08, 2016 10:07 pm
by Techel
Hey, I'm also working on an elf loader. :)
My first moment was when I finished the vm8086 and switched some video modes, my second will happen when this damned gcc is compiled.

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Mon Jun 27, 2016 12:09 pm
by SpyderTL
I just successfully redesigned my task switching logic from being a linked list to being a collection of Task objects. So I can now start new task by simply adding a Task object to a collection, and stop them by simply removing them from the collection.

This opens up a whole lot of opportunities going forward. The next thing I'll probably work on is to move my command parsing and execution logic out of the console application, and into its own static class, so that I can kick off commands on a separate background thread by doing something along the lines of:

Code: Select all

>System.GetTasks.Add(Task.Execute("Audio.GetDevices.First.Play(Storage.GetDevices.First.GetCdDrives.First.GetTracks.First.GetAudioReader)"))
To start playing the first track of an Audio CD in the background. Very cool! 8)

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 28, 2016 12:44 am
by onlyonemac
SpyderTL wrote:I just successfully redesigned my task switching logic from being a linked list to being a collection of Task objects. So I can now start new task by simply adding a Task object to a collection, and stop them by simply removing them from the collection.

This opens up a whole lot of opportunities going forward. The next thing I'll probably work on is to move my command parsing and execution logic out of the console application, and into its own static class, so that I can kick off commands on a separate background thread by doing something along the lines of:

Code: Select all

>System.GetTasks.Add(Task.Execute("Audio.GetDevices.First.Play(Storage.GetDevices.First.GetCdDrives.First.GetTracks.First.GetAudioReader)"))
To start playing the first track of an Audio CD in the background. Very cool! 8)
It sounds like your OS has a very cool internal (and possibly external?) API. What language is it written in?

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 28, 2016 8:54 am
by Roman
SpyderTL's OS is written in C#. His signature contains a link.

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 28, 2016 9:46 am
by SpyderTL
Roman wrote:SpyderTL's OS is written in C#. His signature contains a link.
Sort of. :)

I've essentially written my own language using XML, XSD and XSLT files. I only use C# to run the XSLT transforms, and to calculate memory addresses, and format output files for specific platforms. I could just as easily do this part in Java or Python.

I basically define all CPU instructions and platform memory locations in XML files (essentially name/value pairs), and then use XSLT files to transform any references to those names into the corresponding hex values. Then, I add more layers of XSLT transforms on top of that, and use C# code to recursively convert high level XML elements (<console:WriteLine>Hello, World!</console:WriteLine>) into low level XML elements (<cpu:WriteALToDXPort/>), and finally I use C# code to write these low level hex values to a file (or physical disk, if I'm feeling brave that day.)

Although, I wouldn't call it "cross-platform", I do have XML files defined for several different platforms, so I can actually build projects for x86, ARM, NES, SNES, N64, GameBoy, GBA, Windows, Java, .NET, and pretty much any other platform that I can find an emulator (and documentation) for. Eventually, I hope to have a very high level layer that truly is cross-platform, that will compile down to several different platforms, but I'm still quite far from that particular goal.

If nothing else, all of my files are in XML, so they should be fairly easy to transform into other languages, if you wanted to use them to build, say, your own emulator.

onlyonemac wrote:It sounds like your OS has a very cool internal (and possibly external?) API.
My goal was to build an OS that booted faster than MS-DOS, but had more built-in functionality than Windows does, out of the box. If you've ever used PowerShell, or the Immediate Window in Visual Studio, this is what I was shooting for. I want a simple object-oriented command line, with a large number of built in "classes" that can be combined to perform most every day tasks, like downloading files, reading web pages, playing video and audio streams, rendering 3D models, etc.

I also wanted to completely rethink OS development using modern tools and practices, in order to avoid inheriting any "legacy" patterns that most OS designs (even most indie OS designs) may gravitate toward. So, the system is built around Objects, Classes and Stream Readers, instead of traditional Files, File Systems, and Memory Buffers.

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 28, 2016 11:07 am
by onlyonemac
In other words, you've defined your own XML-based cross-platform language, and written a basic compiler for it in C#.

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Tue Jun 28, 2016 12:12 pm
by SpyderTL
onlyonemac wrote:In other words, you've defined your own XML-based cross-platform language, and written a basic compiler for it in C#.
Yes, but it sounds better the way I said it, considering I've been working on it for about 7 years now... :)

Re: What's your OSDev AWWWW YEAH! moment?

Posted: Mon Jul 11, 2016 9:38 pm
by SpyderTL
AWWW YEAH!!!

I just successfully ran my first multiprocessor code on both Bochs (16 processors) and VirtualBox (4 processors).

It's all going according to my plan! :mrgreen:

EDIT: All processors are now running in 32-bit mode!

AWWW YEAH!!!