OSDev.org
https://forum.osdev.org/

Designing a hard-realtime addon to an operating system
https://forum.osdev.org/viewtopic.php?f=15&t=36349
Page 2 of 2

Author:  rdos [ Sun Dec 22, 2019 4:01 pm ]
Post subject:  Re: Designing a hard-realtime addon to an operating system

Finished with settting up the 64-bit environment, booting a core and setting up fault handlers. I have also integrated it into the kernel debugger and so I can step and run the 64-bit code from RDOS. I initially used my CPU emulator, but at this stage I think running it on real hardware is so much better. I use an interrupt from RDOS to the realtime core to implement debugging.

I think I will buy a two CPU server board using AMD Ryzen class processors and start trying to boot RDOS on it.

It would be nice to have a C compiler for the actual project, but I think I could also write it in x64 assembler.

Author:  rdos [ Wed Dec 25, 2019 4:11 pm ]
Post subject:  Re: Designing a hard-realtime addon to an operating system

So, the realtime monitor boots up in 64-bit mode, the trap gates work, and it's all seemlessly integrated with normal kernel debugger. The monitor has a function to request physical memory from the operating system, and the page fault handler will automatically fill-up the 3 higher levels of the page table structure. The operating system can request that a linear address be mapped, and then get back the page entry. Using that page entry, the operating system can easily load application code in the realtime core context before starting the realtime program. The realtime program will run at user level.

I also started to implement signals from the realtime program to the operating system. These must have known maximum execution times, and this is achieved by setting a signal bit (with lock prefix), and then send an interrupt to the server core if the APIC is idle. To be able to run this as quickly as possible I mapped the APIC and monitor data for the application. There are 1024 different signals that each has it's own bit. On the operating system side, I have a C++ class that can be used to write an application that can interface with the realtime program. For the moment, the realtime program must be written in x64 assembler, but has a macro to send a signal.

Page 2 of 2 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/