Go to advanced search

by jahboater
Wed Sep 30, 2020 6:11 pm
Forum: Beginners
Topic: how to add to PATH
Replies: 8
Views: 200

Re: how to add to PATH

Rcayot wrote:
Wed Sep 30, 2020 5:46 pm
well yes, #1 has been answered.

I suspect that I need to have #2 answered.
That's easy.
There is a file in your home directory called ".bashrc"
You may edit it with "nano ~/.bashrc" and add the PATH= stuff there.
It will then always be available.
by jahboater
Wed Sep 30, 2020 4:50 pm
Forum: Beginners
Topic: how to add to PATH
Replies: 8
Views: 200

Re: how to add to PATH

Rcayot wrote:
Wed Sep 30, 2020 4:46 pm
anyway, how do I add this to PATH?
If you want it first on the search path:

Code: Select all

PATH=/home/pi/.local/bin:$PATH
or last on the search path:

Code: Select all

PATH=$PATH:/home/pi/.local/bin
by jahboater
Wed Sep 30, 2020 12:15 pm
Forum: Bare metal, Assembly language
Topic: Change code from FASMARM assembler to GAS
Replies: 3
Views: 212

Re: Change code from FASMARM assembler to GAS

Perhaps use movw and movt instead of all the orr's ? (16-bit immediates)
At least:

Code: Select all

movw \reg,#(\opr) & 0x0000FFFF
should save one insn.
similarly mov and movk for A64

The A72 CPU is starting to merge these operations.
by jahboater
Tue Sep 29, 2020 11:08 am
Forum: Beginners
Topic: Small quiet fan for Labists case
Replies: 19
Views: 1795

Re: Small quiet fan for Labists case

As a general thing with fans, small and quiet don't mix. Smaller fans must rev much higher for a decent airflow so tend to be more noisy. Recently I accidentally knocked off the stick-on passive heatsink from my Pi4. I am continuing to use it with a 2000MHz overclock, and it is quite happy! It idles...
by jahboater
Mon Sep 28, 2020 11:42 pm
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

