WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can I install this system into RAM  (Read 2540 times)

Offline GAI

  • Newbie
  • *
  • Posts: 30
Can I install this system into RAM
« on: March 31, 2021, 11:52:52 PM »
I hope it's very open, but at present it takes about 25 seconds to boot, load the module and run the program

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: Can I install this system into RAM
« Reply #1 on: April 01, 2021, 12:06:42 AM »
Hi, GAI

What you're looking for is call copy2fs.

Read the book for more details.

The more extensions you load, the slower the system boots.

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #2 on: April 01, 2021, 12:13:47 AM »
I didn't load any extra kernel modules or drivers

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Can I install this system into RAM
« Reply #3 on: April 01, 2021, 12:18:48 AM »
Copying extensions to RAM will slow down booting.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #4 on: April 01, 2021, 12:21:59 AM »
Do you have anything faster

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14553
Re: Can I install this system into RAM
« Reply #5 on: April 01, 2021, 12:33:44 AM »
It would help others to help you if you could provide details of your hardware, what version and architecture of tinycore you are using and if you are loading any extensions "onboot".

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #6 on: April 01, 2021, 12:43:12 AM »

hardware :  raspberry  cm3+

os  :   tiny  core   13.03

Onboot I only loaded SSH

bootloacal:
......
  inomod  serial.ko 
  inomod  ch341.ko

ifconfig eth0  up

ifconfig  192.168.1.121
cd /mnt/mmc/tce
./mypro


what can I do , it can start faster




« Last Edit: April 01, 2021, 01:10:06 AM by GAI »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: Can I install this system into RAM
« Reply #7 on: April 01, 2021, 01:26:57 AM »
25 seconds is oddly slow for cm3+

It takes me 17 seconds to boot RPI4 with mylocale, openssh, wifi

10 seconds needed before TC kernel takeover.

I have no idea what program you run.

I guess that's the problem.

Anyway, does a few seconds really matter for you ?

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #8 on: April 01, 2021, 01:31:57 AM »
Yes, it's very important. I burn the system into MMC. Its startup time is 15s. But my builderroot startup time is only 12 seconds


I want him to be faster, at least faster than buildroot

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: Can I install this system into RAM
« Reply #9 on: April 01, 2021, 04:07:41 AM »
In that case, you could

  A: Remaster the filesystem (rootfs-piCore*.gz)

  B: Merge all extensions into one (you only have openssh though)

  C: Recompile the kernel natively to see if it goes faster.

  D: Refactor the Core-scripts to drop all the redundant processes for piCore.

  E: Overclock your RPI

  F: Buy a  faster raspberry pi (I guess it takes time for CM to check the peripherals)

Anyway, it's getting off topic cause the idea of install this system into RAM is not exactly what you're looking for.

Set the copy2fs.flg would copy all extensions into RAM which is time consuming in its nature.

Decompressing the archives and creating the symbolic links are the bottleneck.

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #10 on: April 01, 2021, 08:45:56 PM »
  D: Refactor the Core-scripts to drop all the redundant processes for piCore.

what should i do?

this  is  12.0   I use  13.03
« Last Edit: April 01, 2021, 08:48:34 PM by GAI »

Offline CNK

  • Full Member
  • ***
  • Posts: 240
Re: Can I install this system into RAM
« Reply #11 on: April 02, 2021, 12:17:30 AM »
If you go with polikuo's option D, then you'll also have to do option A, because the boot scripts are built-in and run before extensions are unpacked.

For option A (see remastering guide on the Wiki), you really are installing things to RAM so this isn't really off-topic. This way you avoid the "symbolic links" bottleneck and could also trim down/eliminate lots of stuff in the start-up scripts (depending on what you're actually doing of course) - specifically /etc/init.d/rcS and /etc/init.d/tc-config. Maybe adjusting the compression settings for the initramfs when you remaster it may speed up boot, but whether to increase or decrease compression depends on whether the bottleneck is the CPU decompressing the data, or actually reading the data from the flash storage.

Bare minimum if you just want the Linux kernel to run one program, with no other processes started and only built-in kernel modules available, is to edit the boot command line adding "init=[program you want to run with full path]". You'll still need to remaster in order to include the program you want to run in the initramfs. Whether that option is even remotely suitable depends entirely on the details of your application. It's the fastest way to run something in Linux, but you'll probably run into odd problems unless you know absolutely everything that your program is doing (preferably, you wrote all of it yourself with this in mind).
« Last Edit: October 27, 2022, 07:24:31 PM by Rich »