WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
Raspberry Pi / Re: Rust on piCore: Computing π to 10,000 digits
« Last post by geev03 on January 23, 2026, 07:55:54 AM »
Code: [Select]
root@box:/home/tc/bin# ./sysinfo

            .~~.   .~~.
           '. \ ' ' / .'
        .~~ .~~~..~~~. ~~.
       : .~.'~'.~~.'~'.~. :
      ~ (   ) (  @  ) (   ) ~
     ( : '~'.~.'~~'.~.'~' : )
      ~ .~ (   ) ~~ (   ) ~
       (  : '~' :~~: '~' :  )
        '~ .~~~. ~  ~ .~~~. ~'
             '~'        '~'
             [ tiny-pi-core ]

  ┌──────────────────────────────┐
  │        piCore System         │
  └──────────────────────────────┘
  Hostname:     box
  Kernel:       6.12.25-piCore-v8
  Arch:         aarch64
  Uptime:        1:52
  Load Avg:     0.00 0.00 0.09
  CPU Model:    Raspberry Pi 400 Rev 1.0
  CPU Cores:    4
  RAM Total:    3797.4 MB
  RAM Free:     3461.8 MB

    [Edit]: Added code tags.  Rich
62
Raspberry Pi / Rust on piCore: Computing π to 10,000 digits
« Last post by geev03 on January 23, 2026, 07:38:53 AM »

Got Rust working on **piCore (Raspberry Pi 400)** and successfully compiled a Chudnovsky‑based π calculator using the `rug` big‑number crate.

**Steps:**
- Install Rust and toolchain: 
  ```
Code: [Select]
  tce-load -wi rust compiletc binutils make  ```
- Create project: 
  ```
Code: [Select]
  cargo new pi_calc  ```
- Add to `Cargo.toml`: 
  ```toml
  [dependencies]
  rug = "1.28"
  ```

**Simple Chudnovsky implementation (works on piCore):**

Code: [Select]
```rust
use rug::{Float};
use rug::ops::Pow;

fn main() {
    let digits: u32 = 10000;
    let prec: u32 = digits + 20;

    let pi = compute_pi(prec);
    println!("{}", pi.to_string_radix(10, Some((digits + 2) as usize)));
}

fn compute_pi(prec: u32) -> Float {
    let mut sum = Float::with_val(prec, 0);
    for k in 0..20 {
        let f6k = factorial(6 * k);
        let f3k = factorial(3 * k);
        let fk  = factorial(k);

        let a = Float::with_val(prec, 13591409 + 545140134 * k as i32);
        let b = Float::with_val(prec, 640320).pow(3 * k + 1);

        let term = Float::with_val(prec, &f6k * a / (&f3k * fk.pow(3) * b));
        if k % 2 == 0 { sum += term } else { sum -= term }
    }
    Float::with_val(prec, 1) / (Float::with_val(prec, 12) * sum)
}

fn factorial(n: u32) -> Float {
    let mut f = Float::with_val(128, 1);
    for i in 2..=n { f *= i }
    f
}
```

Outputs π to 10k digits on a Pi 400 without issues. 

    [Edit]: Added code tags.  Rich
63
TCE Talk / Re: New package manager
« Last post by wysiwyg on January 22, 2026, 08:58:30 PM »
For anyone interested, the package manager is called 'pax'.  It should be in the repo as soon as it's processed.
64
TCE Talk / Re: New package manager
« Last post by wysiwyg on January 22, 2026, 08:57:08 PM »
Oh so it is!!!  Thanks for the tip.  I couldn't find it anywhere lol
65
TCE Talk / Re: New package manager
« Last post by Rich on January 22, 2026, 08:53:30 PM »
Hi wysiwyg
It's part of the base system:
Code: [Select]
tc@E310:~$ ls -l /usr/bin/bcrypt
-rwxr-xr-x 1 root root 14836 Jun  9  2019 /usr/bin/bcrypt
66
TCE Talk / Re: New package manager
« Last post by wysiwyg on January 22, 2026, 08:48:25 PM »
Hey Rich, thanks for the reply.  I don't even see bcrypt in the repo there either.
67
TCE Talk / Re: New package manager
« Last post by Rich on January 22, 2026, 08:29:23 PM »
Hi wysiwyg
Why can't you bcrypt the tar file using Tinycore?
68
TCE Talk / New package manager
« Last post by wysiwyg on January 22, 2026, 02:40:58 PM »
I have recently updated the package manager used in a forked distro of TC and wanted to add it to the repo for TC since it has many more features than the tce-* equivalents.  Reading through the instructions here:

https://forum.tinycorelinux.net/index.php/topic,2072.msg11002.html#msg11002

says that one of the final steps in the use the bcrypt binary to encode it so that the attachments go through to the gmail address listed in that document.  Unfortunately it does not appear that bcrypt is in the Debian repo any longer.  Is there some other encryption to use?  Or should this step just be ignored?

Thanks!
69
I recently needed to add an item to the right-click desktop popup menu.
I decided to demonstrate it with a simple example. I chose this example
because someone wanted a clicky way to access and change the mirror.
Plus, it could be accomplished with Xprogs.tcz which I think gets installed
for all (most?) GUIs:
Code: [Select]
# This creates the file.
tc@E310:~/MakeMenuItem$ echo -e "#!/bin/sh\neditor /opt/tcemirror" > /"$HOME"/.wmx/Applications/TcMirror
# This is the file we just created.
tc@E310:~/MakeMenuItem$ cat /"$HOME"/.wmx/Applications/TcMirror
#!/bin/sh
editor /opt/tcemirror
# It needs to be made executable.
tc@E310:~/MakeMenuItem$ chmod 755 /"$HOME"/.wmx/Applications/TcMirror
# This adds it to the menu.
tc@E310:~/MakeMenuItem$ "$DESKTOP"_makemenu TcMirror

Here you see it's been added to the menu:


Create a file (name does not matter) in  ~/.X.d/  that contains:
Code: [Select]
echo -e "#!/bin/sh\neditor /opt/tcemirror" > /"$HOME"/.wmx/Applications/TcMirror
chmod 755 /"$HOME"/.wmx/Applications/TcMirror
"$DESKTOP"_makemenu TcMirror
and the item will be added to the menu once the desktop starts.
The file does not need to be executable.

When you click on  Applications->TcMirror , the  editor , which is part
of  Xprogs.tcz  will open  /opt/tcemirror.

If you decide you want to remove the item from the menu:
Code: [Select]
# This removes the  TcMirror  file you created.
tc@E310:~/MakeMenuItem$ "$DESKTOP"_rmitem TcMirror
# This removes the  TcMirror  entry from the menu.
tc@E310:~/MakeMenuItem$ "$DESKTOP"_makemenu TcMirror
70
Load TinyCorePlus again, issue the dmesg command and examine the contents to see what wifi hardware you have and what firmware is used.

Once you have the data above, you can use it to get WiFi working in CorePure64.
Pages: 1 ... 5 6 [7] 8 9 10