WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Where to build/install ADC module  (Read 23306 times)

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Where to build/install ADC module
« on: February 16, 2021, 07:31:52 AM »
Hello,

After much help from Rich, I was happily able get my ethernet working and install pciutils.tgz and the gcc compiler on TinyCore3 (2.6.33.3).

My next step is to build and install the module for an analog-to-digital converter. The instructions I've received from the mfr are to change directory to;

"usr/src/linux/drivers"

And then unpack the ADC driver tar file in the directory above, which unpacks the contents of the tar file to;

"usr/src/linux/drivers/24dsi_pll"

Then I change directory to "usr/src/linux/drivers/24dsi_pll" and run "./make_all" which then builds and installs the module "24dsi12_pll.ko".

I notice that the version of TinyCore that I have has a usr/src directory, but it's empty.

Do you think it would work for me to simply make the needed directory structure and go ahead an try to build/install the driver ?, or is there something else that would be better ?

Thank you very much.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Where to build/install ADC module
« Reply #1 on: February 16, 2021, 09:24:53 AM »
You need to unpack and prepare the Linux kernel source in /usr/src.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Where to build/install ADC module
« Reply #2 on: February 16, 2021, 09:34:55 AM »
Hi MTCAT
Here's a link for someone else that was trying to build an out of tree driver:
http://forum.tinycorelinux.net/index.php/topic,24436.msg154978.html#msg154978

Due to the age of the Tinycore version you are using, it won't work as written.
If you want to attempt to make it work, the config and source packages are:
http://tinycorelinux.net/3.x/release/src/kernel/config-2.6.33.3-tinycore
http://tinycorelinux.net/3.x/release/src/kernel/linux-2.6.33.3-patched.tbz2

You would need to get  Module.symvers  from  linux-headers-2.6.33.3-tinycore.tcz  under  /usr/src/linux/.

... I notice that the version of TinyCore that I have has a usr/src directory, but it's empty. ...
Try installing  linux-headers-2.6.33.3-tinycore.tcz.  Then:
Code: [Select]
mkdir /usr/src/linux/drivers
Make sure you have a proper toolchain installed:
Code: [Select]
tce-load -wil compiletc perl5 bash ncursesw-dev bc-1.06.94 glibc_apps elfutils-dev
Then unpack the ADC driver tar file continue from there.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #3 on: February 16, 2021, 10:22:51 AM »
Thanks again Rich, thanks as well Juanito, Rich, would this be the correct workflow so to speak ?

1) Install (run ?) the config http://tinycorelinux.net/3.x/release/src/kernel/config-2.6.33.3-tinycore

2) Install the source package  http://tinycorelinux.net/3.x/release/src/kernel/linux-2.6.33.3-patched.tbz2

3) Install  linux-headers-2.6.33.3-tinycore.tcz (check to make sure Module.symvers is in usr/src/linux)

4) mkdir /usr/src/linux/drivers

5) run tce-load -wil compiletc perl5 bash ncursesw-dev bc-1.06.94 glibc_apps elfutils-dev

6) Unpack driver and try to run ./make_all

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Where to build/install ADC module
« Reply #4 on: February 16, 2021, 10:33:25 AM »
Hi MTCAT
I would first try it using steps 3 through 6.

Steps 1 and 2 are only if trying to follow the instructions in the link provided which likely will be far more involved.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #5 on: February 16, 2021, 02:17:35 PM »
Hi Rich,

I went through those steps with two exceptions;

1) I had to re-install pciutils.tgz and gcc.
2) I had to omit the "l" in the big "tce-load -wil compilte tc perl5......" command.

But otherwise, everything went okay, except the ADC driver did not get built unfortunately, attached a screenshot here.

Any ideas ?
« Last Edit: August 15, 2021, 08:21:42 PM by Rich »

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #6 on: February 16, 2021, 02:34:43 PM »
Hi Rich,

Sorry, here's a "real" screenshot using the built in app in TinyCore3, MUCH better.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Where to build/install ADC module
« Reply #7 on: February 16, 2021, 09:24:31 PM »
Hi MTCAT
I found your linuxquestions.org thread:
https://www.linuxquestions.org/questions/linux-newbie-8/makefile-confused-about-kernel-version-that%27s-running-failed-module-insertion-4175690004/

