LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-30-2020, 09:46 AM   #1
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
RT IPC over a PL3 process


I do nasm RT(real time) programming.
My problem is now nano-timing-IPC(inter process comunication)
Now I was wondering that the Kernel does not provide a PL3(privileg level 3) memory process to let the RT-processes, in PL2 or PL1, do IPC like they want to do, over this PL3-memory.
Or em I wrong, that I have to do it on my own?

------
Now I read, that linux does only provide PL0 and PL3.
Is there a possibility to do that anyway, you can also explain it with c, c++.

--- 2021.01.04 ---
The problem is the main process(RT-FIFO) that does calculated nanosleep to get a smooth movement of the stepping motors or servo motors.
What I need is an interaction of the user, key pressed event. the machine stops and then it does not matter how long it takes to handle that key.
But to get this event (key pressed) is the (timing) problem.
At the moment I read the port 60h (1 millisecond) and check if something changed, this limits me to a smooth feed of 300 mm/sec.
This 1 millisecond can be reduced by reading a storage position, but who does write to that location? An IRQ can do, so the kernel. But then it should be possible to register this event address to the kernel.
Keep in mind that you can not sys-call the kernel, that takes sometimes more than 0.5 seconds, because the Kernel does then first its stalled work.

Last edited by bastl; 01-04-2021 at 11:00 AM.
 
Old 01-10-2021, 06:08 AM   #2
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Original Poster
Rep: Reputation: 22
Now I got the clone int 80h syscall to run.
I hope I have enough computation time to handle that second process, that does now this event.
The real clone syscall is far away from what could be expected:

INT 80h clone syscall: rax clone_120 ( rbx= process flags, rcx= *stack )

Code:
   mov   rax,120         ; clone syscall
   mov   rbx,0x100       ; process flag, CLONE_VM
   mov   rcx,top_stack   ; allocated space with brk_45, -8 to be save
   int   80h
   cmp   rax,0
   jg    .parent         ; if greater, then PID, TID of the child is returned
   je    .child          ; if equal, 0 for the child is returned
   call  error           ; error procedure
   jmp   .end

.child:
   ...

.parent:
   ...
It acts like fork.
If you want to use the slower "syscall" funktion and not int 80h then you have to take the c++ parameter for clone and you have to use a complicated abi.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPC: How to sleep message handling process at end of FIFO bayoulinux Linux - Software 3 02-06-2012 06:01 AM
IPC fails between user process and root process zaryab Linux - Newbie 1 09-22-2008 01:25 AM
IPC Process! UltraSoul Solaris / OpenSolaris 1 02-04-2005 12:44 PM
IPC message between process (Sync) davidho3 Linux - Networking 1 07-24-2004 08:20 AM
IPC message between process (Sync) davidho3 Programming 1 07-24-2004 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration