|
From: Klaasjan <kla...@gm...> - 2023-04-29 11:39:23
|
Dear list, Over the past few weeks I have been renewing my interest and experience with the openpsion/psilinux kernel source, and compiling and testing it. Below is a brief summary of the initial steps, hopefully this will raise some new/renewed interest. The first issue was getting a suitable compiler running. It seems the 2.4 kernels need ancient versions (gcc 2.95 in particular), and compiling such an old cross-compiler then requires a chain of compilers working backwards from contemporary ones. Instead, a solution that works for me uses debootstrap, chroot and qemu as follows. This seems not only much simpler than installing or building a suitable cross-compiler, but also creates a filesystem that is suitable for running on your psion device (once you have a booting linux kernel). See below. Feedback appreciated. With enough positive feedback, perhaps this should go onto the openpsion website? Enjoy! Best, Klaasjan *** You need: - a recent (non-arm!) machine running debian (tested with bullseye), with internet access, root access and several GB of free disk space ** On this machine, create a suitable debian arm woody chroot as follows # most of the below needs to be done as root (use sudo, or sudo -i) * install the required tools: - apt install qemu qemu-user-static binfmt-support debootstrap - update-binfmts --display | grep arm # this should output: qemu-arm (enabled): interpreter = /usr/libexec/qemu-binfmt/arm-binfmt-P # also /usr/bin/qemu-arm-static should exist now * make a filesystem suitable for this old distro (ext2 revision 0) - dd if=/dev/zero of=./debian-arm-woody.img bs=100M count=20 # creates a 2GB file - mkfs.ext2 -r 0 ./debian-arm-woody.img * Create a debian distro on the image file (debootstrap first stage) - losetup -f # to create /dev/loop devices, only needed if these don't exist yet - mkdir /mnt/debian-arm-woody - mount -o loop ./debian-arm-woody.img /mnt/debian-arm-woody/ - debootstrap --foreign --arch=arm woody /mnt/debian-arm-woody/ http://archive.debian.org/debian/ - cp -i /usr/bin/qemu-arm-static /mnt/debian-arm-woody/usr/bin/ - cp /etc/hosts /mnt/debian-arm-woody/etc/hosts * Complete initial distro installation (debootsrap second stage) - chroot /mnt/debian-arm-woody/ /bin/sh - mount proc /proc -t proc - /debootstrap/debootstrap --second-stage --keep-debootstrap-dir # some warnings, like: apt-config: not found dpkg: warning, architecture `arm-none' not in remapping table W: Cannot find binary for checking sha256 checksums, falling back to sha1 I: Installing core packages... ... * install compiler software - apt-get install less bison flex gcc - apt-get install dialog wget bzip2 patch * check: - gcc -print-libgcc-file-name /usr/lib/gcc-lib/arm-linux/2.95.4/libgcc.a * next steps would be getting a suitable kernel source and try compiling it. More detailed instructions for that should probably be a follow-up item. |