WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Free Pascal + Lazarus  (Read 4704 times)

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Free Pascal + Lazarus
« on: April 20, 2017, 05:40:39 AM »
I have been spending the last year learning Ultibo, a baremetal way to make a DIY kernel.bin.
Uses a custom version of Lazarus and Free Pascal Compiler.

Runs in Windows and I  use it under Wine in Linux, portable to Raspbian if you know how ???
Not sure if Lazarus will work/compile for piCore, but even I managed to compile FPC on Raspbian.

Now that Fifth browser is working on piCore it it time for me to move to piCore/X11 for development.
It has been ages since I tried to make a tcz. Seem to remember, it was a squashed file method.
Is there a tutorial somewhere?

Once FPC works then Lazarus might be possible?

Hmm, it has been a while, this is what I was looking for.
http://forum.tinycorelinux.net/index.php/topic,19071.0.html
Something to try on the weekend.

Might have to increase my partition size up some from 100MB ::)
Hmm PiCore should boot from from 32GB USB stick on Pi3? :P




Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Free Pascal + Lazarus
« Reply #1 on: April 20, 2017, 08:44:56 AM »
Hi Gavin,

there is a WiKi article on creating extensions. It was written for TC but it works nearly the same way for piCore, at least how to pack it to a .tcz file and what support files are needed for the repo. If you are in doubt, send me an email.

FPC / Lazarus must work, I do not see reason why not, but someone must create it on piCore :)

You can't boot from USB directly, but you can move /tce directory from /mnt/mmcblk0p2 to an USB stick with a Linux file system or FAT/VFAT (not adviced). System will find it and load extensions from there. You may need to add waitusb=5 to cmd line to get it recognized during boot. Also you can use an USB partition to build extensions, but my experience is that USB stick are much slower than SD cards, so practically USB is usable only as a backup media but for development use SD card. Even as SD card with an USB card reader works fine, but USB sticks are slow. For sure it depends on the stick thought.

Regards... Béla
Béla
Ham Radio callsign: HA5DI

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

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1072
Re: Free Pascal + Lazarus
« Reply #2 on: April 20, 2017, 09:30:03 AM »
Actually, with a rpi3b, you can boot to USB without a SDcard.  The rpi3 will hunt and find the boot partition.   It will also netboot without any media at all.  We have a piCorePlayer (which is piCore based) user doing this.   Take a look at this thread.

http://forums.slimdevices.com/showthread.php?107233-Netbooting-piCorePlayer-3-x

Obviously not a speedy file system for a development system, but it has it's applications.
« Last Edit: April 20, 2017, 09:31:44 AM by Paul_123 »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Free Pascal + Lazarus
« Reply #3 on: April 20, 2017, 07:55:55 PM »
Really? I thought that would be a feature that would have yet to come. Interesting. Worth for experimenting, and if applicable, for testing OSes / versions, as I don't want to mess with existing working SD card installs too much which I'm limited at in quantity. Fiddling with USB sticks is much less of a hassle in several ways (for me at least).
I'm guessing it's just the same partitioning layout as for an SD card installation, i.e. a FAT partition providing the required files and go?
Download a copy and keep it handy: Core book ;)

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Free Pascal + Lazarus
« Reply #4 on: April 20, 2017, 08:53:51 PM »
It takes longer to boot but piCore runs from a tiny USB Lexus 32GB stick on a Pi3.
Used Win32DiskImager like normal.
Stuck it on a Linux box to increase and make new partitions.

So the question is what is the best way to setup partitions, swap file etc?
Now Laz/FPC takes about 800MB, best spot to put it?

Never really used piCore as a desktop, what are the best options.
Probably will have to do a GCC install etc too one day.
Go and Rust will be on list.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Free Pascal + Lazarus
« Reply #5 on: April 21, 2017, 12:28:27 AM »
Never really used piCore as a desktop, what are the best options.
flwm and the fifth browser work fine - there's also the gtk1 text editor (beaver) and file browser (emelfm).

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Free Pascal + Lazarus
« Reply #6 on: April 21, 2017, 01:56:34 AM »
Thanks Juanito
Will try beaver and emelfm, they look nice and small.

Viewnior works fine to view Raspistill images.
Any suggestion for the Raspivids?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Free Pascal + Lazarus
« Reply #7 on: April 21, 2017, 02:51:59 AM »
ffplay (ffmpeg.tcz).
Download a copy and keep it handy: Core book ;)

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Free Pascal + Lazarus
« Reply #8 on: May 07, 2017, 04:54:23 AM »
Pain to compile stuff on piCore.

Wanted to move an old app to piCore but it used pygame which uses sdl.......
All too hard for me.
So thought I would try Free Pascal since someone has nicely compiled a version for Pi's
https://www.freepascal.org/down/arm/linux-hungary.var

Gee, guess what it works :P  well it return the version fpc -v
Still in my home/tc/ folder but it then compiled a helloworld.pas in 0.7secs

The old text mode ide fp needs libncurses.so.5
If fpc compiles will it make the Lazarus IDE?
And if Laz compiles then Ultibo can be ported to piCore :P
There is Raspberry Pi gpio stuff for FPC too.

Not sure if the x11 windows stuff will work in piCore?





Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Free Pascal + Lazarus
« Reply #9 on: May 08, 2017, 04:28:23 AM »
fpc is +/- 50mb and lazarus is +/- 100mb - perhaps not the most suitable software for RPi :o

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Free Pascal + Lazarus
« Reply #10 on: May 08, 2017, 08:02:47 AM »
fpc is +/- 50mb and lazarus is +/- 100mb - perhaps not the most suitable software for RPi :o

Maybe not for the old RPi boards, but RPi3 is OK. I have friends developing industrial applications for RPi in Pascal on Raspbian.
Béla
Ham Radio callsign: HA5DI

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

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Free Pascal + Lazarus
« Reply #11 on: May 12, 2017, 09:51:46 PM »
fpc is +/- 50mb and Lazarus is +/- 100mb - perhaps not the most suitable software for RPi :o

Full python is similar in size, Lazarus is a bit big, but for other Languages I use Geany, which is not tiny.
But remember you don't need numpy and other huge libraries and most /all you need for making aps comes with it.
It is also a RAD tool so aps are very fast to develop.

Pi3 are not the fastest development boxes ;D
It helps to use piCore instead of Raspbian to get rid of some (a lot) of bloat.

Just found out about zRam.
http://geektillithertz.com/wordpress/index.php/2017/03/16/raspberry-pi-zram/
It may not make any difference for normal FPC compiling unless you compile FPC/Lazurus itself

Just did a very quick test last week using Ultibo to do bitmaps text overlay etc.
Got old box with HDMI Graphics display showing bitmaps and sensor data done years ago using Raspbian, Python/Pygame on old model A.
8GB Sdcard image, using about 4.6GB.

Apart from the bitmap files and the lack of antialiasing diagonal lines Ultibo made a kernel.bin of 2.4MB.
The original version that ran on a PC, took 8 months to develop, porting to Pi took 8 days before the weeks of test cycles.
I am making a guess of 8 hours to re-factor from python to pascal and get it running on Ultibo with much less time wasted testing.

I will admit to getting better at coding, but I am not that good :-*
Free Pascal is that good and Lazarus makes it pleasant to use.
But It will make a big tcz :-X