I don't think trying to place variables after  ./make_all  is correct. See if this works any better:
Code: [Select]
CC_FLAGS="-march=i486 -mtune=i686" KERNELDIR="/lib/modules/`uname -r`/build" ./make_all 2>&1 > build.txt
Those are  back ticks  around  uname -r  not apostrophes. They are on the  ~ (tilde)  key. Hopefully, this will also redirect
output messages into  build.txt  which you can attach to your next post instead of images.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
Re: Where to build/install ADC module
« Reply #8 on: February 16, 2021, 11:47:32 PM »
"struct proc_info has no member named get_info" - this error means your module source is not compatible with this kernel version.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Where to build/install ADC module
« Reply #9 on: February 17, 2021, 05:41:43 AM »
Hi curaga
Thanks, I saw that error. The source package tests if version <= 2.6.25 so it shouldn't throw that error. Unless, ..........

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Where to build/install ADC module
« Reply #10 on: February 17, 2021, 06:00:01 AM »
Hi MTCAT
Your error message shows the error occurred in:
Code: [Select]
24dsi12_pll/driver/proc,c
The source package I found does not have a  proc.c  file, it has:
Code: [Select]
24dsi.linux.4.11.91.32.0/driver/os_proc,c
Where did you get that source package from?

The package I found is:
24dsi.linux.4.11.91.32.0.tar.gz
Found here:
http://www.generalstandards.com/downloads/

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #11 on: February 18, 2021, 07:37:01 AM »
Hi everyone, thank you so much for the help, the source package was bundled in with a little acquisition program I had written up for me many years ago, stored away on a pen drive, the .tar file should be from the mfr though (General Standards), but I suppose I don't know if the acquisition program developer changed anything in the tar file.

General Standards is recommending trying their new 4.11 driver, which I haven't tried to build/install yet.. I was hoping the old driver would work to maintain compatibility with the acquisition program, the new driver for example gets installed in usr/src/linux/drivers/24dsi as opposed to....../24dsi_pll, so at minimum I would assume some path names will need to be changed in the acquisition program before compiling it ?

I was just fearing that using the new driver would only solve one problem (build/install the driver) only to create another problem (not work with the acquisition code).

My previous discussions/attempts on linuxquestions.org were related to trying to get this all to work in Slackware12 (2.6.21), which I've given up on.

Thanks a lot Rich, I'll try your fancy ./make_all command, outputting to build.txt, and see how that goes..I could also send you guys the "old" .tgz driver file as well ?, or I could check for the proc.c

This is all an attempt of mine to lower power consumption, so I'm trying a VortexDX3 CPU, in the case of Slackware, Slackware was confused about what CPU was being used, or so it seemed, Slack12 could build the module, but failed to insert as the module was being built for "686" but my gcc target was "486" I believe, Slack12 was confused about what my CPU was.....I hope that's not the case here and the reason for the failed module building ? But here, like in Linux Mint, the module doesn't even get built, with Slack 12, it did "build", but failed to insert....

Slack12 would not recognize both CPU cores, I had to boot the "huge" version only, non SMP, running on one core. TinyCore3 seems fine, seems to recognize both VortexDX3 cores, but on startup, there is a message flashed, something to the effect, "CPU unknown, using generic init, your system may be unstable", but I've been ignoring it up til this point, maybe at my peril !

I guess I could try the new compiler "switches" first with the "old" driver, and failing that, try to build/install the new driver ?

Thanks for all this amazing help, I would be in a hopeless situation otherwise.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #12 on: February 18, 2021, 04:39:39 PM »
Hi Rich,

I tried out your big command,

CC_FLAGS="-march=i486 -mtune=i686" KERNELDIR="/lib/modules/`uname -r`/build" ./make_all 2>&1 > build.txt

But I got an error

sh: can't create build.txt: Permission denied

I tried putting sudo right at the beginning of the command, and also right before the ./make_all, but still got the same error, not sure what I'm doing wrong ?

Thanks

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Where to build/install ADC module
« Reply #13 on: February 18, 2021, 05:35:52 PM »
Hi MTCAT
First run:
Code: [Select]
./build_all cleanThis will remove any files leftover from a previous build. Then run the command in the attached file. It will redirect
all messages into a file called  build.txt  which you cann attach to your next post if required.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #14 on: February 18, 2021, 06:06:44 PM »
Hi Rich,

I ran "sudo ./make_all clean" first, and then tried your new command, but I still couldn't write to build.txt, not sure why.

So I tried out your original command, but without the re-direct (if that's the correct term) to build.txt, unfortunately, I think we get the same error behavior as before.

Sorry for the screenshot, but can see attached here.

Thanks.