µConsole's emulation

Hi there,

with some awful hackery i was able to “emulate” µConsole’s OS on x86 pc.

Why? well, i needed something faster than D1 to compile stuff, also it was easier to spin GitHub - LekKit/RVVM: The RISC-V Virtual Machine with actual OS image than setting up some cursed ubuntu abomination with cross compiler ;d.

Basically you have to use 6.8 kernel provided with github releases, ditch DTB declaration from extlinux and disable LCD driver. I can share “patchwork” that’s needed to achieve this result if any1’s interested

5 Likes

This is really cool, and makes me consider possibly buying an R01 for my Devterm/uConsole. Is there a way to configure the RISC-V virtual machine to attempt to match the speed of the R01? For compiling it totally makes sense to run it full throttle, but I figure if it could get close to being locked down to the actual speed, it might be an interesting way to loosely evaluate the performance of the R01 before getting the actual hardware. Even being command line only, it still might be interesting.

Seems like the main benefit of the R01 is the low power consumption. But even at its cheap price, I’ve had trouble convincing myself I “need” one, as I’m not sure how well it performs, or even what I would do with it, exactly, beyond just playing around a bit with RISC stuff. Hopefully this doesn’t sound creepy, but I’ve been keeping an eye on your posts here, as it seems like you’re something of an R01 enthusiast, and I’m curious to see what you do with yours, as it may finally convince me to get one. Currently I’ve been using the CM4, as my A06 has been put away.

People asked for a “emulated” Gameshell in the past too (even just a command line environment like this), and were largely ignored. But it would have been useful for the same reasons this is – faster to compile on a desktop machine, and cleaner than having to frankenstein some other linux install with a cross compiler, etc.

Anyhow, thanks for sharing!

3 Likes

hi, thanks for reaching out :slight_smile:

makes me consider possibly buying an R01

do not xd. while with RPI CM even 3 you might consider it being handheld laptop, then with R01 it’s a toy. GUI doesn’t reallu cut, web browsers of any kind do lag horribly.
As stated on CPI’s website - it isn’t ‘production ready’

Is there a way to configure the RISC-V virtual machine to attempt to match the speed of the R01

not that i know of. there might be execution cap implementend in librvvm but theres no exposed interface as far as i know. you can limit cores association but do other tricks to hinder performance but you’l never get 100% accuracy.

main benefit.

for me the real benefit is it being really solid future candidate on early stage. for instance ARM is so good and seasoned that manufacturers can stick it to cheapest phones and be certain that end consumer gets stable and somewhat efficent platfrom. this isnt a case for risc-v, not yet at least.

if you really want to try one out, go with Milk-v duo 256 or similar, it’s cheap and you won’t hurt much if you doesn’t like it. to really know and take advantage of platform you have to dive deep into nitty gritty details like opensbi’s role in this whole mess and maybe patch your own uboot to enable LCD early in the boot process.

in the other words if you’ve read ‘from power on to bash prompt’ and you felt that much of stuff is missing in this howto then you might try, otherwise you’l be dissapointer with speed, capabilities and overall experience.

i don’t want to say i am a hacker or someone like this, there’s bunch of stuff that i am learning despite being old fart, but this simply makes me happy, more that slapping “production ready” CM4 and playing some retro games out of the box.

Hopefully this doesn’t sound creepy, but I’ve been keeping an eye on your posts here,

of course it isn’t creepy, it’s forum after all so i am rather flattered that anyone want to follow my crooked posts and finds them at least entertaining :wink:

People asked for a “emulated” Gameshell in the past too (even just a command line environment like this), and were largely ignored.

because CPU emulation is easy, environment emulation is really a challenge. My “workaround” with RVVM also swaps kernel and ditches “hardware aspect” of µConsole, i don’t have “wifi chip”, “i2c/spi bus”, nor LCD to drive. RVVM is something like QEMU on steroids, you get framebuffer (which in a big stretch might be treated as LCD working from early boot), UART and CPU+mem+storage. It’s convienient for native compilation but rather useless for any development for the platform. There’s no way to “attach 4g extension card” to RVVM and test for example different AT commands.

To summarize, if you have some life and money to waste, try Milk-v or R01. Prepare yourself for pain and disappointments and joys coming off things that are taken as granted on arm or x86, like “working cpu frequency scaling”.

3 Likes

AdCock do not listen to the haters. The R01 is a sweet device. The minute you turn it on you feel as if you’re in the classic movie Hackers.

There are a few annoyances though. It doesn’t shut down completely. It gives up on life and the screen hangs blank but on.

There is also no Start Button so launching apps can be quite difficult. But if still recommend

That would be very interesting, yes. The A-06 is very capable of compiling anything, but linking qt6 required an obscene amount of RAM and, after much trial and error, I landed on using qemu-binfmt on my desktop system. Some fiddling was required to get a functional chroot: since I registered qemu as the handler for 64-bit ARM binaries, I had to make sure that qemu-aarch64 was available inside the chroot and all the libraries it linked against.

I think something like that would work fine for a RISC-V CPU, but very interested in how you’ve set yours up. I mostly used the prebuilt packages from slarm64 ([sic], the ARM-64 Slackware project has sort of taken custody of the RISC-V Slackware port), and for anything else that I needed, it was fast enough to compile on-device. (I am not likely to try to run Firefox on it. I really like the D1, I don’t wanna fill its memory with JavaScript.)

For builds now, I actually use a TPi2 RK1; I should probably write that up in the thread ( CRUX for DevTerm A06, dev notes ). I imagine that you could do something analogous by getting one of those Lychee Clusters: LicheePi Cluster 4A - Sipeed Wiki . Very cool gear, but possibly overkill just to speed up your builds.

I like it! I use it all the time. I should probably say that I’m running a kind of minimal environment on the R-01 DevTerm: lightweight UI (ratpoison, conky), some small programs (urxvt, xpdf, lighttpd, w3m), and most of the time it is connected to another machine that is doing more work (drawterm to the Plan 9 systems, ssh to the Linux systems). I run gcc and the go compiler sometimes, I use awk a lot, Ruby once in a while.

All of that stuff that I have up and running, the CPU sits at about 3% used, using about 150MB RAM. Because of that, the batteries last 6-8 hours (depending on how I set the backlight), and this is incredibly useful.