What's your OSDev AWWWW YEAH! moment?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

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

Post by Kazinsal »

onlyonemac wrote:@Nutterts: Please don't tell me you're planning on writing your OS in *pascal*... *shudder*
Fairly large chunks of classic Macintosh system software were written in Pascal, IIRC. It's not a braindead language for OS development, just not usually the first choice people make.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

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

Post by kzinti »

onlyonemac wrote:@Nutterts: Please don't tell me you're planning on writing your OS in *pascal*... *shudder*
Why not? It's a very good language.
User avatar
Nutterts
Member
Member
Posts: 159
Joined: Wed Aug 05, 2015 5:33 pm
Libera.chat IRC: Nutterts
Location: Drenthe, Netherlands

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

Post by Nutterts »

kiznit wrote:
onlyonemac wrote:@Nutterts: Please don't tell me you're planning on writing your OS in *pascal*... *shudder*
Why not? It's a very good language.
=D>

And it's by nature very readable. Basically using it in a way like others would use direct ASM. You can't do with out assembly but pascal is much more readable but you can still inline it & it is just as easy to call as a C function from Go.
Kazinsal wrote:It's not a braindead language for OS development, just not usually the first choice people make.
Not only for OS development.

Pascal [-o<
The language that's never let me down
"Always code as if the guy who ends up maintaining it will be a violent psychopath who knows where you live." - John F. Woods

Failed project: GoOS - https://github.com/nutterts/GoOS
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

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

Post by onlyonemac »

Kazinsal wrote:Fairly large chunks of classic Macintosh system software were written in Pascal, IIRC.
Yeah that doesn't mean that it's a good language. Frankly it's antiquated and it sucks, and every time I've tried to use it I just can't THINK straight!!! Really, with such elegant languages as C available to us, there's no need to fuss with the incoherencies of a language like Pascal that was designed for a previous era. And once you've written everything in Pascal, you'll have to keep it that way or at least make a lot of changes to any code that you use that is written in other languages, as the calling style is significantly different from the ubiquitous C style.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post by Combuster »

onlyonemac wrote:it's antiquated and it sucks
May I remind you that we have an explicit rule about both offtopicness and programming language discussions?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Unsigned
Posts: 24
Joined: Thu Sep 20, 2012 6:46 pm

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

Post by Unsigned »

Unsigned wrote:The floppy drive LED turned off automatically... AWWWW YEAH!
I'm implementing virtual mode to read sectors using BIOS interrupts, and i need the v86 task to intercept the IRQs. After using a separate task for the v86 monitor and having trouble with it (it gave warnings in Bochs and just locked in real hardware), I finally got it working by implementing the monitor in kernel mode and having it called exactly when an IRQ or interrupt happened. Now the BIOS code gets all the hardware interrupts and turns the floppy drive LED off after a few timer ticks. It also turns the keyboard LEDs on and off when pressing the lock keys, and it's the first time Ctrl+Alt+Del is able to restart the computer while my protected mode code is running.
For those wanting to do like me and use virtual mode to call BIOS interrupts like read sectors from the disk, DON'T do that. It worked for me when getting the memory map and reading sectors using CHS, but it failed on real hardware when reading sectors using LBA and even when just testing the availability of the LBA extensions. I haven't debugged it, but I think the problem is that the BIOS needs to go to protected mode momentarily, which can't be done from within VM. My new code now exits to real mode to do the BIOS interrupt and then it goes to PM again. It works for the memory map, reading CHS, reading LBA, etc.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

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

Post by jnc100 »

Entering ACPI mode, handling power button events and performing an ACPI shutdown all using my own AML parser (written in C#).

Regards,
John.
User avatar
BASICFreak
Member
Member
Posts: 284
Joined: Fri Jan 16, 2009 8:34 pm
Location: Louisiana, USA

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

Post by BASICFreak »

Here's my latest.

Trying to get position independent flat binary (it is the ELF loader)
Linked to address 0x00000000
which will first run at 0x01000000
Sets itself to an API function (somewhere between 0xE4200000 and 0xFF000000)
Then load the ELF modules attached to the tail of the binary (at the 0x01000000 position)
---- The modules actually start at 0x01001000 due to the binary being 4KB

And again this is flat binary and written in C.

Turns out only line I needed to add was for the name pointer:

Code: Select all

char *ModVirt = (char*) ((uint32_t)ModName + 0x01000000); // Fix the pointer
*Note this line is only ever run from the base of 0x01000000 - that's how I got away with it
And everything else relies on pointers provided by other applications (which hopefully are valid and mapped in said apps space)

So, two days of trying to compile PIC to find it is easier than I thought.
And to think an hour before I tried this I was about to call it quits on C - but I dislike data management in ASM

Looks like we are getting somewhere now. For the kernel only being two weeks old (and my first Exo) not too bad.
Hopefully tonight's update will have at least some of my old modules ported over.



So here are my test result:

Code: Select all

BOS v. 0.0.4	SRC/i386/memory/virtual.c	Compiled at 13:25:36 on Sep 14 2015 Line 334	Function "_VMM_PageFaultManager"
User Task Attempted to Write a Non-Present page!
Virtual Address:	0xCFFFFFFB
User Task Faulted In User Stack
Expanding Stack
EAX = 0x26000
aaaaa.....a
Yes my first elf just puts 'a' and yields. And the EAX refers to the new Page Directory (Physical Address) created for the ELF
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
Sortie wrote:
  • Don't play the role of an operating systems developer, be one.
  • Be truly afraid of undefined [behavior].
  • Your operating system should be itself, not fight what it is.
User avatar
hgoel
Member
Member
Posts: 89
Joined: Sun Feb 09, 2014 7:11 pm
Libera.chat IRC: hgoel
Location: Within a meter of a computer

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

Post by hgoel »

Finally getting threading and process management to play well together without the thread code even knowing about the process code. Also, loading elfs from disk (using AHCI), EXT2 reading/deleting files, making syscalls, along with full 1920x1080 rendering at decent framerates, and the standard input stuff, all in 45 days. Never worked that long on a project before! Still have a bunch of small things to finish setting up before my newlib port can actually be useful. Although, every time I fix another obscure bug or add a new feature is an 'AWWWW YEAH!' moment.
"If the truth is a cruel mistress, than a lie must be a nice girl"
Working on Cardinal
Find me at [url=irc://chat.freenode.net:6697/Cardinal-OS]#Cardinal-OS[/url] on freenode!
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

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

Post by osdever »

1. When i'm finished the Bare Bones.
2. When i finished the window system in text mode.
3. When i'm entered graphics 640x480 with 16 colors mode.
4. When i'm drawn a first line in graphics mode.
5. When i'm displayed text in graphics mode.
6. When i'm ported window system to graphics mode.
7. When i'm finished desktop.
8. When i'm make the wallpaper changing and language changing.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

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

Post by SpyderTL »

Just got my first "noise" playing from my HD Audio device in VirtualBox. It took me a while to figure out all of the various node parameters to set, and that the amplifier gain controls are inverted. (127 = -0 dB = Full Volume / 0 = Minimum Volume / 128 = Mute Flag).

I'll be working on the HD Audio wiki page here shortly to get everything that I've learned down on paper.
Last edited by SpyderTL on Tue Nov 17, 2015 2:10 am, edited 1 time in total.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
CrafterMan24
Member
Member
Posts: 28
Joined: Sun Nov 01, 2015 12:19 am

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

Post by CrafterMan24 »

When i finish my V8086 monitor and my paging driver i was said, AWWWWWWW YEAH! really :D
intx13
Member
Member
Posts: 112
Joined: Wed Sep 07, 2011 3:34 pm

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

Post by intx13 »

I recently wrote UEFI implementations of common legacy BIOS interrupts, and then made resident a bunch of real-mode to UEFI thunks so that legacy real mode BIOS-dependent code could run on a UEFI class 3 system. For example, invoking INT15H would thunk back to long mode, use the System Table to examine the UEFI memory map, create a legacy BIOS-style memory map matching it, and then return back to real mode. It was immensely satisfying when there were enough emulated pieces in place to boot a legacy OS for the first time!
CelestialMechanic
Member
Member
Posts: 52
Joined: Mon Oct 11, 2010 11:37 pm
Location: Milwaukee, Wisconsin

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

Post by CelestialMechanic »

Two of these moments:

On September 9 I got my loader to load my microkernel to 100000H and executed functions from it after jumping to E0100100H. This was the first time I had touched anything in extended memory and the first time I had run anything from a high virtual address. Also the first time I had executed code in an ELF32 binary. And on my 63rd birthday too.

I'm still working on the physical and virtual memory management and I kept getting a lot of triple faults. I don't really have the code yet to handle these things, so I created code that would at least display a BSOD (Blue Screen Of Death) before Bochs gives me my lumps.
Microsoft is over if you want it.
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

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

Post by tsdnz »

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);
}
Post Reply