ClockworkPI Emulated system

anyone whos followed me for any length of time knows I have been working on getting the ClockworkPi running in an emulated system. and I’m happy to say I’m significantly closer to a fully working version. I will post pics/etc very soon. but I have had to take the kernel and initrd from a working debian on armhf and use them to get it to boot. I have been working to modify the clockworkos_v0.3 image to make it work within the qemu environment but I should have something that 100% compatible soon.

however. I would rather the actual clockwork pi image working natively so I’m looking for anyone with any skills/knowledge to getting qemu to accept the uImage kernel and not require an initrd.

3 Likes

let me provide a small update. the Clockwork OS does not contain the kernel source nor anything pertaining to it, therefore I will have to build a completely custom kernel to run this. which is sort of sad, but we can work around it. (I would LOVE if one of the CPI team chimed in, maybe provided the .config) but elsewise I’m going to be providing a modified .img here soon as well as detailed instructions on launching in qemu with full graphical support for native development)

please everyone that comes across this, heart and share the post so we can get the dev teams attention. that .config for the kernel would be a MASSIVE help

isn’t it directly included with the patch file ?

https://raw.githubusercontent.com/clockworkpi/Kernel/master/cpi3-linux_4_14_2.patch

diff --git a/arch/arm/configs/clockworkpi_cpi3_defconfig b/arch/arm/configs/clockworkpi_cpi3_defconfig
new file mode 100644
index 0000000..84774c4
--- /dev/null
+++ b/arch/arm/configs/clockworkpi_cpi3_defconfig
@@ -0,0 +1,3441 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 4.14.2 Kernel Configuration
+#

if you compile fine, could you try latest kernel with fresh lima included in mainline ?

if i was smart I would have known that lol… looking into that now

you may check this crazy guy awesome work :

司徒的教學網站

here is the patch adapted for latest linux master > linux.5.gameshell.diff

file b/arch/arm/boot/dts/sun8i-r16-clockworkpi-cpi3.dts need fix due to some pin rename > sun8i-r16-clockworkpi-cpi3.dts

file b/sound/soc/sunxi/sun8i-codec-analog.c need use of regmap read/write functions > sun8i-codec-analog.c

compilation succeed, some warning :

<stdin>:1388:2: warning: #warning syscall open_tree not implemented [-Wcpp]
<stdin>:1391:2: warning: #warning syscall move_mount not implemented [-Wcpp]
<stdin>:1394:2: warning: #warning syscall fsopen not implemented [-Wcpp]
<stdin>:1397:2: warning: #warning syscall fsconfig not implemented [-Wcpp]
<stdin>:1400:2: warning: #warning syscall fsmount not implemented [-Wcpp]
<stdin>:1403:2: warning: #warning syscall fspick not implemented [-Wcpp]

resulting files uploaded here > Index of /kernel/

first time i compile the kernel, not really know if it work & what to do now %)

1 Like

thanks. your kernel still doesnt boot it but thats not your fault. with all that you’ve provided me i have actually made some progress. now qemu doesnt just crash and kick out it actually gives me a blackscreen AND is driving the CPU a fair bit so it’s not quite there, but its progress none the less.

I figured I should elaborate on the struggles I am having. when it comes to hardware everything has a bus. and this thing does not use the PCI bus which has thrown me for a loop. as well as the main display is an HDMI output via some unknown method to me, but although things are slow to progress I am figuring bits out and will have something soon. now that we can see the patching for the kernel and steward-fu’s details are available i should be able to get somewhere. just means more reverse engineering than i initially intended.

nice :- )

my patch to the dts and analog.c are naive, don’t really know how kernel internal work, write them after a tiny bit of search & read … :S
also i wasn’t include the linux icon overwrite who was into the original kernel 4.12 patch

i just found that adding CONFIG_DRM_LIMA=y in the .config enable & compile the new mainline driver \o/

kernel with lima is here > http://gs.dread.fr/kernel/lima/

i’ll try rebrand a cleaner patch with all fix tomorrow night, until here is some step i done :