All things UDP/TCP/IP/Ethernet remain big-endian, so it affects comms software for all little-endian connected systems Same for crypto. I always wondered how much faster networking would be if they had chosen the network byte order to be the right way round :) (so that ntohl and htonl did nothing o...
by jahboater
Mon Sep 28, 2020 5:12 pm
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

That says nothing about what happens to the heap if a signal is received while malloc is allocating memory. Yes, but it does appear to be mandating that the *alloc functions are "pure". On another note, one of the things I had to learn when writing my first numerical codes was the big versus little...
by jahboater
Mon Sep 28, 2020 11:08 am
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

One way to make sure you are not using any operating system extensions is to actually compile and run the program in Macintosh, Windows and Pi to see if it works. Yes exactly. That's what I would do. Build and test it on every platform possible. But I was suggesting that for simple learning program...
by jahboater
Mon Sep 28, 2020 8:44 am
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

Heater wrote:
Mon Sep 28, 2020 8:34 am
I thought Macs used Clang. Not that that should make any difference.
May well be. Its been ten years since I worked on MAC's, we used GCC then.

And yes it should not make a difference. Clang is a good compiler.
Furthermore it tries hard to be compatible with GCC.
by jahboater
Mon Sep 28, 2020 8:22 am
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

Why windows, mac and PI? I think you will find its the same compiler on the Pi as it is on the MAC. Try typing "gcc -v" on the MAC and see what you get. Might be a different version of the compiler of course but that wont matter for your purposes. On Windows, you can install GCC for free (called mi...
by jahboater
Sun Sep 27, 2020 10:12 pm
Forum: Bare metal, Assembly language
Topic: [SOLVED] Life's a GAS, or maybe not!
Replies: 4
Views: 234

Re: Life's a GAS, or maybe not!

Could you post the code?
It must be quite small, or does it do more than print Yippee! ?
by jahboater
Sun Sep 27, 2020 6:25 pm
Forum: General discussion
Topic: Q: How much would a Raspberry pi 4 costed with two CPUs
Replies: 38
Views: 1252

Re: Q: How much would a Raspberry pi 4 costed with two CPUs

Wait up a minute. Our OP was asking about two CPU's. That is "Central Processing Units". As far as I know. The keyword here for me is "central". Clearly there can only be one "central" thing. If there were more than one it would not be central anymore now would it. Which is likely why we talk about...
by jahboater
Sun Sep 27, 2020 5:34 pm
Forum: General discussion
Topic: Q: How much would a Raspberry pi 4 costed with two CPUs
Replies: 38
Views: 1252

Re: Q: How much would a Raspberry pi 4 costed with two CPUs

Puffergas wrote:
Sun Sep 27, 2020 5:12 pm
How about writing more efficient code... Use what we have, now, more efficient.
The OP is asking for less CPU's than the Pi4 already has :)
by jahboater
Sun Sep 27, 2020 4:34 pm
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

While it may be possible to arrange a Pi and SSD in a compact case convenient to carry about, the external SSD could interfere with WiFi as all USB3 devices are wont to do. For this reason I would recommend using a non-counterfeit A1 class SD card to start out with. I agree. I use these and never h...
by jahboater
Sun Sep 27, 2020 4:20 pm
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

First task is – of curse – learning C++ but in future projects I can think of processing measurement data (e.g. streams of current and voltage values) and/or the implementation of “simple” optimization algorithms. Do you have some examples where to expect the limits of the PI in such projects? For ...
by jahboater
Sun Sep 27, 2020 11:12 am
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

This is why I would like to use a PI as a kind of take away C++ box that I can take everywhere where I will find an in- and output-solution (e.g. keyboard, display, …). You may also connect to the Pi over the network from another computer, so that no keyboard or screen are needed. You get either a ...
by jahboater
Sun Sep 27, 2020 11:10 am
Forum: C/C++
Topic: Learning C++ using PI 4
Replies: 22
Views: 897

Re: Learning C++ using PI 4

For future task I will need to write C++ w/o access to the macOS but with access to windows. As far as I understand, there will be differences in the syntax switching the systems and also maybe the Compiler or IDE. C++ itself is a portable high level language, you shouldn't have any problems. Obvio...
by jahboater
Sun Sep 27, 2020 9:25 am
Forum: General programming discussion
Topic: Euler performance revisited...
Replies: 1
Views: 200

Re: Euler performance revisited...

Unexpected: The Raspberry Pi 4 is 10 times faster in 64 bit mode! Yes, a full order of magnitude.[/list] That may be because it has a fast hardware 64-bit division instruction, in 32-bit mode its done by a library call. sysbench also exhibits this large performance gain (a 64-bit integer prime numb...
by jahboater
Sat Sep 26, 2020 7:56 pm
Forum: General discussion
Topic: Unboxing a Raspberry 4 (8GB version)
Replies: 24
Views: 749

Re: Unboxing a Raspberry 4 (8GB version)

I am also one who misses the spring loaded SD slot. I never had much in the way of problems with them, but I can well imagine that people did, so the current practice with friction hold. Me too. I never had any problems with the spring loaded SD slot, and assumed its loss was down to cost cutting.
by jahboater
Sat Sep 26, 2020 5:49 pm
Forum: General discussion
Topic: Q: How much would a Raspberry pi 4 costed with two CPUs
Replies: 38
Views: 1252

Re: Q: How much would a Raspberry pi 4 costed with two CPUs

fruitoftheloom wrote:
Sat Sep 26, 2020 5:46 pm
skyler0x wrote:
Sat Sep 26, 2020 5:27 pm
Hi everyone. I was wondering how much the Raspberry pi 4 would cost theoretically, if it had two of the same CPUs?

The ARM CPU is an integral part of the SoC..
And there are already four of them.
Four Cortex-A72 CPU cores.
by jahboater
Sat Sep 26, 2020 9:33 am
Forum: General discussion
Topic: Looking for RPI 4 quality PSU
Replies: 8
Views: 293

Re: Looking for RPI 4 quality PSU

After running the stress tests, you may use this command to detect any voltage (or temperature) problems that occurred since the last boot:

Code: Select all

vcgencmd get_throttled
it should always return 0x0 for a happy Pi.
by jahboater
Fri Sep 25, 2020 10:48 pm
Forum: C/C++
Topic: questions to C libs also for g++
Replies: 28
Views: 816

Re: questions to C libs also for g++

But apart from mangling, can anyone please explain me what this obfuscated weird block means or does? #ifdef __cplusplus extern "C" { #endif extern int ads1115Setup (int pinBase, int i2cAddress) ; #ifdef __cplusplus } #endif I mean, line by line, and which lines are alligned to which other lines to...
by jahboater
Fri Sep 25, 2020 7:49 pm
Forum: Off topic discussion
Topic: What will be available first?
Replies: 23
Views: 1642

Re: What will be available first?

My favourite source of Pi's, the Pi Hut, have plenty of stock for all the Zero versions.
https://thepihut.com/collections/raspberry-pi
Every Pi I have ordered from the Pi Hut has arrived the next day too.
by jahboater
Fri Sep 25, 2020 7:03 pm
Forum: Troubleshooting
Topic: how to remove 320,000 files?
Replies: 24
Views: 687

Re: how to remove 320,000 files?

That still does way too many fork/exec's. If you are going to do it using only conventional tools, you just have to use xargs . Yes, probably. For interest, fork/exec are very fast and comparatively light weight (compared to CreateProcess() say in Windows). Before threads were invented, UNIX used f...
by jahboater
Fri Sep 25, 2020 6:01 pm
Forum: C/C++
Topic: questions to C libs also for g++
Replies: 28
Views: 816

Re: questions to C libs also for g++

dsyleixa123 wrote:
Fri Sep 25, 2020 5:20 pm
where does the _Z3fooii come from, and what has that to do with my proprietary declared foo() function as a _Z3fooii function is never declared in my source files so never can interfere with either proprietary one?
Re-read what @plugwash explained above.
Its called name mangling.
by jahboater
Fri Sep 25, 2020 5:02 pm
Forum: C/C++
Topic: questions to C libs also for g++
Replies: 28
Views: 816

Re: questions to C libs also for g++

dsyleixa123 wrote:
Fri Sep 25, 2020 4:40 pm
why do I need the "extern" for the function? Finally it's the same here in the ads1115.h file as in the ads1115.c file? I never observed this "extern" thing in other libs (e.g., in Arduino C++ libs)
To say that it might be defined in another source file.
Look up the extern keyword in google.

Go to advanced search