#linuxcnc-devel Logs

Jun 27 2019

#linuxcnc-devel Calendar

12:20 PM mozmck: CMorley: I doubt anyone will object to giving phill push writes. I can send him an invite.
12:23 PM CMorley: perfect thanks mozmck
12:23 PM mozmck: no problem!
12:23 PM mozmck: CMorley: btw, to use qtvcp in 2.8 - I assume there are added dependencies?
12:23 PM CMorley: yes - I should figure out how to add them - any hints?
12:25 PM mozmck: The extra dependencies may not be in the oldest distros we still support, so that might require some thought.
12:25 PM CMorley: mozmck: ok thanks - I may be able to figure it out now that I know where to look.
12:25 PM andypugh: I think that any of the admins can give access. Phil will need to send his ssh public key to them, I think, to push directly. But can probably make a pull request and accept it himself without that stage.
12:26 PM CMorley: andypugh: yes I figured you would get it eventualey
12:26 PM mozmck: CMorley: it's a bit involved, because some dependencies change based on distro. Some of that is done in the configure script
12:27 PM andypugh: To push direct I suspect that he would have to clone LinuxCNC locally via ssh rather than https and then patch his local repository, then push. Though there may be shortcuts.
12:27 PM mozmck: andypugh: I sent phill an invite. He can push as soon as he accepts it.
12:27 PM andypugh: (For example I have not tried pushing from a local repository to an unrelated remote, though I can see that that might be possible)
12:28 PM mozmck: I believe you just have to enter username and password if you don't have your ssh key set up
12:29 PM CMorley: andypugh: yes I remeber a ssh dance each time I add a 'push' computer to github
12:29 PM mozmck: I'm also pretty sure that the only ssh key setup you need is in your own account.
12:30 PM CMorley: yes I may be mixing up legasy issues when we had a private server
12:31 PM mozmck: CMorley: I just copy my ssh key from my main dev machine to any other computer that I use for pushing. Actually copy my .ssh directory
12:32 PM mozmck: I think so. With the private server we had to send ssh keys to cradek. With github you do it yourself in your own account settings. Github then knows who you are when you try to push to any project.
12:32 PM CMorley: yes thats what I have done too
12:33 PM andypugh: I tend to have my keys on a memory stick in my wallet too. Which might be a terrible idea.
12:36 PM mozmck: :-)
01:17 PM memfrob: After sleeping I found another issue with IPIPE. You can't have CPUs large than a certain limit, so the max is 16
01:17 PM memfrob: https://github.com/NTULINUX/RTAI/commit/941354208d60d576db997098121ca1f1bd1f5665 -- That's really all of them this time, feel free to play with the branch now.
01:28 PM andypugh: memfrob: Start the kernel compile from scratch again?
01:31 PM memfrob: Yes just be sure to run git pull because I just pushed another.
01:32 PM andypugh: OK
01:32 PM andypugh: I think that by removing ISA-like support I stopped the HDD drivers from working. Which was pretty terminal :-)
01:33 PM memfrob: ISA DMA should work
01:33 PM memfrob: I loaded the stock debian preempt-rt kernel into the RTAI-patched kernel and it built, ISA DMA was on by default
01:33 PM andypugh: Just a guess. I dropped to the initramfs prompt, and could not see any sdX in /dev nor a /boot in the tree
01:35 PM memfrob: These are the only problems I get, which are normal since bool/tristate was changed between 4.9 and 4.14: http://dpaste.com/0WSCWX9
01:35 PM memfrob: Sorry, 4.19 and 4.14
01:38 PM memfrob: You'll need to make an initial ramdisk for the kernel, preferably a targeted one using dracut or similar, otherwise your kernel won't boot, assuming you don't compile your ATA driver into the kernel
01:39 PM andypugh: Ah. Didn’t do that. In fact I don’t even know what most of those words mean.
01:39 PM memfrob: If you have for example a PIIX controller, and it's a module, you need an initial ramdisk which has the PIIX ATA controller in it. The debian kernels depend on an initial ramdisk
01:40 PM memfrob: All of the hard drive controllers, SATA, PATA etc are all modules. Without an initial ramdisk, the kernel won't find your drive.
01:40 PM memfrob: If you look in the /boot directory, you'll see something like: initrd.img-4.19.0-5-rt-amd64
01:41 PM andypugh: That sounds like quite a significant problem if compiling a kernel that you hope to be portable.
01:41 PM memfrob: The only way around an initial ramdisk is to know your hardware and compile your controller into the kernel as built-in.
01:41 PM memfrob: the kernel is extremely portable!
01:41 PM memfrob: the initial ramdisk is not, depending on the configuration.
01:41 PM memfrob: When building an initrd, you have two options; all or targeted.
01:42 PM mozmck: ubuntu (and I think debian) use a ramdisk - and they are quite portable
01:42 PM memfrob: when you install debian, it asks you which one you want. I pick targeted because I'm not copying my /boot folder to other systems
01:42 PM memfrob: it depends which one you pick.
01:42 PM andypugh: I have built kernels a few times before and not had to do that.
01:43 PM memfrob: that's how the debian kernels work, they're designed to be shipped with an initrd
01:43 PM mozmck: they build and include an initrd automatically
01:43 PM andypugh: update-grub looks like it might do the magic?
01:43 PM andypugh: Found initrd image: /boot/initrd.img-4.14.130
01:44 PM memfrob: are you running make install in the kernel source?
01:44 PM andypugh: Yes
01:45 PM memfrob: I don't install kernels that way so I don't know, but when I do build an initial ramdisk, I use dracut
01:45 PM andypugh: the make-install wat has worked for me in the past
01:46 PM memfrob: well if that's what works, stick with it, if you know it work.s
01:46 PM memfrob: *works.
01:46 PM memfrob: My method: sudo dracut --hostonly '' 4.14.130-RTAI (in this case)
01:46 PM andypugh: Well, it might not have worked the last time…
01:46 PM memfrob: may have to do sudo apt-get install dracut because it's not on this debian system..
01:47 PM andypugh: It’s going to be a while before we need to do either.
02:03 PM memfrob: Debian'
02:04 PM memfrob: s kernel config is actually a bit messed up..
02:04 PM memfrob: CONFIG_DEVTMPFS_MOUNT is off.
02:05 PM memfrob: and since CONFIG_EXTRA_FIRMWARE is empty, CONFIG_FIRMWARE_IN_KERNEL should be off.
04:56 PM andypugh: Yay! :
04:56 PM andypugh: andypugh@rm-one:~$ uname -a
04:56 PM andypugh: Linux rm-one 4.14.130-RTAI #1 SMP PREEMPT Thu Jun 27 21:01:32 BST 2019 x86_64 GNU/Linux
04:56 PM andypugh: memfrob: ^
05:08 PM memfrob: Woo!
05:08 PM CaptHindsight: \o/
05:08 PM memfrob: All that Kconfig hacking paid off
05:08 PM andypugh: Now, I compiled RTAI but can’t find the kernel latency test…
05:09 PM memfrob: did you run make menuconfig?
05:09 PM memfrob: if you did, it's in /usr/realtime otherwise it's in /usr/local
05:09 PM andypugh: For RTAI?
05:09 PM memfrob: yes
05:09 PM andypugh: No.
05:10 PM memfrob: ok if you ran make install then it's in /usr/local
05:10 PM memfrob: either /usr/local/testsuite or /usr/local/realtime/testsuite
05:10 PM memfrob: I forget, but ./configure defaults to /usr/local _always_
05:11 PM andypugh: Hmm, neiter.
05:11 PM andypugh: (neither)
05:11 PM memfrob: maybe /usr/realtime then?
05:11 PM andypugh: No....
05:11 PM memfrob: you can specify the install dir by using either make menuconfig or --prefix on ./configure line
05:12 PM memfrob: what does make install say then?
05:12 PM memfrob: the prefix should be in terminal
05:12 PM andypugh: Let me start gain with the RTAI part
05:12 PM memfrob: it tells you where if you ran `sudo make install`
05:16 PM andypugh: :-)
05:16 PM andypugh: ## RTAI latency calibration tool ##
05:16 PM andypugh: RTAI Testsuite - USER latency (all data in nanoseconds)
05:16 PM andypugh: # period = 100000 (ns)
05:16 PM andypugh: # average time = 1 (s)
05:16 PM andypugh: # use the FPU
05:16 PM andypugh: # start the timer
05:16 PM andypugh: # timer_mode is oneshot
05:16 PM andypugh: 2019/06/27 23:11:12
05:16 PM andypugh: RTH| lat min| ovl min| lat avg| lat max| ovl max| overruns
05:16 PM andypugh: RTD| -540| -540| 23| 7817| 7817| 0
05:16 PM andypugh: RTD| -665| -665| 23| 9071| 9071| 0
05:16 PM andypugh: RTD| -666| -666| 26| 9361| 9361| 0
05:16 PM andypugh: RTD| -607| -666| 20| 8507| 9361| 0
05:16 PM andypugh: RTD| -597| -666| 24| 8132| 9361| 0
05:16 PM andypugh: RTD| -271| -666| 25| 8844| 9361| 0
05:16 PM andypugh: RTD| -597| -666| 19| 7366| 9361| 0
05:16 PM andypugh: RTD| -637| -666| 22| 8945| 9361| 0
05:16 PM andypugh: RTD| -574| -666| 25| 9082| 9361| 0
05:16 PM andypugh: RTD| -617| -666| 21| 8721| 9361| 0
05:16 PM andypugh: RTD| -587| -666| 25| 9247| 9361| 0
05:16 PM andypugh: RTD| -597| -666| 23| 7084| 9361| 0
05:16 PM andypugh: RTD| -672| -672| 27| 8813| 9361| 0
05:16 PM andypugh: RTD| -641| -672| 26| 9388| 9388| 0
05:17 PM andypugh: RTD| -597| -672| 24| 8761| 9388| 0
05:17 PM andypugh: RTD| -662| -672| 22| 9118| 9388| 0
05:17 PM andypugh: RTD| -662| -672| 22| 9118| 9388| 0
05:17 PM andypugh: It works! And the latency seems good too.
05:18 PM memfrob: On the system that RTAI always performed bad on since the live cd??
05:18 PM CaptHindsight: 0 o O 0 o OO throws out various sized life preservers
05:19 PM andypugh: Yes.
05:19 PM memfrob: That's great news!
05:19 PM CaptHindsight: andypugh: which cpu is this?
05:19 PM andypugh: This is the machine that has, up to now, always failed horribly
05:19 PM memfrob: So I got RTAI 5.2 stable haha
05:20 PM andypugh: Yes, this is excellent news
05:20 PM andypugh: Model name: Intel(R) Core(TM) i3-3220T CPU @ 2.80GHz
05:22 PM andypugh: It’s my test PC, with motherboard parport, PCI parport, 5i25 and 7i80 connected.
05:22 PM memfrob: I'm working on fixing math right now
05:22 PM memfrob: so it will work with linuxcnc
05:22 PM andypugh: All in a School PC with a handle so I can put it back in the cupboard.
05:24 PM andypugh: One of these. https://www.ebay.co.uk/itm/183628403927
05:24 PM andypugh: For the price, quite a compelling package. Especially as it gives 7uS latency with Preempt-RT, has 3 PCI slots and 6 USB ports.
05:26 PM andypugh: If you look at that auction, and look at the third picture of the back, you might be surprised to learn that the back panel isn’t silver plastic, it’s stamped steel.
05:27 PM andypugh: But, up to now, it had the serious drawback of playing badly with RTAI.
05:31 PM andypugh: So, the next thing to try is to see if we can make packages of this kernel, put then on the LinuxCNC repo and produce an RTAI / Buster LiveCD.
05:35 PM memfrob: just don't package RTAI itself yet
05:35 PM memfrob: I'm surprised this works for you but not my old master branch
05:39 PM andypugh: Don’t discount the possibilit that the fault is all mine
05:43 PM andypugh: I tried compiling LinuxCNC against this kernel (I know you already said it wouldn’t work)
05:44 PM andypugh: I got a compile error that doesn’t immediately seem to point the the already-mentioned maths problem.
05:44 PM andypugh: scripts/Makefile.build:326: recipe for target '/home/andypugh/linuxcnc-dev/src/rtapi/rtai_rtapi.o' failed
05:44 PM andypugh: Makefile:1534: recipe for target '_module_/home/andypugh/linuxcnc-dev/src' failed
05:44 PM andypugh: make[1]: Leaving directory '/usr/src/linux-4.14.130'
05:44 PM andypugh: In file included from /home/andypugh/linuxcnc-dev/src/rtapi/rtai_rtapi.c:67:0:
05:44 PM andypugh: ./arch/x86/include/asm/uaccess.h: In function ‘set_fs’:
05:44 PM andypugh: ./arch/x86/include/asm/uaccess.h:33:9: error: dereferencing pointer to incomplete type ‘struct task_struct’
05:44 PM andypugh: current->thread.addr_limit = fs;
05:44 PM andypugh: ^~
05:45 PM memfrob: [168764.572257] RTAI[math]: loaded, using MUSL.
05:45 PM memfrob: I got math working!!!
05:46 PM memfrob: [168823.432210] RTAI[math]: unloaded.
05:47 PM memfrob: that's not math related, linuxcnc probably needs updates for the new RTAI API
05:56 PM memfrob: https://github.com/NTULINUX/RTAI/commit/8299eb02ed8d6c428fb13e4c7ef2dfeb4f0e8a8f
05:57 PM memfrob: So how it works is, RTAI git clones musl for you (in-tree) then modifies the library a bit using ar (deletes some symbols to avoid conflicts with in-kernel math funcs) then links rtai_math.ko to it
05:58 PM memfrob: the downside is that the terminal spews with: WARNING: "every math func here" [RTAI/base/math/rtai_math.ko] undefined! because those symnbols aren't linked to it yet
05:58 PM memfrob: This happens at: /usr/bin/ld -m elf_x86_64 -r -static -o rtai_math.ko rtai_math.ko.tmp ../../base/math/musl/lib/libm.a
05:59 PM memfrob: You now need an internet connection to now compile RTAI but it works.
06:00 PM memfrob: remove second now from that statement^
06:15 PM andypugh: Any links to help with the RTAI API? (And what does backwards-compatiility look like?)
06:15 PM memfrob: undocumented changes that paolo does, and randomly posts tar blobs on rtai.org ..
06:16 PM memfrob: using git grep inside my tree would be your best bet
06:16 PM KimK: andypugh, memfrob: Congratulations! Excellent work! In Andy's latency results table above, I can guess that "lat" min/max is latency, what is "ovl" min/max?
06:17 PM memfrob: overall -- equivalent to linuxcnc's latency-test
06:17 PM memfrob: i think.. it's either that or lat max
06:18 PM memfrob: yeah it's overall
06:18 PM memfrob: lat max is the max latency, overall is the max latency since the start of the test suite
06:18 PM memfrob: it's basically the highest recorded latency since it started recording
06:21 PM KimK: OK, thanks. And again, congrats to you both, great work, we'll look forward to the conclusion. Do we need a LinuxCNC fork of RTAI, to add our fixes (for us, and maybe others?)
06:21 PM memfrob: You'll need to add a debian folder in order to package it, but I'm working on docs right now and other fix ups
06:26 PM andypugh: KimK: We just need to create a kernel .deb to point the LiveCD at.
06:26 PM andypugh: With the right packaging I think we can offer both versions of LinuxCNC as alternative packages with different kernel dependencies.
06:27 PM andypugh: Though that’s a guess and there are probably wrinkles.
06:27 PM KimK: Maybe all 3 on startup via grub2?
06:27 PM KimK: Oh, 4
06:28 PM KimK: (That'll be a fat DVD, heh.)
06:28 PM andypugh: Kernels, maybe. But how to start different LinuxCNC versions?
06:28 PM KimK: Oh, 2.7 and 2.8? Interesting.
06:28 PM andypugh: There was an answer to that, but the issues round merging that caused the Machinekit spolit.
06:29 PM KimK: Ah. Easier now, then?
06:29 PM andypugh: KimK: No, LinuxCNC 2.8-uspace and LinuxCNC 2.8-RTAI
06:29 PM KimK: Oh, I see.
06:30 PM KimK: s/DVD/ISO/
06:49 PM memfrob: Alright that's it for today, got math working, bumped version to 5.2.1, that's a start
06:50 PM jthornton: yippie
06:51 PM memfrob: andypugh, sorry to say, I re-worked the kernel a bit more as well :P silenced two compiler warnings too, one in RTAI and another in the kernel
06:51 PM memfrob: After further testing, I'll move the for-next branch where master is, and move master to old-stable
06:52 PM andypugh: memfrob: Well, I am away from the LinuxCNC machines from now until Sunday evening at the earliest, so you can do anything you want and I won’t complain.
06:52 PM memfrob: haha alright sounds good.
06:52 PM memfrob: take care everyone!
06:54 PM andypugh: I will be on one of about 800 boats taking part in a yacht race: https://images.app.goo.gl/TAGLr8nKXqLd4P8m8
06:55 PM jthornton: wow, that looks like fun
06:55 PM jthornton: how do they ever get that many sailing yacht's to line up?
06:56 PM andypugh: JT-Shop:
06:56 PM jthornton: I'm down here
06:57 PM andypugh: jthornton: They stagger the starts, there are several classes and then within each class they start about 8 boats on each minute mark.
06:57 PM jthornton: I wondered how they did that
06:57 PM andypugh: But it’s still pretty crazy
06:58 PM jthornton: I can imagine, I used to have a small sail boat and there ain't no brakes on them unless your keel hits the mud lol
07:00 PM andypugh: I will be on a 36’ boat at the weekend.
07:00 PM andypugh: Which I guess is medium-sized
07:00 PM jthornton: nice size boat, mine was 26' and I usually sailed it solo in the gulf of mexico
07:01 PM andypugh: I have been on a 24’ with a friend. It was like a floating caravan.
07:01 PM andypugh: And I saied the Pacific on a 68’ boat, and that was a serious bit of kit.
07:03 PM andypugh: When my plan to become God-Emperor of Terra comes to fruition I shall commandeer Mirabella V for my personal transport
07:05 PM andypugh: Ooh, this shows just how vast that is: https://images.app.goo.gl/GJ6FSw8jM8J2PPfA7
07:05 PM jthornton: looks like a nice one
07:06 PM jthornton: holy moly that is huge, must have a huge keel
07:06 PM andypugh: Or this: https://images.app.goo.gl/dRYPcBPr2b8GHVmx5
07:07 PM andypugh: It has a 48’ _beam_
07:07 PM jthornton: Draught (keel down): 10.20 m (33.5 ft)
07:07 PM andypugh: 290’ mast
07:08 PM jthornton: just looking here https://en.wikipedia.org/wiki/Mirabella_V
07:08 PM andypugh: So am I
07:09 PM jthornton: The boat has a master suite on the main deck and six cabins for as many as 12 guests. The boat's lazarette stores a 29-foot (8.8 m) tender, Lasers, jet skis, ski boats, kayaks and three remote-controlled models of Mirabella V. The foredeck has two recesses that serve as swimming pools and as storage for two launches.
07:09 PM jthornton: wow that is huge
07:09 PM andypugh: The tallest mast of all time..
07:11 PM andypugh: It was fun when sailing with the Clipper boats. You get back to the marina and “where’s the boat” was typically answered by looking for the mast 30% higher than any other. M5 is more than twice as high as those were (they were a mere 100’)
07:12 PM andypugh: Interesting that it was built on the Isle of Wight and is registered to the Isle of Man. I would have expected the Cayman Islands.
07:13 PM jthornton: for tax reasons?
07:14 PM andypugh: Generally, yes. And crew H&S regs
07:15 PM jthornton: interesting, I never would have imagined that
07:15 PM andypugh: I think about half the commercial boats in the world are registered in Panama, as they are pretty lax. And almost none in London (because they aren’t)
07:17 PM andypugh: About 8,600 ships fly the Panamanian flag. By comparison, the US has around 3,400 registered vessels and China just over 3,700.
07:17 PM andypugh: Under international law, every merchant ship must be registered with a country, known as its flag state.
07:17 PM andypugh: https://www.bbc.co.uk/news/world-latin-america-28558480
07:18 PM jthornton: interesting
07:25 PM jthornton: time to put on my chef hat...
07:27 PM CaptHindsight: andypugh: how long did it take to sail across the north pacific?
07:28 PM andypugh: 28 days