git clone GitHub - torvalds/linux: Linux kernel source tree --depth 1
mv linux b
curl http://www.mirari.fr/nVYd?a=open > linux.5.patch
patch -p0 < linux.5.patch
curl http://www.mirari.fr/tvRc?a=open > ./b/arch/arm/boot/dts/sun8i-r16-clockworkpi-cpi3.dts
curl http://www.mirari.fr/okPu?a=open > ./b/sound/soc/sunxi/sun8i-codec-analog.c
cd b
cp ./arch/arm/configs/clockworkpi_cpi3_defconfig .config
edit .config & add CONFIG_DRM_LIMA=y (it seem compile overwrite the file, i was need multiple set before really set ?!)
install arm-linux-gnueabi-gcc ,here on arch & aur > pikaur -S arm-linux-gnueabi-gcc
install uboot-tools for mkimage last command, on arch > pacman -S uboot-tools
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n “Linux kernel” -d arch/arm/boot/zImage uImage

@r043v: I have given up on this exact method, but have a mostly working version based on a debian core… none of that is why I’m posting this RN. what I Want to attempt rn is maybe v0.4 of the firmware or maybe a complete community build as there’s a LOT thats been updated since Jun 2018 (release of v0.3) and I’m waiting to hear if theres something new in the works already. thoughts?

i’ve got a running kernel 5.1 (with lima inside)

i also compiled latest mesa (with lima support) and latest x11,
but for now cannot have x11 using lima, it still wanna use fbdev :- /

also the kernel use the os 1 dtb, it does not boot with my generated one, hang after wifi init (and upgrading wifi drivers from sid was not help)

a full community build would be awesome :’)

Wow! Please send what you’ve done in detail. I’m installing a second SD with bare 0.3 and want to work with you on getting it all up to snuff. Screw that latest debian core go from there and ensure to use apt the whole way.

http://gs.dread.fr/kernel/kernel.gfx.stack.tar

boot content get kernel image, patched uboot scr file (to show console), os 0.1 dts (0.2 or 0.3 may work), last dts who not boot

some compilation have be done using tools from debian experimental repos

i put my bash history, bin for mesa, xorg, xf86-video-fbdev & xf86-video-fbturbo

no xorg.conf is need

also put dmesg output & xorg log file, can be found on http://gs.dread.fr/kernel/

kernel compilation use method of last post, i included in the tar the .config file used

Amazing. I will work on this starting tomorrow. I also need to get my debian qemu system linked to the forum. I’ll try for this weekend

1 Like

sorry for the mess, the mirari host service wasn’t give raw file but txt explorer without a ?a=open appended to the url, i edit the previous message

don’t have my gs under the hand to test, but i redo a complete patch for latest kernel source
http://gs.dread.fr/kernel/patch.diff.txt
linux folder do not need anymore to be named b

and now i feel dumb. i’m trying to setup the kernel for build using this patch and failing. you would think with nearly 25 years of linux use I would know this stuff like the back of my hand. ROFL. i WILL have a v0.31-UNOFFICAL build someday soon. just need to sort this diff out get it compiled/tested and update a lot of the libs. I am also thinking i might just start from a base simple debian arm branch and see if i can get it to boot with this kernel/etc then start actually getting it all implemented using proper official debian packages or a custom repo for any that need to be tailored. would LOVE help if there are any other debian gurus around. I can setup everything on my web server and a collab environ for us as well.

have you successfully boot with my binary kernel ?

as the master commit fast patch may not apply nicely
also ./linux/arch/arm/boot/dts/Makefile was containing a duplicate line, sorry patch mess is a mess ^^

try with this diff archive, http://gs.dread.fr/kernel/linux.patch.tar.xz

i would love an arch arm build :slight_smile:
system is so fresh :

armv7h core linux-armv7 5.1.8-1 The Linux Kernel and modules - ARMv7 multi-platform

armv7h core linux-armv7-rc 5.2.rc5-1 The Linux Kernel and modules - ARMv7 multi-platform (release candidate)

here is my current build step

git clone https://github.com/torvalds/linux.git --depth 1
cd linux
curl http://gs.dread.fr/kernel/patch.diff.txt | git apply -v
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- clockworkpi_cpi3_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux kernel" -d arch/arm/boot/zImage uImage
mkdir modules
INSTALL_MOD_PATH=./modules make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install

Nope. I decided to start from a bare Debian arm again so I just got that setup in qemu and “cloning” it to an ad rn. Then I will be ensuring it boots with the v0.3 kernel and then trying again to latch and build

so i’ve finally given up on getting the debian to behave on windows. qemu now crashes when it tries to start xwin. will continue in linux but this is definitely an issue going forward.