does the wheezy beta kernel have PREEMPT??


17 posts
by mung » Thu Jun 28, 2012 2:11 pm
I wonder where the .config file for the wheezy beta kernel is????

Does that kernel have PREEMPT_RT support??

I am totally confused by everything at the moment and think that this is my final try at getting linuxcnc working. I am really just a talent and skill less hacker and know nothing about Real time. I have probably worked 40 hours on this and think it is beyond me. But I then find that linuxcnc now supports the PREEMPT_RT mainline kernel patches.

Maybe it could be simple??

But looking at the kernel source I cannot see any CONFIG_PREEMPT_RT in the .config, the wheezy beta mentions PREEMPT on first login, and the .config shows CONFIG_PREEMPT_NONE=y.

Is CONFIG_PREEMPT=y the same as CONFIG_PREEMPT_RT=y

Is CONFIG_PREEMPT_RT actually in the 3.2 mainline kernel?????

I dont think I can handle anymore research and confusion as I am just doing this as a hobby project and never had the brains to be a real developer.

Can anyone offer some simple advice?

Please check the thread below if you want further info.
viewtopic.php?f=63&t=2376
Posts: 237
Joined: Fri Nov 18, 2011 10:49 am
by anwe79 » Thu Jun 28, 2012 9:40 pm
Hi, i have a similar interest, partly for audio work (which doesn't require hard RT) and partly because i want to try to use a Pi for controlling a reprap.
I haven't tried the wheezy image yet, but just downloaded it, and will have a look tonight.

I am running an audio-"RT" 3.2 kernel on my desktop (from KX Studio). I know it's an entirely different beast, but some of the kernel config may be helpful (i just grepped the config for PREEMPT):

Code: Select all
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_RT_BASE=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT__LL is not set
# CONFIG_PREEMPT_RTB is not set
CONFIG_PREEMPT_RT_FULL=y
CONFIG_PREEMPT_COUNT=y
CONFIG_DEBUG_PREEMPT=y
# CONFIG_PREEMPT_TRACER is not set


I haven't even thought about recompiling the kernel yet (got my Pi yesterday :)), but it should be doable. If noone beats me too it, i may give it a shot. Although don't hold your breath, it may be quite a while, and my previous experiences with cross-compiling haven't been very happy...

PS it may be possible to extract the config from the running kernel, but i doubt that feature is enabled on the pi.

Edit: It's actually referenced in the cross-compile instructions, this should give you the current config in a file:
Code: Select all
zcat /proc/config.gz > .config
Posts: 26
Joined: Sat Oct 08, 2011 10:30 pm
by wolfc01 » Mon Jul 02, 2012 6:42 pm
Hello,

I''m currently busy to control with the raspberry a PWM controlled motor, for a quadcopter. For that, I need hard realtime, because I want to generate the PWM pulses around, 50Hz --with a variable very constant and precise in all circumstances-- duty cycle. I want to use the function nanosleep for that.

I tried the debian weezy ARM kernel for that, it works, but not really hard realtime (sometimes jitter >1.5 millisecond), so I tried to patch this kernel with the patches from http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/

No succes yet, the starts to boot but bootsequence hangs after 1.5 seconds. Causes may be:
- No exact matching version of the RT patches with the minor version number of the Debian Weezy kernel. I see 1 or 2 hunks displacements and one hunk fail while patching. The kernel builds however.

- Maybe the Raspberry specific drivers are not ready for hard realtime yet (no RT patches for those specific drivers available)

- ....

Somebody more clues? I'm thing about rolling up my sleeves and getting into it :-)

Carl.
Posts: 6
Joined: Sun Mar 11, 2012 4:10 pm
by A7thStone » Wed Sep 19, 2012 6:26 pm
I have compiled linux-3.4.11 (the newest kernel that I could find real-time patches for) with real-time support. It boots the Arch image available on Raspberry Pi's download page in Qemu. I haven't tried the Debian image. I don't have access to a Raspberry Pi yet so I'm following directions for Qemu to emulate it. If you want to try out my build you can download the zImage and modules folder from http://www.4shared.com/archive/AeacSfD- ... furl=d1url
Posts: 6
Joined: Wed Sep 19, 2012 5:30 pm
by A7thStone » Wed Sep 19, 2012 7:12 pm
Two updates. I got the kernel to boot the Wheezy image on the downloads page. I only booted to console. I can't get the desktop, but I haven't worked on it for long. I also uploaded the wrong zImage heres the new link http://www.4shared.com/archive/_uwL6S1X ... furl=d1url
Posts: 6
Joined: Wed Sep 19, 2012 5:30 pm
by federicob » Fri Sep 21, 2012 5:06 pm
This is great news, could you post the config file that you used?
I would like to make some customization so I can't use your binary.
By the way which kernel sources have you used?
https://github.com/raspberrypi/linux this repo goes up to 3.2.27.
Posts: 5
Joined: Fri Sep 21, 2012 4:58 pm
by federicob » Fri Sep 21, 2012 5:50 pm
Great news!
Are you compiling vanilla kernel?
At https://github.com/raspberrypi/linux I see that the newest one patched for rpi is 3.2.27, are you applying these patches too?
Posts: 5
Joined: Fri Sep 21, 2012 4:58 pm
by A7thStone » Mon Sep 24, 2012 1:32 am
I patched it with a generic arm patch found at http://xecdesign.com/downloads/linux-qe ... -arm.patch It actually patches for ARM11(ARMv6) support on the versatile board, which, from what I've read, is what QEMU is emulating. It's close to a RaspberryPi but not identical. It's the best I have to work with till I get an actual Pi. I had to modify one of the source files by hand as well because that patch was looking for a line that had moved in the source file.
Posts: 6
Joined: Wed Sep 19, 2012 5:30 pm
by A7thStone » Mon Sep 24, 2012 1:41 am
Also yes I started with vanilla 3.4.11 applied the arm patch then the rt patch. Both patches I used and my config are here http://www.4shared.com/archive/Ow77Oe8S ... _conf.html
Posts: 6
Joined: Wed Sep 19, 2012 5:30 pm
by Licaon_Kter » Mon Sep 24, 2012 3:24 pm
Those might work in Qemu but you need the real BCM modules too when you boot on a real Pi. So either backport the RT patches to the current Pi kernel or port the current Pi needed modules to 3.4 :(
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
User avatar
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.
by A7thStone » Tue Sep 25, 2012 2:25 am
The rt patch is available for 3.2.27, it applies to the RasPi sources and they compile fine, but I can't test the results, because the RasPi sources removed some hardware support needed for QEMU. If you want to test it the patch can be found at http://www.kernel.org/pub/linux/kernel/ ... 3.2/older/ The options that should be enabled for real-time support are detailed here https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO if you want to attempt it yourself. When I can finally get a RaspberryPi in front of me I will work on it some more myself.
Posts: 6
Joined: Wed Sep 19, 2012 5:30 pm
by Licaon_Kter » Wed Sep 26, 2012 11:21 pm
Ok so like done ;)

Latest RPi kernel source patched with 3.2.27-rt40: https://github.com/licaon-kter/linux/tree/rt-3.2.27 ( if you are so inclined but... )
Build kernel/modules: https://github.com/licaon-kter/raspi-rt

Do test :!:

Also, do mention how you test, what you get, what you should get etc as I did not follow the whole RT thing :d
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
User avatar
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.
by Licaon_Kter » Thu Sep 27, 2012 8:39 am
aaaaaaaaaand later edit: It does not work on my Pi, stops at the RTC init, yes the RPi does not actually have a clock to talk about but i'm not sure that's the problem per se... ideas? did I mess up the kernel build/config or something?
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
User avatar
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.
by A7thStone » Thu Sep 27, 2012 9:50 pm
I'm not entirely sure why since I haven't done much kernel compiling and installation since my days of playing with FreeBSD (3.2-3.3 I believe). I'm pretty sure you can remove support for RTC hardware in the kernel config. That may or may not be your problem. You can also try disabling the High Precision Timer. the RT guys say it's not done for ARM. Once again your issue may not be related, I'm just taking shots in the dark on possibly related issues. My test involved compiling RasPi's sources with the RT patch applied in QEMU, but it resulted in nothing, just a blank screen when QEMU's window came up. No cursor, no errors, just a blank black window.
Posts: 6
Joined: Wed Sep 19, 2012 5:30 pm
by federicob » Sun Oct 07, 2012 8:40 pm
I haven't tried yet what A7thStone did, but a few weeks ago I tried to patch the rasperry pi kernel code 3.2.27 with the rt40 patch. It applies fine, and compiles, too but it doesn't boot.
I think it's related to the mmc which gets broken by the patch.
I guess it is due to some bcm driver not in mainline kernel.
I tried to make my own initramd to avoid using the uSD except for the bootloader but this time a new issue seemed to be USB related.
I need USB in my project so I didn't go on any further.
I suspect that anything can't be done 'till someone fixes this problem in the device drivers.
Posts: 5
Joined: Fri Sep 21, 2012 4:58 pm
by sensburger » Fri Nov 09, 2012 11:06 am
Hello!

Without knowing about Licaon_Kter's tests, I also tried patching the current 3.2.27 rapsberry pi kernel from https://github.com/raspberrypi/linux with the 3.2.27-rt40 patch from kernel.org. For the kernel settings, I used the ones from the standard raspbian wheezy from raspberrypi.org running on my pi, and only changed to 'full preemption' in menuconfig.

I exactly ran into the same problems as Licaon_Kter: On startup of the newly built kernel, the last message displayed is about the RTC that was not found. The system freezes then.

I also think to remember a single error message when applying the patch to the kernel sources. Unfortunately I do not know any more what it was about, as the rest of the build process went smoothly.

Did anybody make progress here on how to persuade the raspberry pi to work with PREEMPT RT?

Thanks a lot!
Posts: 1
Joined: Fri Nov 09, 2012 10:10 am
by Licaon_Kter » Fri Nov 30, 2012 8:52 pm
I've stopped building both BFS-BFQ and RT for now, when they transition to kernel 3.6.x I'll reintegrate everything again.
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
User avatar
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.