Page 1 of 1

Using Ada's system programming annex for OSDev

Posted: Fri Mar 25, 2022 9:55 pm
by Ethin
I'm unsure if I should ask this here or at the ada subreddit, but I thought I'd ask here first. Since Ada provides annexes for systems programming and real-time systems, I was wondering how exactly I'd go about using them? For example, if I wanted to use protected procedure handlers, the Interrupts package, or aspects like Dispatching_Domain, would I need to implement my own BSP runtime? I know I'd probably have access to machine operations/intrinsics, but would I neeed to do something special to use these more advanced features on architectures like x86? If so, I'm not really sure where I'd even begin; I don't know for example how to do EDF scheduling or priority ceiling locking.

Re: Using Ada's system programming annex for OSDev

Posted: Sat Mar 26, 2022 1:04 am
by klange
This is kinda like reading the latest C specs and thinking the language would give you thread support. In reality, this is functionality assumed for a hosted implementation of the language, living on an existing OS, and implemented by a library provided with the implementation, much like a libc.

The standard implementation of Ada is GNAT, which has been part of GCC for quite a while now. GNAT/GCC implements this sort of system-specific functionality either in libgnat or in libgnarl, which are each a hodgepodge of Ada and C with numerous backends for different target operating systems.

Re: Using Ada's system programming annex for OSDev

Posted: Sat Mar 26, 2022 1:23 am
by Ethin
klange wrote:This is kinda like reading the latest C specs and thinking the language would give you thread support. In reality, this is functionality assumed for a hosted implementation of the language, living on an existing OS, and implemented by a library provided with the implementation, much like a libc.

The standard implementation of Ada is GNAT, which has been part of GCC for quite a while now. GNAT/GCC implements this sort of system-specific functionality either in libgnat or in libgnarl, which are each a hodgepodge of Ada and C with numerous backends for different target operating systems.
Oh, okay. So I'd have to implement all the underlying support myself. Damn... I was hoping that that was just a runtime thing. Though I wouldn't mind doing it if I could get past this mental block that I seem to have run into...