minimal OS for raw math calculations

Post Reply
gsgs
Posts: 33
Joined: Thu Jul 11, 2019 5:14 pm
languages_spoken: english
ODROIDs: n2
Has thanked: 5 times
Been thanked: 1 time
Contact:

minimal OS for raw math calculations

Unread post by gsgs » Fri Sep 13, 2019 5:24 pm

for some tasks do I need an operating system or BIOS or UEFI at all ?
E.g. suppose I'm searching for counterexamples to a math hypothesis
or solutions for a math puzzle.:
When started, the program runs calculations in raw assembly,
no input, no output, few MB of RAM..
When a counterexample is found the LED blinks or it shuts down
or pauses or crashes.
How long would be the boot-image for that ?
OK, give me one MB on the card for that assembly program
and one MB for its stdout , could be at fixed sectors on the card, no filesystem needed.
Does it exist ? Let me download and "flash" it.

User avatar
mad_ady
Posts: 6519
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 163 times
Been thanked: 125 times
Contact:

Re: minimal OS for raw math calculations

Unread post by mad_ady » Fri Sep 13, 2019 9:52 pm

I doubt anything like it exists. You know, operating systems are there for convenience as well.

crashoverride
Posts: 4519
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 67 times
Contact:

Re: minimal OS for raw math calculations

Unread post by crashoverride » Sat Sep 14, 2019 6:58 am

It does exist. You can author arbitrary custom commands for the u-boot environment which has support for SD cards, networking, display, GPIO, etc. Alternatively, you can have u-boot load your custom program instead of the linux kernel.
These users thanked the author crashoverride for the post:
gsgs (Sat Sep 14, 2019 9:08 pm)

gsgs
Posts: 33
Joined: Thu Jul 11, 2019 5:14 pm
languages_spoken: english
ODROIDs: n2
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: minimal OS for raw math calculations

Unread post by gsgs » Sat Sep 14, 2019 9:17 pm

I found a description of u-boot here : https://www.96boards.org/blog/boot-linu ... ard-uboot/

I also found several small Linuxes for X86,
tiny-core-current.iso with 19MB
slitaz-rolling.iso with 53MB
damn small linux <50MB

[not yet tested on X86)
I speculate that on devices with SSD I can just replace the SSD and it boots from SSD ?!?
While booting internal eMMc s or SDs are usually soldered and cannot be replaced ?!?

User avatar
mad_ady
Posts: 6519
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 163 times
Been thanked: 125 times
Contact:

Re: minimal OS for raw math calculations

Unread post by mad_ady » Sat Sep 14, 2019 9:50 pm

N2 is not x86, it's arm64. Those distros won't work here.
Both emmc and sd cards are user replaceable. There's 0 chances of doing a software brick

elatllat
Posts: 1493
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2
Has thanked: 21 times
Been thanked: 45 times
Contact:

Re: minimal OS for raw math calculations

Unread post by elatllat » Sun Sep 15, 2019 10:59 am

gsgs, you likely can just do whatever you want to do with the official OS.

Bare metal programming is a lot of work for likely no return.
You could use LFS if you want a learning curve,
or there are a bunch of arm64 distributions but unless you have a specific reason there is no general benefit of one over another.
Any of the main distributions (Arch, Debian, Fedora, OpenSUSE) , from which most other distributions are built, have small "base" installs so you can build up from there, or trim down from the big user friendly installs to suite your needs.

eg;
__26MB ubuntu-base-18.04-base-arm64.tar.gz
_903MB ubuntu-18.04.3-server-arm64.iso

There are some really tiny 4MB OSes like dd-wrt, but that's for over priced, under powered, consumer routers.

The main thing is that the install size has almost nothing to do with performance, and there is no economic advantage to sdcards under 64GB so why are you pursuing this line of thought? The only advantage to a small image I can think of is for security auditing at which point you will want a 100% open computer, the closest I know of being the Blackbird, or HiFive.
These users thanked the author elatllat for the post:
gsgs (Sun Sep 15, 2019 3:41 pm)

elatllat
Posts: 1493
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2
Has thanked: 21 times
Been thanked: 45 times
Contact:

Re: minimal OS for raw math calculations

Unread post by elatllat » Sun Sep 15, 2019 11:35 am

Make a big prime;

Code: Select all

time (echo "70965694293*(2^(200006)-1)" | bc)
in 1 second.


Factor a big prime;

Code: Select all

perl -MCPAN -e shell
install Math::Prime::Util
time /root/.cpan/build/Math-Prime-Util-0.73-0/bin/factor.pl $(export BC_LINE_LENGTH=0; echo "70965694293*(2^(200006)-1)" | bc)
in, well, likely forever without a supercomputer, but the point is just do what you need to do quick and dirty then figure out how to optimize it with GPU etc.

User avatar
igorpec
Posts: 390
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 7 times
Been thanked: 26 times
Contact:

Re: minimal OS for raw math calculations

Unread post by igorpec » Sun Sep 15, 2019 5:12 pm

Plug and play with relatively small size:
https://dl.armbian.com/odroidn2/Debian_ ... minimal.7z
140MB expands to around 500MB.

Basically its Python/dev tools free Buster server image. It can be further stripped, but IMO there is really no point/gain. Other options will bring a lot more work and tears ;) and no difference in your use case.
ARMBIAN - follow on Twitter
linux for ARM development boards with user friendly development tools

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 1 guest