minimal OS for raw math calculations

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

minimal OS for raw math calculations

Post by gsgs »

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.

mad_ady
Posts: 8819
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 528 times
Contact:

Re: minimal OS for raw math calculations

Post by mad_ady »

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

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

Re: minimal OS for raw math calculations

Post by crashoverride »

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: 37
Joined: Thu Jul 11, 2019 5:14 pm
languages_spoken: english
ODROIDs: n2
Location: Germany
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: minimal OS for raw math calculations

Post by gsgs »

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 ?!?

mad_ady
Posts: 8819
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 528 times
Contact:

Re: minimal OS for raw math calculations

Post by mad_ady »

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: 1833
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+, HC4
Has thanked: 57 times
Been thanked: 124 times
Contact:

Re: minimal OS for raw math calculations

Post by elatllat »

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: 1833
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+, HC4
Has thanked: 57 times
Been thanked: 124 times
Contact:

Re: minimal OS for raw math calculations

Post by elatllat »

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.

igorpec
Posts: 797
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 43 times
Been thanked: 114 times
Contact:

Re: minimal OS for raw math calculations

Post by igorpec »

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
Linux for ARM development boards
What is Armbian?

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: apb1704 and 2 guests