Linux On Scratch! (nope, not "linux from scratch"). A build of RISC-V linux running on Scratch 3.0
Posted by bilman66@reddit | linux | View on Reddit | 73 comments
Hi! I've been working on writing a RISC-V emulator on scratch blocky code and just last week I released it! It took months of work but here it is (use the turbowarp link so it runs with any kind of speed)
https://experiments.turbowarp.org/next/892602496
https://scratch.mit.edu/projects/892602496

AngelPhoenixBG@reddit
can't run it it Errors on turbowarp and unknown project on scratch or scratch project not shared if anybody else got to run it no errors just say your device in thee comments
bilman66@reddit (OP)
Go to the turbowarp home page, you’ll see the project in the featured projects
AngelPhoenixBG@reddit
But turbowarp can't run unshared projects
AngelPhoenixBG@reddit
anymore
AngelPhoenixBG@reddit
the*
Beautiful_Beyond3461@reddit
how
mingde@reddit
The Scratch site is down!
Is this on github?
bilman66@reddit (OP)
My account got hacked and everything was wiped including this project lol
Acceptable-Bottle-41@reddit
I have a backup of your project in my computer, now I don't know where it is
bilman66@reddit (OP)
I have a backup on GitHub though yes
Gustavoppw@reddit
Do you still have it? Pls share
WiddeX64@reddit
Hello! I usually never use Reddit but your project was very cool so I made a quick account.
So I wonder if you could provide the GitHub backup or tell your GitHub username...
mingde@reddit
damn! who hacks scratch?
I was sharing the link. Github link?
Parrot_GamesGG@reddit
this project has been taken down. where can i get its file then?
Parrot_GamesGG@reddit
i also saw that you might've been banned on Scratch, actually. that's too bad :'(
bilman66@reddit (OP)
Yeah I was hacked and banned and the scratch team has totally ignored me. It’s reuploaded here: https://scratch.mit.edu/projects/1201938491/
Parrot_GamesGG@reddit
Can I upload the project file to Internet Archive for preservation purpose? Just in case if this will be taken down again, it's a very impressive experiment, and I want to preserve it
EstimateMuted4573@reddit
wow.
MilosDaDogeDev@reddit
It is deleted now
bilman66@reddit (OP)
Yeah 😭 account got hacked
MilosDaDogeDev@reddit
is there an archive?
bilman66@reddit (OP)
Oh yeah. Hoping to re upload it soon
MilosDaDogeDev@reddit
Question, how did i found about this, well, someone rewrite both the risc v emulator and the linux you made in roblox.
bilman66@reddit (OP)
Oh my goodness, please tell me the name of this 😂
MilosDaDogeDev@reddit
https://www.roblox.com/games/18573842843/Linux-6-1-On-Roblox
Amirthewerdo@reddit
now you should remake ubuntu or debian
DALEK_77@reddit
Now run DOOM on it.
Painting_Master@reddit
Nevermind Doom, can it run Scratch?
user_luca@reddit
DOOM runns on Scratch
Reddit post
https://scratch.mit.edu/projects/565583443/
ericw31415@reddit
But that's not the same as running DOOM on Linux on Scratch
Pain9909@reddit
This is the way.
outofstepbaritone@reddit
now lets get debian running on it
please explain how this works
LvS@reddit
Take one thing that is Turing complete to build another thing that is Turing complete.
To not overdo it, pick something that isn't too complicated.
A CPU instruction set isn't really complicated.
To be exact, here's a full CPU emulator for a simple instruction set in only 500 lines (with comments).
You can then reimplement (or maybe even use tools to convert) that code in Scratch, which is yet another programming language.
Now all you need is to compile a Linux kernel for that CPU instruction set and use your emulator to boot it.
outofstepbaritone@reddit
this clears it up. thanks for the explanation
Solstice_Projekt@reddit
What he left out is that you also need to cover port accesses, which means not just the access but also the responses. You need to cover displaying text, which means you have to at least cover BIOS functions. Same goes for storage access.
Writing a CPU emulator is easy. Writing an emulator for a whole system is hard. Like, it's easy to emulate the 6502, which runs in the C64 and NES. It's a lot harder emulating a whole C64 or NES, because you also have to emulate the other hardware.
Silent-Item1626@reddit
The way that the thing emulates storage or uses storage is that it copies the rom into ram and runs it from their I found this out by doing tinkering and erasing the ram and examining the code it copies the ROM when you press the green flag button, this rom is also kind of edible. So you could probably try and add more applications to it I haven't tried it, but I'm trying to see how to decode it to do it hopefully, I explained it wrong
helimo_@reddit
The scratch site is down ),: Do you have a backup?
iorvethgamer64@reddit
at one point we will get full gui and then we will get windows here by installing
Fe4rless-Pheon1x@reddit
fizzbuzz 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz
Key_River7180@reddit
how the frick you did that?
bilman66@reddit (OP)
Idk it was on accident, I was just spamming my keyboard randomly and it did that 🤷♂️
redbikemaster@reddit
What are you, a thousand monkeys in a room?
A kilomonkey?
AatreyuEndslayer2@reddit
I am speechless...
rockst4rzz@reddit
i tried to remix this, it broke my laptop
d3_1-reddit@reddit
now we can find out how much ram scratch instances actually have
d3_1-reddit@reddit
wait only 64mb well wow
Percentage_Thin@reddit
Probably only the amount that the emulator allows Linux to have.
tpglitch@reddit
How do i load a custom kernel??
Far_Good_2275@reddit
Whatever ill just say my ideas here you should continue on GitHub and also publish the image and the algorithm for other people to make their own images. You should also continue in turbowarp. Got the Project packaged and running by deleting ROM and RAM and importing It back when It loads on browser. Also i been wondering if you could get Ubuntu CLI running on it basically you can start by looking at official docker builds of Ubuntu that has been made very tiny anda minimal with no kernel and try like Ubuntu 18/20 warn me if you make a GitHub. More ideas coming
Electcell49012@reddit
that is the exact intentions of sdk :D
Electcell49012@reddit
have you tried putting a flubox gui on the default image?
Far_Good_2275@reddit
Hey please PM me Up i have múltiple good ideas. Also i feel like you need more space and i might have the solution.
Far_Good_2275@reddit
If you cant PM me Tell me and i Will say them here.
archiso7@reddit
Looking through the code, it seems like the ROM was manually input into that list. Why? How?
bilman66@reddit (OP)
No it wasn’t, it was just loading into it from a text file
archiso7@reddit
how was it loaded? I had no idea scratch was capable of that.
bilman66@reddit (OP)
In the editor, just right click on the list view and hit the import button
archiso7@reddit
the web editor? or the desktop one?
bilman66@reddit (OP)
Both
TheRealDevonian@reddit
Why do I suddenly feel an urge to see WINE running on Scratch?
Hellscaped@reddit
Hey, do you still have the original javascript emulator for this? I kinda wanna try porting it to lua and attempting to run linux on roblox.
Wrexes@reddit
... But can it run Doom?
Eman108261@reddit
Yes, yes it can
leo_grachov@reddit
We need to add a graphical interface to it (e.g, Ubuntu).
Pain9909@reddit
Dude this is awesome.
DEVIISIONreddit@reddit
now lets turn this into PC98 and get touhou 4 running on it
SpookyFries@reddit
This is insane. I can't even imagine what the blocks look like for something like this (tried to find a way but didn't see anything obvious)
EnZon332@reddit
How is this possible
Meowie__Gamer@reddit
WHAT THE- HOW
GodOfPlutonium@reddit
Any turing machine can simulate any other turing machine
Zatujit@reddit
omg
aue_sum@reddit
WHAT THE
ItsRogueRen@reddit
This is incredibly cursed and I love it